Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 7 Jun 2007 21:36:50 +0400
From:      Stanislav Sedov <stas@FreeBSD.org>
To:        freebsd-arch@FreeBSD.org
Cc:        freebsd-hackers@FreeBSD.org, timur@gnu.org
Subject:   setegid bug
Message-ID:  <20070607213650.c02130bf.stas@FreeBSD.org>

next in thread | raw e-mail | index | archive | help
--Signature=_Thu__7_Jun_2007_21_36_50_+0400_q=oaWEyO7sI7gu3K
Content-Type: text/plain; charset=US-ASCII
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hi!

Recently several FreeBSD samba users reported a scary problem with
samba (http://bugzilla.samba.org/?id=3D3990). 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!

--=20
Stanislav Sedov
ST4096-RIPE

--Signature=_Thu__7_Jun_2007_21_36_50_+0400_q=oaWEyO7sI7gu3K
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.3 (FreeBSD)

iD8DBQFGaEI3K/VZk+smlYERAkwdAJ9Sp8lDY3Pq9ip1bx9M67GR+w+cPgCeI6EK
S1nHdh1Q416bECsdbapzk70=
=skA0
-----END PGP SIGNATURE-----

--Signature=_Thu__7_Jun_2007_21_36_50_+0400_q=oaWEyO7sI7gu3K--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070607213650.c02130bf.stas>