在类 Unix 系统中,“setuid”通常指“设置用户 ID”机制:当可执行文件设置了 setuid 位 时,程序运行时会临时以文件所有者(常见为 root)的权限执行;也可指相关的系统调用/函数(如 setuid())用于设置进程的用户 ID。(在不同语境下可指“权限位”或“系统调用”。)
/ˈsɛtˌjuːɪd/
The program needs setuid to access that protected file.
这个程序需要 setuid 才能访问那个受保护的文件。
Because the binary is setuid root, a small bug could become a serious security risk if untrusted input is not handled carefully.
由于该可执行文件是 setuid root,只要对不可信输入处理不当,一个小漏洞就可能变成严重的安全风险。
由 set + uid 组成:set 表示“设置”,uid 是 user ID(用户标识) 的缩写。该术语源自 Unix 的用户与权限模型,用于描述“运行时有效身份(effective UID)可能与实际身份不同”的机制。
setuid() 等机制