setuid vs seteuid功能

setuid和seteuid函数有什么区别.在man page中,两个函数都有类似的描述.

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.

在两个描述中都包含设置调用进程的有效用户ID.那么有什么区别呢
这两个以及这些功能间的功能如何不同.

还有一个疑问是,只使用chmod(chmod u s)
可以为文件设置set user id权限.然后,仅在程序的运行时期间,该进程具有设置为设置的权限
用户身份.除了这些函数之外,这些函数如何将有效的用户标识设置为进程.

最佳答案
man page

   Thus,a set-user-ID-root program wishing to temporarily drop root
   privileges,assume the identity of an unprivileged user,and then
   regain root privileges afterward cannot use setuid().  You can
   accomplish this with seteuid(2).

相关文章

Linux中的ARP防火墙主要用于防御ARP欺骗攻击,其效果取决于多...
insmod和modprobe加-f参数导致Invalid module format错误 这...
将ArchLinux安装到U盘 几个月前入门Arch的时候上网搜了不少安...
1、安装Apache。 1)执行如下命令,安装Apache服务及其扩展包...
一、先说一下用ansible批量采集机器信息的实现办法: 1、先把...
安装配置 1. 安装vsftpd 检查是否安装了vsftpd # rpm -qa | ...