All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] userns: fix return value on mntns_install() failure
@ 2012-09-13  8:38 Zhao Hongjiang
       [not found] ` <50519B6B.1050902-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Zhao Hongjiang @ 2012-09-13  8:38 UTC (permalink / raw)
  To: ebiederm-aS9lmoZGLiVWk0Htik3J/w
  Cc: containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA

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>
---
 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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] userns: fix return value on mntns_install() failure
       [not found] ` <50519B6B.1050902-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2012-09-14 13:15   ` Serge Hallyn
  2012-09-16  7:17   ` Eric W. Biederman
  1 sibling, 0 replies; 3+ messages in thread
From: Serge Hallyn @ 2012-09-14 13:15 UTC (permalink / raw)
  To: Zhao Hongjiang
  Cc: containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	ebiederm-aS9lmoZGLiVWk0Htik3J/w

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] userns: fix return value on mntns_install() failure
       [not found] ` <50519B6B.1050902-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  2012-09-14 13:15   ` Serge Hallyn
@ 2012-09-16  7:17   ` Eric W. Biederman
  1 sibling, 0 replies; 3+ messages in thread
From: Eric W. Biederman @ 2012-09-16  7:17 UTC (permalink / raw)
  To: Zhao Hongjiang; +Cc: containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA

Zhao Hongjiang <zhaohongjiang37-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:

> From: Zhao Hongjiang <zhaohongjiang-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
>
> Change return value from -EINVAL to -EPERM when the permission check
> fails.

Thanks applied.

Eric

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-09-16  7:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2012-09-16  7:17   ` Eric W. Biederman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.