From: Serge Hallyn Date: Thu, 21 Nov 2013 15:05:59 +0000 (-0600) Subject: lxcapi_clone: set the right environment variable for mounted fs X-Git-Tag: lxc-1.0.0.beta1~116 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=24ef39f4d54e83996129463f7138ba90b26a166a;p=thirdparty%2Flxc.git lxcapi_clone: set the right environment variable for mounted fs If the container is dir-backed, we don't actually mount it (to support unprivileged use). So always set the LXC_ROOTFS_MOUNT to bdev->dest, not to the rootfs path specified in the container configuration. This should fix bug http://pad.lv/1253573 Signed-off-by: Serge Hallyn Acked-by: Stéphane Graber --- diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c index 11e70cb71..c1f99d506 100644 --- a/src/lxc/lxccontainer.c +++ b/src/lxc/lxccontainer.c @@ -2399,7 +2399,7 @@ static int clone_update_rootfs(struct lxc_container *c0, if (setenv("LXC_CONFIG_FILE", conf->rcfile, 1)) { SYSERROR("failed to set environment variable for config path"); } - if (setenv("LXC_ROOTFS_MOUNT", conf->rootfs.mount, 1)) { + if (setenv("LXC_ROOTFS_MOUNT", bdev->dest, 1)) { SYSERROR("failed to set environment variable for rootfs mount"); } if (setenv("LXC_ROOTFS_PATH", conf->rootfs.path, 1)) {