summaryrefslogtreecommitdiffstats
path: root/kernel/groups.c
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2013-03-20 20:49:49 +0100
committerEric W. Biederman <ebiederm@xmission.com>2013-08-31 08:44:11 +0200
commitc7b96acf1456ef127fef461fcfedb54b81fecfbb (patch)
tree1cc9387d23e96685453e545bda6d5a5efea8fa63 /kernel/groups.c
parentcapabilities: allow nice if we are privileged (diff)
downloadlinux-c7b96acf1456ef127fef461fcfedb54b81fecfbb.tar.xz
linux-c7b96acf1456ef127fef461fcfedb54b81fecfbb.zip
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 'kernel/groups.c')
-rw-r--r--kernel/groups.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/groups.c b/kernel/groups.c
index 6b2588dd04ff..90cf1c38c8ea 100644
--- a/kernel/groups.c
+++ b/kernel/groups.c
@@ -233,7 +233,7 @@ SYSCALL_DEFINE2(setgroups, int, gidsetsize, gid_t __user *, grouplist)
struct group_info *group_info;
int retval;
- if (!nsown_capable(CAP_SETGID))
+ if (!ns_capable(current_user_ns(), CAP_SETGID))
return -EPERM;
if ((unsigned)gidsetsize > NGROUPS_MAX)
return -EINVAL;