Permission problems - though all three UIDs are 0

From: Christoph Pleger
Date: Wed Nov 21 2018 - 10:57:05 EST


Hello,

I want to ask for the possible reasons why a program, called from another program with setuid-root file permissions and an additional setreuid(0,0) to also set the real uid to 0, still gets an "Operation not permitted" error.

In my case, I execve lvcreate from the setuid-root binary. This works well when I use my program as a non-root user from the command line, but I want to call it is a non-root user from pam_exec PAM module and with that lvcreate fails.

Regards
Christoph

PS: Please, no discussion about possible security holes in setuid-programs here