On Tue, Aug 25, 2009 at 08:31:44PM -0400, Michael Spang wrote: > On Tue, Aug 25, 2009 at 8:11 PM, Steve Langasek<vor...@debian.org> wrote: > > On Tue, Aug 25, 2009 at 07:37:22PM -0400, Michael Spang wrote: > >> It seems you'd need to call setregid(getgid(), getgid()) to fully > >> drop privileges. When using setgid() the set-group-id is not set.
> > The current use of setuid() has the same limitation. > It doesn't, at least not on Linux. The superuser is a special case, as > documented by the manpage: > If the user is root or the program is set-user-ID-root, special > care must be taken. The setuid() function checks > the effective user ID 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. Ah, true; ok. -- Steve Langasek Give me a lever long enough and a Free OS Debian Developer to set it on, and I can move the world. Ubuntu Developer http://www.debian.org/ slanga...@ubuntu.com vor...@debian.org
signature.asc
Description: Digital signature