Skip to content

Commit

Permalink
userns: fix return value on mntns_install() failure
Browse files Browse the repository at this point in the history
Change return value from -EINVAL to -EPERM when the permission check fails.

Signed-off-by: Zhao Hongjiang <zhaohongjiang@huawei.com>
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
  • Loading branch information
Zhao Hongjiang authored and Eric W. Biederman committed Nov 19, 2012
1 parent 0c55cfc commit ae11e0f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/namespace.c
Original file line number Diff line number Diff line change
Expand Up @@ -2775,7 +2775,7 @@ static int mntns_install(struct nsproxy *nsproxy, void *ns)

if (!ns_capable(mnt_ns->user_ns, CAP_SYS_ADMIN) ||
!nsown_capable(CAP_SYS_CHROOT))
return -EINVAL;
return -EPERM;

if (fs->users != 1)
return -EINVAL;
Expand Down

0 comments on commit ae11e0f

Please sign in to comment.