@@ -163,8 +163,12 @@ static void ipcns_put(void *ns)
static int ipcns_install(struct nsproxy *nsproxy, void *ns)
{
+#if 0
struct ipc_namespace *newns = ns;
if (!ns_capable(newns->user_ns, CAP_SYS_ADMIN))
+#else
+ if (!capable(CAP_SYS_ADMIN))
+#endif
return -1;
/* Ditch state from the old ipc namespace */
exit_sem(current);
@@ -1488,8 +1488,13 @@ long do_fork(unsigned long clone_flags,
/* hopefully this check will go away when userns support is
* complete
*/
+#if 0
if (!nsown_capable(CAP_SYS_ADMIN) || !nsown_capable(CAP_SETUID) ||
!nsown_capable(CAP_SETGID))
+#else
+ if (!capable(CAP_SYS_ADMIN) || !capable(CAP_SETUID) ||
+ !capable(CAP_SETGID))
+#endif
return -EPERM;
}
@@ -136,7 +136,11 @@ int copy_namespaces(unsigned long flags, struct task_struct *tsk)
CLONE_NEWPID | CLONE_NEWNET)))
return 0;
+#if 0
if (!nsown_capable(CAP_SYS_ADMIN)) {
+#else
+ if (!capable(CAP_SYS_ADMIN)) {
+#endif
err = -EPERM;
goto out;
}
@@ -193,7 +197,11 @@ int unshare_nsproxy_namespaces(unsigned long unshare_flags,
CLONE_NEWNET)))
return 0;
+#if 0
if (!nsown_capable(CAP_SYS_ADMIN))
+#else
+ if (!capable(CAP_SYS_ADMIN))
+#endif
return -EPERM;
*new_nsp = create_new_namespaces(unshare_flags, current,
@@ -104,8 +104,12 @@ static void utsns_put(void *ns)
static int utsns_install(struct nsproxy *nsproxy, void *ns)
{
+#if 0
struct uts_namespace *newns = ns;
if (!ns_capable(newns->user_ns, CAP_SYS_ADMIN))
+#else
+ if (!capable(CAP_SYS_ADMIN))
+#endif
return -1;
get_uts_ns(ns);
put_uts_ns(nsproxy->uts_ns);
@@ -623,8 +623,12 @@ static void netns_put(void *ns)
static int netns_install(struct nsproxy *nsproxy, void *ns)
{
+#if 0
struct net *net = ns;
if (!ns_capable(net->user_ns, CAP_SYS_ADMIN))
+#else
+ if (capable(CAP_SYS_ADMIN))
+#endif
return -1;
put_net(nsproxy->net_ns);
nsproxy->net_ns = get_net(ns);