diff options
author | Zhao Hongjiang <zhaohongjiang@huawei.com> | 2012-09-13 04:38:03 -0400 |
---|---|---|
committer | Eric W. Biederman <ebiederm@xmission.com> | 2012-11-19 08:59:22 -0500 |
commit | ae11e0f18482bfe0cd83b9b61434ea7e0bd94e25 (patch) | |
tree | 13356ea5b2a0316b1daf2661adeec05b0d5f78b2 | |
parent | 0c55cfc4166d9a0f38de779bd4d75a90afbe7734 (diff) |
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>
-rw-r--r-- | fs/namespace.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/namespace.c b/fs/namespace.c index 9ddc86f93221..cab78a74aca3 100644 --- a/fs/namespace.c +++ b/fs/namespace.c | |||
@@ -2775,7 +2775,7 @@ static int mntns_install(struct nsproxy *nsproxy, void *ns) | |||
2775 | 2775 | ||
2776 | if (!ns_capable(mnt_ns->user_ns, CAP_SYS_ADMIN) || | 2776 | if (!ns_capable(mnt_ns->user_ns, CAP_SYS_ADMIN) || |
2777 | !nsown_capable(CAP_SYS_CHROOT)) | 2777 | !nsown_capable(CAP_SYS_CHROOT)) |
2778 | return -EINVAL; | 2778 | return -EPERM; |
2779 | 2779 | ||
2780 | if (fs->users != 1) | 2780 | if (fs->users != 1) |
2781 | return -EINVAL; | 2781 | return -EINVAL; |