lxc_unshare: make mount table private

parent b235962c
...@@ -246,8 +246,13 @@ static int do_start(void *arg) ...@@ -246,8 +246,13 @@ static int do_start(void *arg)
} }
} }
if ((start_arg->flags & CLONE_NEWNS) && start_arg->want_default_mounts) if (start_arg->flags & CLONE_NEWNS) {
lxc_setup_fs(); if (mount(NULL, "/", NULL, MS_REC | MS_PRIVATE, 0) < 0)
_exit(EXIT_FAILURE);
if (start_arg->want_default_mounts)
lxc_setup_fs();
}
if ((start_arg->flags & CLONE_NEWUTS) && want_hostname) if ((start_arg->flags & CLONE_NEWUTS) && want_hostname)
if (sethostname(want_hostname, strlen(want_hostname)) < 0) { if (sethostname(want_hostname, strlen(want_hostname)) < 0) {
......
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