mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-08-13 10:45:45 +00:00
Merge pull request #2757 from brauner/2018-12-17/mount_injection_file
lxccontainer: fix mount api (mount_injection_file)
This commit is contained in:
commit
46bccf604b
@ -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")) {
|
||||
|
Loading…
Reference in New Issue
Block a user