Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Apache, no suexec, suid and the environment

by Fletch (Chancellor)
on Jun 28, 2007 at 13:24 UTC ( #623882=note: print w/ replies, xml ) Need Help??


in reply to Apache, no suexec, suid and the environment

You can use (localized) changes to %ENV to modify a child process' environment.

{ local $ENV{ LD_LIBRARY_PATH } = q{/path/to/libs}; my $cmd = "..."; system( $cmd ) == 1 or die "Problem with '$cmd': $?\n"; }

(That being said, I also want to say that I vaguely recall ld.so does some sanitizing of the environment on some platforms if the EUID and RUID don't match, so you might not be able to get this to work without another layer of indirection (i.e. you start a suid wrapper which sets the environment up then calls the thing you really want to call).)


Comment on Re: Apache, no suexec, suid and the environment
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://623882]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (6)
As of 2014-07-30 21:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (241 votes), past polls