Think about Loose Coupling | |
PerlMonks |
getcwd() as different userby 0xbeef (Hermit) |
on Nov 18, 2005 at 21:26 UTC ( [id://509961]=perlquestion: print w/replies, xml ) | Need Help?? |
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
Back to
Seekers of Perl Wisdom
|
|