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 /fs | |
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 'fs')
-rw-r--r-- | fs/namespace.c | 4 | ||||
-rw-r--r-- | fs/open.c | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/fs/namespace.c b/fs/namespace.c index 877e4277f496..dc519a1437ee 100644 --- a/fs/namespace.c +++ b/fs/namespace.c | |||
@@ -2929,8 +2929,8 @@ static int mntns_install(struct nsproxy *nsproxy, void *ns) | |||
2929 | struct path root; | 2929 | struct path root; |
2930 | 2930 | ||
2931 | if (!ns_capable(mnt_ns->user_ns, CAP_SYS_ADMIN) || | 2931 | if (!ns_capable(mnt_ns->user_ns, CAP_SYS_ADMIN) || |
2932 | !nsown_capable(CAP_SYS_CHROOT) || | 2932 | !ns_capable(current_user_ns(), CAP_SYS_CHROOT) || |
2933 | !nsown_capable(CAP_SYS_ADMIN)) | 2933 | !ns_capable(current_user_ns(), CAP_SYS_ADMIN)) |
2934 | return -EPERM; | 2934 | return -EPERM; |
2935 | 2935 | ||
2936 | if (fs->users != 1) | 2936 | if (fs->users != 1) |
@@ -443,7 +443,7 @@ retry: | |||
443 | goto dput_and_out; | 443 | goto dput_and_out; |
444 | 444 | ||
445 | error = -EPERM; | 445 | error = -EPERM; |
446 | if (!nsown_capable(CAP_SYS_CHROOT)) | 446 | if (!ns_capable(current_user_ns(), CAP_SYS_CHROOT)) |
447 | goto dput_and_out; | 447 | goto dput_and_out; |
448 | error = security_path_chroot(&path); | 448 | error = security_path_chroot(&path); |
449 | if (error) | 449 | if (error) |