Simon Bazley wrote:
> I've got a couple of conscerns, firstly I don't think a process can=20
> setuid(0) if its not root
If afpd drops its privileges using setuidU(), it's impossible to become=20=
root again on systems that use POSIX semantics -- regardless if it has=20=
been root or not.
=46rom the Linux manual page of setuid():
---
If the user is root or the program is setuid root, special
care must be taken. The setuid function checks the effec=AD
tive uid of the caller and if it is the superuser, all
process related user ID's are set to uid. After this has
occurred, it is impossible for the program to regain root
privileges.
Thus, a setuid-root program wishing to temporarily drop
root privileges, assume the identity of a non-root user,
and then regain root privileges afterwards cannot use
setuid. You can accomplish this with the (non-POSIX, BSD)
call seteuid.
---
regards
Alex
--=20
Alexander Barton, Freiburg, Germany
http://www.barton.de/, alex@...
|