When we access file, file permission is checked from effective user ID of process. But, how about changing user ID like setuid(), setreuid(), seteid(). On these functions, superuser privilege is also checked from effective user ID(effective user ID is root) of process calling these functions?
what exactly means that we have superuser privileges
linux;permissions
The expression have superuser privileges can mean different things. You need to look at the context.In a system administration context, have superuser privileges usually means a user who is allowed to access the root account, for example because they are authorized via the sudo configuration, or because they know the root password.In a programming context, have superuser privileges usually means a process that is running with UID 0. If it is stated at a point in time, e.g. when discussing whether a system call is authorized, it usually means that the effective UID is 0 for most system calls. If it is state in a timeless way, it usually means that the process is able to set its effective UID to 0, which also includes processes whose real or saved user UID is 0.If you want to know what the exact requirements are for a particular function, check the documentation of this function on your system (there are variations depending on the underlying kernel). TL,DR: context matters.