mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-23 07:01:23 +00:00
userns: fix return value on mntns_install() failure
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>
This commit is contained in:
parent
0c55cfc416
commit
ae11e0f184
1 changed files with 1 additions and 1 deletions
|
@ -2775,7 +2775,7 @@ static int mntns_install(struct nsproxy *nsproxy, void *ns)
|
||||||
|
|
||||||
if (!ns_capable(mnt_ns->user_ns, CAP_SYS_ADMIN) ||
|
if (!ns_capable(mnt_ns->user_ns, CAP_SYS_ADMIN) ||
|
||||||
!nsown_capable(CAP_SYS_CHROOT))
|
!nsown_capable(CAP_SYS_CHROOT))
|
||||||
return -EINVAL;
|
return -EPERM;
|
||||||
|
|
||||||
if (fs->users != 1)
|
if (fs->users != 1)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue