nsproxy: add struct nsset
[sfrench/cifs-2.6.git] / ipc / namespace.c
index b3ca1476ca5118793c096a0244b062fbff7255b0..fdc3b5f3f53aa75796192460866c001f1571a2cc 100644 (file)
@@ -177,15 +177,14 @@ static void ipcns_put(struct ns_common *ns)
        return put_ipc_ns(to_ipc_ns(ns));
 }
 
-static int ipcns_install(struct nsproxy *nsproxy, struct ns_common *new)
+static int ipcns_install(struct nsset *nsset, struct ns_common *new)
 {
+       struct nsproxy *nsproxy = nsset->nsproxy;
        struct ipc_namespace *ns = to_ipc_ns(new);
        if (!ns_capable(ns->user_ns, CAP_SYS_ADMIN) ||
-           !ns_capable(current_user_ns(), CAP_SYS_ADMIN))
+           !ns_capable(nsset->cred->user_ns, CAP_SYS_ADMIN))
                return -EPERM;
 
-       /* Ditch state from the old ipc namespace */
-       exit_sem(current);
        put_ipc_ns(nsproxy->ipc_ns);
        nsproxy->ipc_ns = get_ipc_ns(ns);
        return 0;