good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Re: Running a perl script with root, changing to another user and then back to root?by salva (Canon) |
on Feb 15, 2018 at 15:38 UTC ( [id://1209230]=note: print w/replies, xml ) | Need Help?? |
Maybe setting the EUID (Effective User Id) is enough for your purposes: check $> documentation in perlvar.
Update: Though, note that you can do that only when the code running with the EUID changed is controlled by you and safe. Otherwise, it could be made to change the EUID again in order to execute arbitrary code as root.
In Section
Seekers of Perl Wisdom
|
|