Which UIDs should setuid attribute set?
Posted: Sat Apr 04, 2015 4:19 pm
I tried googling this and all i'm getting is that the setuid attribute shall set the user to the owner. But which UIDs should I actually set? Just the effective UID? Or also the real UID and saved-set-UID?
I'm guessing that it should be just effective, because otherwise programs like "sudo" wouldn't be able to tell who started them. But then again, the real UID must be set for things like "kill" to work.
So how am I supposed to do this? Also please give me a source if possible, because I actually cannot find what POSIX says about this (looking at some sudo code, it seems to assume that the real UID is of the user who actually started the process).
I'm guessing that it should be just effective, because otherwise programs like "sudo" wouldn't be able to tell who started them. But then again, the real UID must be set for things like "kill" to work.
So how am I supposed to do this? Also please give me a source if possible, because I actually cannot find what POSIX says about this (looking at some sudo code, it seems to assume that the real UID is of the user who actually started the process).