setuid vs seteuid function

What is the difference between setuid and seteuid function. In man page both of the function have similar description.

setuid:

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.

In both of the description contains sets the effective user ID of the calling process. So what is the difference between
these two and how the functionality differs between these functions.

And One more doubt is, using chmod(chmod u+s ) only we
can set the set user id permission to the file. Then only during runtime of the program, the process have permission who is set to set
user id. Apart from these how these functions set the effective userid to the process.


Source: linux

Leave a Reply