namespace.c (27eb2c4b3d3e13f376a359e293c212a2e9407af5) namespace.c (c7b96acf1456ef127fef461fcfedb54b81fecfbb)
1/*
2 * linux/ipc/namespace.c
3 * Copyright (C) 2006 Pavel Emelyanov <xemul@openvz.org> OpenVZ, SWsoft Inc.
4 */
5
6#include <linux/ipc.h>
7#include <linux/msg.h>
8#include <linux/ipc_namespace.h>

--- 157 unchanged lines hidden (view full) ---

166{
167 return put_ipc_ns(ns);
168}
169
170static int ipcns_install(struct nsproxy *nsproxy, void *new)
171{
172 struct ipc_namespace *ns = new;
173 if (!ns_capable(ns->user_ns, CAP_SYS_ADMIN) ||
1/*
2 * linux/ipc/namespace.c
3 * Copyright (C) 2006 Pavel Emelyanov <xemul@openvz.org> OpenVZ, SWsoft Inc.
4 */
5
6#include <linux/ipc.h>
7#include <linux/msg.h>
8#include <linux/ipc_namespace.h>

--- 157 unchanged lines hidden (view full) ---

166{
167 return put_ipc_ns(ns);
168}
169
170static int ipcns_install(struct nsproxy *nsproxy, void *new)
171{
172 struct ipc_namespace *ns = new;
173 if (!ns_capable(ns->user_ns, CAP_SYS_ADMIN) ||
174 !nsown_capable(CAP_SYS_ADMIN))
174 !ns_capable(current_user_ns(), CAP_SYS_ADMIN))
175 return -EPERM;
176
177 /* Ditch state from the old ipc namespace */
178 exit_sem(current);
179 put_ipc_ns(nsproxy->ipc_ns);
180 nsproxy->ipc_ns = get_ipc_ns(ns);
181 return 0;
182}

--- 16 unchanged lines hidden ---
175 return -EPERM;
176
177 /* Ditch state from the old ipc namespace */
178 exit_sem(current);
179 put_ipc_ns(nsproxy->ipc_ns);
180 nsproxy->ipc_ns = get_ipc_ns(ns);
181 return 0;
182}

--- 16 unchanged lines hidden ---