diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2013-03-20 15:49:49 -0400 |
---|---|---|
committer | Eric W. Biederman <ebiederm@xmission.com> | 2013-08-31 02:44:11 -0400 |
commit | c7b96acf1456ef127fef461fcfedb54b81fecfbb (patch) | |
tree | 1cc9387d23e96685453e545bda6d5a5efea8fa63 /net/core/net_namespace.c | |
parent | f54fb863c6bbcbafdfc332b4a4260abb5a002137 (diff) |
userns: Kill nsown_capable it makes the wrong thing easy
nsown_capable is a special case of ns_capable essentially for just CAP_SETUID and
CAP_SETGID. For the existing users it doesn't noticably simplify things and
from the suggested patches I have seen it encourages people to do the wrong
thing. So remove nsown_capable.
Acked-by: Serge Hallyn <serge.hallyn@canonical.com>
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Diffstat (limited to 'net/core/net_namespace.c')
-rw-r--r-- | net/core/net_namespace.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c index f97652036754..81d3a9a08453 100644 --- a/net/core/net_namespace.c +++ b/net/core/net_namespace.c | |||
@@ -651,7 +651,7 @@ static int netns_install(struct nsproxy *nsproxy, void *ns) | |||
651 | struct net *net = ns; | 651 | struct net *net = ns; |
652 | 652 | ||
653 | if (!ns_capable(net->user_ns, CAP_SYS_ADMIN) || | 653 | if (!ns_capable(net->user_ns, CAP_SYS_ADMIN) || |
654 | !nsown_capable(CAP_SYS_ADMIN)) | 654 | !ns_capable(current_user_ns(), CAP_SYS_ADMIN)) |
655 | return -EPERM; | 655 | return -EPERM; |
656 | 656 | ||
657 | put_net(nsproxy->net_ns); | 657 | put_net(nsproxy->net_ns); |