What is the difference between setuid and seteuid function. In the man page, both functions have a similar description.
UIP:
DESCRIPTION
setuid() sets the effective user ID of the calling process. If the effective UID of the caller is root, the real UID and saved
set-user-ID are also set.
seteuid:
DESCRIPTION
seteuid() sets the effective user ID of the calling process. Unprivileged user processes may only set the effective user ID to
the real user ID, the effective user ID or the saved set-user-ID.
Both descriptions contain sets the effective user ID of the calling process
. So what is the difference between the two and how the functionality differs between these functions.
And one more doubt is the use of chmod (chmod u + s) only we can set the set user id for this file. Then, only during the execution of the program does the process have permission that is set to User ID. In addition, how these functions establish an effective user ID for the process.
source
share