Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
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).)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://623882]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (6)
As of 2017-01-23 12:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you watch meteor showers?




    Results (192 votes). Check out past polls.