lxccontainer: fix mount api (mount_injection_file)

parent 8465a7f4
......@@ -40,6 +40,7 @@ static char *api_extensions[] = {
"reboot2",
"mount_injection",
"cgroup_relative",
"mount_injection_file",
};
static size_t nr_api_extensions = sizeof(api_extensions) / sizeof(*api_extensions);
......
......@@ -5045,10 +5045,13 @@ static int do_lxcapi_mount(struct lxc_container *c, const char *source,
/* Enter the container namespaces */
if (!lxc_list_empty(&c->lxc_conf->id_map)) {
if (!switch_to_ns(init_pid, "user")){
if (!switch_to_ns(init_pid, "user")) {
ERROR("Failed to enter user namespace");
_exit(EXIT_FAILURE);
}
if (!lxc_switch_uid_gid(0, 0))
_exit(EXIT_FAILURE);
}
if (!switch_to_ns(init_pid, "mnt")) {
......
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