Hello Matthias,

A writeable tmpdir is normally required by Inline.

Unchecked:

You could overwrite that subroutine from your code with a hack like

*Inline::find_temp_dir { return '/dev/null' }

That will overwrite the Inline.pm version and return a true value for
checking.

Kind Regards

James

*Dr James Freeman*
Founder
------------------------------
P: 1300 472866 (1300 GP2U NOW) <1300472866>
F: 1800 472832 (1300 GP2U FAX)
M: +61 (0)438 350 854 <+61438350854>
E: ja...@gp2u.com.au
W: http://gp2u.com.au <https://gp2u.com.au/>
[image: GP2U Telehealth]
GP2U Telehealth
Level 2, 38 Montpelier Retreat
Battery Point
Hobart 7004
[image: Facebook] <https://facebook.com/skype2doctor> [image: Twitter]
<https://twitter.com/gp2u_telehealth> [image: Google]
<https://plus.google.com/u/0/104650770921912366841> [image: LinkedIn]
<http://www.linkedin.com/in/drjamesfreeman>
This email and any attachments to it (the "Communication") is, unless
otherwise stated, confidential, may contain copyright material and is for
the use only of the intended recipient. If you receive the Communication in
error, please notify the sender immediately by return email, delete the
Communication and the return email, and do not read, copy, retransmit or
otherwise deal with it. Any views expressed in the Communication are those
of the individual sender only, unless expressly stated to be those of GP2U
Telehealth Limited ABN 58 151 445 715, or any of its related entities.


On Tue, 29 Jan 2019 at 23:16, Matthias Apitz <g...@unixarea.de> wrote:

>
> Hello,
>
> We're using Inline-C in a Perl CGI-engine to connect to a C-written
> shared library (libblow.so) for decrypting strings with BlowFish (to
> obfuscate the
> details and the used key). This is delivered to a production environment
> as:
>
> # 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
>
> /usr/local/sisis-pap/lib/.Inline
> /usr/local/sisis-pap/lib/.Inline/config-x86_64-linux-thread-multi-5.026002
> /usr/local/sisis-pap/lib/.Inline/lib
> /usr/local/sisis-pap/lib/.Inline/lib/auto
> /usr/local/sisis-pap/lib/.Inline/lib/auto/SisisAdminInstall_pl_64f0
>
> /usr/local/sisis-pap/lib/.Inline/lib/auto/SisisAdminInstall_pl_64f0/SisisAdminInstall_pl_64f0.inl
>
> /usr/local/sisis-pap/lib/.Inline/lib/auto/SisisAdminInstall_pl_64f0/SisisAdminInstall_pl_64f0.so
> /usr/local/sisis-pap/lib/.Inline/lib/auto/SisisAdmin_64f0
>
> /usr/local/sisis-pap/lib/.Inline/lib/auto/SisisAdmin_64f0/SisisAdmin_64f0.inl
>
> /usr/local/sisis-pap/lib/.Inline/lib/auto/SisisAdmin_64f0/SisisAdmin_64f0.so
> /usr/local/sisis-pap/lib/.Inline/build
> /usr/local/sisis-pap/lib/.Inline/.lock
>
> # ldd
> #
> /usr/local/sisis-pap/lib/.Inline/lib/auto/SisisAdminInstall_pl_64f0/SisisAdminInstall_pl_64f0.so
>         linux-vdso.so.1 (0x00007ffc223fb000)
>         libblow.so => /usr/local/sisis-pap/lib/libblow.so
> (0x00007efdeb377000)
>         libssl.so.1.1 => /usr/local/sisis-pap/lib/libssl.so.1.1
> (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 Inline.pm as:
>
>
> #==============================================================================
> # Find the 'Inline' directory to use.
>
> #==============================================================================
> my $TEMP_DIR;
> 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
> ours.
>
>         matthias
>
> --
> Matthias Apitz, ✉ g...@unixarea.de, http://www.unixarea.de/
> +49-176-38902045
> Public GnuPG key: http://www.unixarea.de/key.pub
> October, 7 -- The GDR was different: Peace instead of Bundeswehr and wars,
> Druschba
> instead of Nazis, to live instead of to survive.
>

Reply via email to