[sudo-users] revert to SUDO_USER

Walter Barnes walter_barnes05 at yahoo.com
Sun Sep 2 01:37:10 EDT 2007


After a program is executed using sudo how would that program momentarily revert to SUDO_USER to perform some task?

I'm building a package manager for my LFS based system that must execute separate build, test and install scripts when building a binary package from source. Further, the package manager uses aufs to create a fake root for the install script so it must call mount several times then do a chroot.

My thinking then is that I design the program so that it must execute as root and use sudo to run it. The program can then check the SUDO_USER env var and execute only the build and test scripts as that user.

Any insight as to how I can accomplish this would be greatly appreciated.


Moody friends. Drama queens. Your life? Nope! - their life, your story. Play Sims Stories at Yahoo! Games.

More information about the sudo-users mailing list