What's the purpose of each of the different UIDs a process can have?

前端 未结 5 525
暖寄归人
暖寄归人 2020-12-04 12:39

Real UID, effective UID, and some systems even have a \"saved UID\". What\'s the purpose of all these, especially the last one?

5条回答
  •  庸人自扰
    2020-12-04 12:59

    The accepted answer is not correct regarding that real UD's can not be changed by anyone except root. From the man page for setuid: (I could not make a comment)

    The setuid() function sets the real and effective user IDs and the saved set-user-ID of the current process to the specified value. The setuid() function is permitted if the effective user ID is that of the super user, or if the specified user ID is the same as the effective user ID. If not, but the specified user ID is the same as the real user ID, setuid() will set the effective user ID to the real user ID.

提交回复
热议问题