setegid bug
- From: Stanislav Sedov <stas@xxxxxxxxxxx>
- Date: Thu, 7 Jun 2007 21:36:50 +0400
Hi!
Recently several FreeBSD samba users reported a scary problem with
samba (http://bugzilla.samba.org/?id=3990). Further research in
cooperation with Timur Bakeyev (timur) showed, that we have a little
problem with setegid implementation. In FreeBSD (and even in
4.4BSD-Lite2) egid of the process is merely groups[0], so calling
seteuid function we simply override the first of supplementary groups.
However, POSIX says that not rgid, not any of supplementary groups
should bot be rewritten in setegid call.
There's some comments about optimizations which caused so scary
implementation, but I can't get what these optimizations are. Our first
cvs revision of kern_prot.c already contains similar implementation
with egid being effectively groups[0].
Probably, some of old-school committers remembered the initial
intention of making egid equal to groups[0]? Probably, I have missed
something?
Thanks a lot!
--
Stanislav Sedov
ST4096-RIPE
Attachment:
pgpnviTTKdWI4.pgp
Description: PGP signature
- Follow-Ups:
- Re: setegid bug
- From: Mike Meyer
- Re: setegid bug
- Prev by Date: Re: *at family of syscalls in FreeBSD
- Next by Date: RE: *at family of syscalls in FreeBSD
- Previous by thread: help on lock around vm_page
- Next by thread: Re: setegid bug
- Index(es):