From: Shivaprasad G Bhat Date: Thu, 4 Sep 2014 09:12:32 +0000 (+0530) Subject: selinux: Avoid label reservations for type = none X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=a48362cdfeb5c948218a2e4bf7cc9354082fc1b6;p=libvirt.git selinux: Avoid label reservations for type = none 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 --- diff --git a/src/security/security_selinux.c b/src/security/security_selinux.c index e8c13dbba2..c21e4fe659 100644 --- a/src/security/security_selinux.c +++ b/src/security/security_selinux.c @@ -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) {