mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-07-27 09:35:31 +00:00
Also drop caps in unpriv containers
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com> Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
This commit is contained in:
parent
98b745498b
commit
97a8f74f0c
@ -4158,20 +4158,18 @@ int lxc_setup(struct lxc_handler *handler)
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (lxc_list_empty(&lxc_conf->id_map)) {
|
||||
if (!lxc_list_empty(&lxc_conf->keepcaps)) {
|
||||
if (!lxc_list_empty(&lxc_conf->caps)) {
|
||||
ERROR("Simultaneously requested dropping and keeping caps");
|
||||
return -1;
|
||||
}
|
||||
if (dropcaps_except(&lxc_conf->keepcaps)) {
|
||||
ERROR("failed to keep requested caps");
|
||||
return -1;
|
||||
}
|
||||
} else if (setup_caps(&lxc_conf->caps)) {
|
||||
ERROR("failed to drop capabilities");
|
||||
if (!lxc_list_empty(&lxc_conf->keepcaps)) {
|
||||
if (!lxc_list_empty(&lxc_conf->caps)) {
|
||||
ERROR("Simultaneously requested dropping and keeping caps");
|
||||
return -1;
|
||||
}
|
||||
if (dropcaps_except(&lxc_conf->keepcaps)) {
|
||||
ERROR("failed to keep requested caps");
|
||||
return -1;
|
||||
}
|
||||
} else if (setup_caps(&lxc_conf->caps)) {
|
||||
ERROR("failed to drop capabilities");
|
||||
return -1;
|
||||
}
|
||||
|
||||
NOTICE("'%s' is setup.", name);
|
||||
|
Loading…
Reference in New Issue
Block a user