summaryrefslogtreecommitdiff
path: root/usr/src/uts/common/syscall/groups.c
diff options
context:
space:
mode:
authorjp151216 <none@none>2008-01-04 13:09:02 -0800
committerjp151216 <none@none>2008-01-04 13:09:02 -0800
commitbda89588bd7667394a834e8a9a34612cce2ae9c3 (patch)
tree1226b1cea0d00fb32b21d27ea65b184516cd8c84 /usr/src/uts/common/syscall/groups.c
parent30ac2e7bcba3a0a4c91d060d5ac3d60cd00f7a3a (diff)
downloadillumos-joyent-bda89588bd7667394a834e8a9a34612cce2ae9c3.tar.gz
6552639 Each zone should have it's own idmapd
Diffstat (limited to 'usr/src/uts/common/syscall/groups.c')
-rw-r--r--usr/src/uts/common/syscall/groups.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/usr/src/uts/common/syscall/groups.c b/usr/src/uts/common/syscall/groups.c
index b9a6c23441..8273171d0c 100644
--- a/usr/src/uts/common/syscall/groups.c
+++ b/usr/src/uts/common/syscall/groups.c
@@ -20,7 +20,7 @@
*/
/*
* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T
- * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -49,11 +49,13 @@ setgroups(int gidsetsize, gid_t *gidset)
int error;
int scnt = 0;
ksidlist_t *ksl = NULL;
+ zone_t *zone;
/* Perform the cheapest tests before grabbing p_crlock */
if (n > ngroups_max || n < 0)
return (set_errno(EINVAL));
+ zone = crgetzone(CRED());
if (n != 0) {
groups = kmem_alloc(n * sizeof (gid_t), KM_SLEEP);
@@ -63,7 +65,7 @@ setgroups(int gidsetsize, gid_t *gidset)
}
for (i = 0; i < n; i++) {
- if (!VALID_GID(groups[i])) {
+ if (!VALID_GID(groups[i], zone)) {
kmem_free(groups, n * sizeof (gid_t));
return (set_errno(EINVAL));
}
@@ -71,7 +73,7 @@ setgroups(int gidsetsize, gid_t *gidset)
scnt++;
}
if (scnt > 0) {
- ksl = kcrsid_gidstosids(n, groups);
+ ksl = kcrsid_gidstosids(zone, n, groups);
if (ksl == NULL) {
kmem_free(groups, n * sizeof (gid_t));
return (set_errno(EINVAL));