Skip to content

Commit

Permalink
lxcapi_clone: set the right environment variable for mounted fs
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
hallyn authored and stgraber committed Nov 21, 2013
1 parent bc6928f commit 24ef39f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lxc/lxccontainer.c
Expand Up @@ -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)) {
Expand Down

0 comments on commit 24ef39f

Please sign in to comment.