summaryrefslogtreecommitdiff
path: root/usr/src/uts/common/os/ipc.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/os/ipc.c
parent30ac2e7bcba3a0a4c91d060d5ac3d60cd00f7a3a (diff)
downloadillumos-joyent-bda89588bd7667394a834e8a9a34612cce2ae9c3.tar.gz
6552639 Each zone should have it's own idmapd
Diffstat (limited to 'usr/src/uts/common/os/ipc.c')
-rw-r--r--usr/src/uts/common/os/ipc.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/usr/src/uts/common/os/ipc.c b/usr/src/uts/common/os/ipc.c
index 3e3a5b79cb..06324b140a 100644
--- a/usr/src/uts/common/os/ipc.c
+++ b/usr/src/uts/common/os/ipc.c
@@ -19,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -518,6 +518,7 @@ ipcperm_set(ipc_service_t *service, struct cred *cr,
uid_t uid;
gid_t gid;
mode_t mode;
+ zone_t *zone;
ASSERT(IPC_LOCKED(service, kperm));
@@ -529,7 +530,8 @@ ipcperm_set(ipc_service_t *service, struct cred *cr,
if (secpolicy_ipc_owner(cr, kperm) != 0)
return (EPERM);
- if (!VALID_UID(uid) || !VALID_GID(gid))
+ zone = crgetzone(cr);
+ if (!VALID_UID(uid, zone) || !VALID_GID(gid, zone))
return (EINVAL);
kperm->ipc_uid = uid;
@@ -561,12 +563,16 @@ int
ipcperm_set64(ipc_service_t *service, struct cred *cr,
kipc_perm_t *kperm, ipc_perm64_t *perm64)
{
+ zone_t *zone;
+
ASSERT(IPC_LOCKED(service, kperm));
if (secpolicy_ipc_owner(cr, kperm) != 0)
return (EPERM);
- if (!VALID_UID(perm64->ipcx_uid) || !VALID_GID(perm64->ipcx_gid))
+ zone = crgetzone(cr);
+ if (!VALID_UID(perm64->ipcx_uid, zone) ||
+ !VALID_GID(perm64->ipcx_gid, zone))
return (EINVAL);
kperm->ipc_uid = perm64->ipcx_uid;