【发布时间】:2015-10-12 08:31:03
【问题描述】:
setuid 和 seteuid 函数有什么区别。在手册页中,这两个函数都有类似的描述。
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.
在这两个描述中都包含sets the effective user ID of the calling process。那么两者有什么区别
这两个以及这些函数之间的功能有何不同。
还有一个疑问是,我们只使用 chmod(chmod u+s) 可以设置文件的set user id权限。那么只有在程序运行时,进程才有权限设置谁设置 用户身份。除了这些之外,这些函数如何为进程设置有效的用户 ID。
【问题讨论】:
-
看起来与您同一天的其他帖子相似。为了整理一下,也许编辑后来发布的问题以包含上面的信息,然后删除这个?