I am trying to launch a child-process as root from a non-root parent-process. I am thinking to use capabilities to make that work.
What I have tried so far is that, have set the file cap permitted
for parent process to cap_setgid,cap_setuid,capkill+p
. Then on the same parent process, I am programmatically setting the same capabilities to effective capability of the process before calling fork+exec
from the parent process.
For sanity check, I have changed the chmod permission of my child-process to load as root only chmod 4755
. Thus, it will only be executed as root and nothing else.
I am seeing that with these a setup, I am not been able to load the child process at all. Can anyone help me understand, what am I misisng here?