0xbeef has asked for the wisdom of the Perl Monks concerning the following question:
I have a script which runs as root, since it collects system info for healthchecks.
I'd like to run getcwd() on AIX as a different user than root, as a test for underlying mount-point permission problems.(getcwd returns undef if it cannot access the original mount-point)
I have tried doing "$> = $< = $newuid", but I get "Operation not permitted". This is the case even if I try to use a binary wrapper to try avoid the problem where the O/S prevents setuid scripts.
Any ideas, other than seperating the task entirely (which seems like a bad idea, security-wise) e.g.
system("su - user -c /mycode/getcwd($targetdir)")?
-oxbeef
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: getcwd() as different user
by pileofrogs (Priest) on Nov 18, 2005 at 21:59 UTC | |
by 0xbeef (Hermit) on Nov 18, 2005 at 22:42 UTC | |
by 0xbeef (Hermit) on Nov 19, 2005 at 12:53 UTC | |
Re: getcwd() as different user
by ikegami (Patriarch) on Nov 18, 2005 at 21:35 UTC |
Back to
Seekers of Perl Wisdom