Commit 9ac3ffb5 by Stéphane Graber

Make lxc-execute without rootfs work.

That means, don't try to pin a null rootfs, and don't try to mount /proc since /var/lib/lxc/root/proc doesn't exist to be mounted onto. The apparmor patches are not yet upstream, so this patch will not go upstream by itself. Signed-off-by: 's avatarSerge Hallyn <serge.hallyn@ubuntu.com> Acked-by: 's avatarStéphane Graber <stgraber@ubuntu.com>
parent 10f73bfa
......@@ -2169,7 +2169,12 @@ int lxc_setup(const char *name, struct lxc_conf *lxc_conf)
}
#if HAVE_APPARMOR /* || HAVE_SMACK || HAVE_SELINUX */
mounted = lsm_mount_proc_if_needed(lxc_conf->rootfs.path, lxc_conf->rootfs.mount);
INFO("rootfs path is .%s., mount is .%s.", lxc_conf->rootfs.path,
lxc_conf->rootfs.mount);
if (lxc_conf->rootfs.path == NULL || strlen(lxc_conf->rootfs.path) == 0)
mounted = 0;
else
mounted = lsm_mount_proc_if_needed(lxc_conf->rootfs.path, lxc_conf->rootfs.mount);
if (mounted == -1) {
SYSERROR("failed to mount /proc in the container.");
return -1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment