[lxc-devel] [PATCH 1/1] Fix reversed args in mount call

Stéphane Graber stgraber at ubuntu.com
Mon Jan 12 21:22:02 UTC 2015


On Fri, Jan 09, 2015 at 10:00:28PM +0000, Serge Hallyn wrote:
> Riya Khanna reported that with a ramfs rootfs the mount to make
> / rprivate was returning -EFAULT.  NULL was being passed as the
> mount target.  Pass "/" instead.
> 
> Reported-by: riya khanna <riyakhanna1983 at gmail.com>>
> Signed-off-by: Serge Hallyn <serge.hallyn at ubuntu.com>

Acked-by: Stéphane Graber <stgraber at ubuntu.com>

> ---
>  src/lxc/conf.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/lxc/conf.c b/src/lxc/conf.c
> index 72181dd..9072002 100644
> --- a/src/lxc/conf.c
> +++ b/src/lxc/conf.c
> @@ -1513,7 +1513,7 @@ int prepare_ramfs_root(char *root)
>  		return -1;
>  	}
>  
> -	if (mount(".", NULL, NULL, MS_REC | MS_PRIVATE, NULL)) {
> +	if (mount(NULL, "/", NULL, MS_REC | MS_PRIVATE, NULL)) {
>  		SYSERROR("Failed to make . rprivate");
>  		return -1;
>  	}
> -- 
> 2.1.0
> 
> _______________________________________________
> lxc-devel mailing list
> lxc-devel at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-devel

-- 
Stéphane Graber
Ubuntu developer
http://www.ubuntu.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20150112/632e511c/attachment.sig>


More information about the lxc-devel mailing list