summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIra Cooper <ira@samba.org>2013-06-13 14:06:13 -0400
committerRichard Lowe <richlowe@richlowe.net>2013-06-17 13:39:15 -0400
commitb77dfcc8362f3695ece944d5bb504276753a40f9 (patch)
tree2941ef558337dcd855be8e51a892f69f03fd386c
parentbe468fc6d7266e97f1330ad9a761169925f5f3f1 (diff)
downloadillumos-joyent-b77dfcc8362f3695ece944d5bb504276753a40f9.tar.gz
3691 setgroups() needs a sorted GID list for more than 16 groups
Reviewed by: Marcel Telka <marcel@telka.sk> Reviewed by: Richard Lowe <richlowe@richlowe.net> Approved by: Richard Lowe <richlowe@richlowe.net>
-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 1ec63249ab..7add6a4b8e 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.
*/
@@ -1440,6 +1443,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);
}