]> andersk Git - openssh.git/blobdiff - uidswap.c
- djm@cvs.openbsd.org 2010/01/30 02:54:53
[openssh.git] / uidswap.c
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.09547 seconds and 4 git commands to generate.