develooper Front page | perl.inline | Postings from January 2019

.Inline dir readonly

Thread Next
Matthias Apitz
January 29, 2019 12:16
.Inline dir readonly
Message ID:


We're using Inline-C in a Perl CGI-engine to connect to a C-written
shared library ( for decrypting strings with BlowFish (to obfuscate the
details and the used key). This is delivered to a production environment

# ls -ld /usr/local/sisis-pap/lib/.Inline
drwxr-xr-x 4 bin bin 4096 Jan 25 12:32 /usr/local/sisis-pap/lib/.Inline
# find /usr/local/sisis-pap/lib/.Inline                                                

# ldd
# /usr/local/sisis-pap/lib/.Inline/lib/auto/SisisAdminInstall_pl_64f0/ (0x00007ffc223fb000) => /usr/local/sisis-pap/lib/ (0x00007efdeb377000) => /usr/local/sisis-pap/lib/ (0x00007efdeb109000)

and works just fine. Note: the things below .Inline are there and not
compiled on the flight on first use of the Inline-C code.

The only problem is, that the dir .Inline must be writeable by the
apache-process which runs as 'nobody'. This is checked in as:

# Find the 'Inline' directory to use.
sub find_temp_dir {
    return $TEMP_DIR if $TEMP_DIR;

    my ($temp_dir, $home, $bin, $cwd, $env);
    $temp_dir = '';
    $env = $ENV{PERL_INLINE_DIRECTORY} || '';
    $home = $ENV{HOME} ? abs_path($ENV{HOME}) : '';

    if ($env and
        -d $env and
        -w $env) {
        $temp_dir = $env;

Why is the check '-w $env' made there, at the beginning? Of course, if something really
must be compiled, it must be writable, but not in any use case, like


Matthias Apitz, ‚úČ, +49-176-38902045
Public GnuPG key:
October, 7 -- The GDR was different: Peace instead of Bundeswehr and wars, Druschba
instead of Nazis, to live instead of to survive.

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About