From: Serge Hallyn <serge.hallyn-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
To: Zhao Hongjiang <zhaohongjiang37-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org,
ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org
Subject: Re: [PATCH] userns: fix return value on mntns_install() failure
Date: Fri, 14 Sep 2012 08:15:04 -0500 [thread overview]
Message-ID: <20120914131504.GA29678@amd1> (raw)
In-Reply-To: <50519B6B.1050902-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Quoting Zhao Hongjiang (zhaohongjiang37-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org):
> From: Zhao Hongjiang <zhaohongjiang-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
>
> Change return value from -EINVAL to -EPERM when the permission check fails.
>
> Signed-off-by: Zhao Hongjiang <zhaohongjiang-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
That also matches what other *_install do.
Acked-by: Serge E. Hallyn <serge.hallyn-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
> ---
> fs/namespace.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/fs/namespace.c b/fs/namespace.c
> index 72be266..1e79d20 100644
> --- a/fs/namespace.c
> +++ b/fs/namespace.c
> @@ -2764,7 +2764,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;
> -- 1.7.1
> _______________________________________________
> Containers mailing list
> Containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org
> https://lists.linuxfoundation.org/mailman/listinfo/containers
next prev parent reply other threads:[~2012-09-14 13:15 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-13 8:38 [PATCH] userns: fix return value on mntns_install() failure Zhao Hongjiang
[not found] ` <50519B6B.1050902-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-09-14 13:15 ` Serge Hallyn [this message]
2012-09-16 7:17 ` Eric W. Biederman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120914131504.GA29678@amd1 \
--to=serge.hallyn-z7wlfzj8ewms+fvcfc7uqw@public.gmane.org \
--cc=containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
--cc=ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org \
--cc=zhaohongjiang37-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox