summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-03-06 14:21:31 +0000
committerkosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-03-06 14:21:31 +0000
commitaca674c2e7c0c99c9caf11e7fe46621b16d57bb5 (patch)
tree4989154c1d1919bc88ae4db2ed250ef2239edba3
parentdd9f5e87145f224bd3b95ced4374d9ca1a77c6e1 (diff)
* process.c (maxgroups, proc_setmaxgroups): increase max groups
limitation up to 65536. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31034 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--process.c27
2 files changed, 29 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 225052a9a3..cba6787adf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Sun Mar 6 23:18:23 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * process.c (maxgroups, proc_setmaxgroups): increase max groups
+ limitation up to 65536.
+
Sun Mar 6 22:20:59 2011 Tanaka Akira <akr@fsij.org>
* ext/openssl/ossl_pkey_ec.c: parenthesize macro arguments.
diff --git a/process.c b/process.c
index 38f5e28faa..e55c3fda83 100644
--- a/process.c
+++ b/process.c
@@ -4531,7 +4531,28 @@ proc_setgid(VALUE obj, VALUE id)
#endif
-static int maxgroups = 32;
+/*
+ * Maximum supplementary groups are platform dependent.
+ * FWIW, 65536 is enough big for our supported OSs.
+ *
+ * OS Name max groups
+ * -----------------------------------------------
+ * Linux Kernel >= 2.6.3 65536
+ * Linux Kernel < 2.6.3 32
+ * IBM AIX 5.2 64
+ * IBM AIX 5.3 ... 6.1 128
+ * IBM AIX 7.1 128 (can be configured to be up to 2048)
+ * OpenBSD, NetBSD 16
+ * FreeBSD < 8.0 16
+ * FreeBSD >=8.0 1023
+ * Darwin (Mac OS X) 16
+ * Sun Solaris 7,8,9,10 16
+ * Sun Solaris 11 / OpenSolaris 1024
+ * HP-UX 20
+ * Windows 1015
+ */
+#define RB_MAX_GROUPS (65536)
+static int maxgroups = RB_MAX_GROUPS;
#ifdef HAVE_GETGROUPS
@@ -4694,8 +4715,8 @@ proc_setmaxgroups(VALUE obj, VALUE val)
{
int ngroups = FIX2UINT(val);
- if (ngroups > 4096)
- ngroups = 4096;
+ if (ngroups > RB_MAX_GROUPS)
+ ngroups = RB_MAX_GROUPS;
maxgroups = ngroups;