From: Stéphane Graber Date: Thu, 25 Dec 2014 23:17:25 +0000 (+0100) Subject: Also drop caps in unpriv containers X-Git-Tag: lxc-1.1.0.rc1~43 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=97a8f74f0c80ef71305e86fcef4273afd92b377c;p=thirdparty%2Flxc.git Also drop caps in unpriv containers Signed-off-by: Stéphane Graber Acked-by: Serge E. Hallyn --- diff --git a/src/lxc/conf.c b/src/lxc/conf.c index 472eb79c7..72181dd52 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -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);