Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

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 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?

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (9)
As of 2016-10-23 14:31 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (301 votes). Check out past polls.