Created
February 23, 2012 13:20
-
-
Save lasombra/1892756 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- lib/system.c 2012-02-23 11:30:11.000000000 -0200 | |
+++ lib/system.c.patched 2012-02-22 22:47:51.000000000 -0200 | |
@@ -1161,7 +1161,14 @@ | |
int groups_max(void) | |
{ | |
-#if defined(SYSCONF_SC_NGROUPS_MAX) | |
+#if defined(DARWINOS) | |
+ /* On OS X, sysconf(_SC_NGROUPS_MAX) returns 16 | |
+ * due to OS X's group nesting and getgrouplist | |
+ * will return a flat list; users can exceed the | |
+ * maximum of 16 groups. And easily will. | |
+ */ | |
+ return 32; // NGROUPS_MAX is defined, hence the define above is void. | |
+#elif defined(SYSCONF_SC_NGROUPS_MAX) | |
int ret = sysconf(_SC_NGROUPS_MAX); | |
return (ret == -1) ? NGROUPS_MAX : ret; | |
#else |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment