Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

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).)

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

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 chilling in the Monastery: (2)
As of 2015-10-07 00:59 GMT
Find Nodes?
    Voting Booth?

    Does Humor Belong in Programming?

    Results (167 votes), past polls