]> xenbits.xensource.com Git - libvirt.git/commitdiff
security_dac: Don't return uninitialised uid and gid for image labels
authorPeter Krempa <pkrempa@redhat.com>
Tue, 28 Aug 2012 23:15:04 +0000 (01:15 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 28 Aug 2012 23:31:30 +0000 (01:31 +0200)
As in the previous commit, images are also chowned to uninitialised
uid and gid if the label is not present.

src/security/security_dac.c

index 252775924264dd23c3cfd0f2f61d177f11079d12..5de73914911edea1066511f87eaa31a9c83c686c 100644 (file)
@@ -152,7 +152,7 @@ int virSecurityDACParseImageIds(virDomainDefPtr def,
         return -1;
 
     seclabel = virDomainDefGetSecurityLabelDef(def, SECURITY_DAC_NAME);
-    if (seclabel == NULL) {
+    if (seclabel == NULL || seclabel->imagelabel == NULL) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("security label for DAC not found in domain %s"),
                        def->name);