summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith M Wesolowski <wesolows@foobazco.org>2013-06-17 22:29:45 +0000
committerKeith M Wesolowski <wesolows@foobazco.org>2013-06-17 22:29:50 +0000
commit40879def20f8e7475179f79bcd9db2e6a5cea0f6 (patch)
tree586dd2dc52e4c514bcc9d261d996929f362cd016
parent3fa1066166e069056b54f4e0949723e214d3dc3e (diff)
parentb77dfcc8362f3695ece944d5bb504276753a40f9 (diff)
downloadillumos-joyent-40879def20f8e7475179f79bcd9db2e6a5cea0f6.tar.gz
[illumos-gate merge]
commit b77dfcc8362f3695ece944d5bb504276753a40f9 3691 setgroups() needs a sorted GID list for more than 16 groups
-rw-r--r--usr/src/uts/common/os/cred.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/usr/src/uts/common/os/cred.c b/usr/src/uts/common/os/cred.c
index 20e57efaad..866c19678f 100644
--- a/usr/src/uts/common/os/cred.c
+++ b/usr/src/uts/common/os/cred.c
@@ -19,6 +19,9 @@
* CDDL HEADER END
*/
/*
+ * Copyright (c) 2013, Ira Cooper. All rights reserved.
+ */
+/*
* Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
*/
@@ -1448,6 +1451,7 @@ crgrpcopyin(int n, gid_t *gidset)
}
mem->crg_ref = 1;
mem->crg_ngroups = n;
+ qsort(mem->crg_groups, n, sizeof (gid_t), gidcmp);
return (mem);
}