Merge pull request #2757 from brauner/2018-12-17/mount_injection_file

lxccontainer: fix mount api (mount_injection_file)
This commit is contained in:
Stéphane Graber 2018-12-17 10:14:31 -05:00 committed by GitHub
commit 46bccf604b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -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);

View File

@ -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")) {