]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
lxcapi_clone: set the right environment variable for mounted fs
authorSerge Hallyn <serge.hallyn@ubuntu.com>
Thu, 21 Nov 2013 15:05:59 +0000 (09:05 -0600)
committerStéphane Graber <stgraber@ubuntu.com>
Thu, 21 Nov 2013 15:25:43 +0000 (10:25 -0500)
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 <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
src/lxc/lxccontainer.c

index 11e70cb71c480ee6344259b7fb384239f472faf9..c1f99d506dbc27dabae30725290d96f924a0e162 100644 (file)
@@ -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)) {