Linux RUID EUID SUID

Each process has three user IDs: the real user ID (realuid, or ruid), the effective user ID (effective uid, or euid),and the saved user ID (saved uid, or suid). The real uid identifies the owner of the process, the effective uid is used in most access control decisions, and the saved uid stores a previous user ID so that it can be restored later.

When a process is created by fork, it inherits the three user IDs from its parent process. When a process executes a new file by exec it inherits the uid, euid from its parent process but get suid from parent's euid .unless the SUID bit of the new file is set, in which case the effective uid and saved uid are assigned the user ID of the owner of the new file.

seteuid() It sets the effective uid while leaving the real uid and saved uid unchanged. However, when the current effective uid is not zero, only allow the parameter new euid only to be equal to any of the current three user IDs. when the current effective uid is zero, the new euid can be any value u want.

setuid() It sets all of the three IDs or only for euid. If the current euid is not zero, only allow the parameter newuid to be equal to either the real uid or saved uid, and the current ruid, suid are not changed. If the effective uid is zero, a successful setuid(newuid) call sets all three user IDs to newuid.

setreuid() It modifies the real uid and effective uid, and the saved uid is set as euid. When the current euid is not zero, allow the parameter neweuid only to bee qual to any of the three current user IDs. The newrudi must be equal to current euid or ruid. If the current euid is zero, the new euid and new ruid can be any values u want.

setresuid() system call to be allowed, . If the current euid is zero, the new suid, new euid and new ruid can be any values u want. When the current euid is not zero, each of the three parameters must be equal to one of the current three user IDs of the process.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值