Hi all,
The setuid helper via a shared library idea is not feasible. This idea was an extension of a minor misunderstanding I had about the privileges inheritance in Unix systems. I was under the impression that when we invoke a function in a library
which is setuid root file, the processes privileges would get escalated. This is *wrong*, for the following reason. The privilege of a process can be altered using file permissions of the executable, only during process creation. After creation of the process, the only way to alter the credentials of a process, is by using setuid calls.
I have reverted the se module to have a setuid helper binary as before. But I have taken this opportunity to clean up the setuid helper code and give it a new name - secexec. This functionality is now accessible via
se.secexec.secure_spawn python function. The function takes arguments the same way as
subprocess.Popen().
cheers,
--
--Krishnan Parthasarathi