From ae11e0f18482bfe0cd83b9b61434ea7e0bd94e25 Mon Sep 17 00:00:00 2001 From: Zhao Hongjiang Date: Thu, 13 Sep 2012 16:38:03 +0800 Subject: 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 Signed-off-by: Eric W. Biederman --- fs/namespace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'fs/namespace.c') diff --git a/fs/namespace.c b/fs/namespace.c index 9ddc86f9322..cab78a74aca 100644 --- a/fs/namespace.c +++ b/fs/namespace.c @@ -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; -- cgit v1.2.3