- (djm) [uidswap.c] bz#1412: Support >16 supplemental groups in OS X.

Patch based on one from vgiffin AT apple.com; ok dtucker@
This commit is contained in:
Damien Miller 2009-01-21 16:04:24 +11:00
parent 2676791c38
commit 1598d6bc55
2 changed files with 15 additions and 1 deletions

View File

@ -1,3 +1,7 @@
20090107
- (djm) [uidswap.c] bz#1412: Support >16 supplemental groups in OS X.
Patch based on one from vgiffin AT apple.com; ok dtucker@
20090107
- (tim) [configure.ac defines.h openbsd-compat/port-uw.c
openbsd-compat/xcrypt.c] Add SECUREWARE support to OpenServer 6 SVR5 ABI.
@ -4996,5 +5000,5 @@
OpenServer 6 and add osr5bigcrypt support so when someone migrates
passwords between UnixWare and OpenServer they will still work. OK dtucker@
$Id: ChangeLog,v 1.5157 2009/01/08 04:50:08 tim Exp $
$Id: ChangeLog,v 1.5158 2009/01/21 05:04:24 djm Exp $

View File

@ -233,6 +233,16 @@ permanently_set_uid(struct passwd *pw)
fatal("setgid %u: %.100s", (u_int)pw->pw_gid, strerror(errno));
#endif
#ifdef __APPLE__
/*
* OS X requires initgroups after setgid to opt back into
* memberd support for >16 supplemental groups.
*/
if (initgroups(pw->pw_name, pw->pw_gid) < 0)
fatal("initgroups %.100s %u: %.100s",
pw->pw_name, (u_int)pw->pw_gid, strerror(errno));
#endif
#if defined(HAVE_SETRESUID) && !defined(BROKEN_SETRESUID)
if (setresuid(pw->pw_uid, pw->pw_uid, pw->pw_uid) < 0)
fatal("setresuid %u: %.100s", (u_int)pw->pw_uid, strerror(errno));