]> xenbits.xensource.com Git - libvirt.git/commitdiff
selinux: Avoid label reservations for type = none
authorShivaprasad G Bhat <shivaprasadbhat@gmail.com>
Thu, 4 Sep 2014 09:12:32 +0000 (14:42 +0530)
committerMartin Kletzander <mkletzan@redhat.com>
Sun, 7 Sep 2014 15:09:34 +0000 (17:09 +0200)
For security type='none' libvirt according to the docs should not
generate seclabel be it for selinux or any model. So, skip the
reservation of labels when type is none.

Signed-off-by: Shivaprasad G Bhat <sbhat@linux.vnet.ibm.com>
src/security/security_selinux.c

index e8c13dbba294ef54c674be41731c6b49373dc39e..c21e4fe65961e11da67a7bc3ce541366bff7da6b 100644 (file)
@@ -731,7 +731,9 @@ virSecuritySELinuxReserveSecurityLabel(virSecurityManagerPtr mgr,
     virSecurityLabelDefPtr seclabel;
 
     seclabel = virDomainDefGetSecurityLabelDef(def, SECURITY_SELINUX_NAME);
-    if (!seclabel || seclabel->type == VIR_DOMAIN_SECLABEL_STATIC)
+    if (!seclabel ||
+        seclabel->type == VIR_DOMAIN_SECLABEL_NONE ||
+        seclabel->type == VIR_DOMAIN_SECLABEL_STATIC)
         return 0;
 
     if (getpidcon_raw(pid, &pctx) == -1) {