]> andersk Git - openssh.git/commitdiff
- (djm) [uidswap.c] bz#1412: Support >16 supplemental groups in OS X.
authordjm <djm>
Wed, 21 Jan 2009 05:04:24 +0000 (05:04 +0000)
committerdjm <djm>
Wed, 21 Jan 2009 05:04:24 +0000 (05:04 +0000)
   Patch based on one from vgiffin AT apple.com; ok dtucker@

ChangeLog
uidswap.c

index e0ac6bd8c09504e5556c7aabdb17434417d08839..1e443f66545b176c6995d40fa46ec820ba32c9b7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
index 91d878c30e1b34b308b46aa6430233e84a89192e..8376483967a9f609f089a1879423ee6b3ea4d4d0 100644 (file)
--- a/uidswap.c
+++ b/uidswap.c
@@ -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));
This page took 0.058821 seconds and 5 git commands to generate.