]> git.proxmox.com Git - mirror_lxc.git/commitdiff
Also drop caps in unpriv containers
authorStéphane Graber <stgraber@ubuntu.com>
Thu, 25 Dec 2014 23:17:25 +0000 (00:17 +0100)
committerStéphane Graber <stgraber@ubuntu.com>
Mon, 5 Jan 2015 21:28:36 +0000 (16:28 -0500)
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
src/lxc/conf.c

index 472eb79c7fc4864350f153688949ade365420a1a..72181dd520ce4b0a98823ba121f4679a10c0bff5 100644 (file)
@@ -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);