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

Serge Hallyn serge.hallyn at ubuntu.com
Fri Jan 9 22:00:28 UTC 2015


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



More information about the lxc-devel mailing list