security_dac: Don't return uninitialised uid and gid for image labels

As in the previous commit, images are also chowned to uninitialised
uid and gid if the label is not present.
This commit is contained in:
Peter Krempa 2012-08-29 01:15:04 +02:00
parent 3c2f5e3ede
commit f2f0af3960

View 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);