mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
Fix crash when saving a domain with type none dac label
qemuDomainGetImageIds did not check if there was a label in the seclabel, thus crashing on <seclabel type='none' model='dac'/> https://bugzilla.redhat.com/show_bug.cgi?id=1108590
This commit is contained in:
parent
fdfdbc0d12
commit
7eb0ee175b
@ -2409,7 +2409,8 @@ qemuDomainGetImageIds(virQEMUDriverConfigPtr cfg,
|
|||||||
*gid = cfg->group;
|
*gid = cfg->group;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (vm && (vmlabel = virDomainDefGetSecurityLabelDef(vm->def, "dac")))
|
if (vm && (vmlabel = virDomainDefGetSecurityLabelDef(vm->def, "dac")) &&
|
||||||
|
vmlabel->label)
|
||||||
virParseOwnershipIds(vmlabel->label, uid, gid);
|
virParseOwnershipIds(vmlabel->label, uid, gid);
|
||||||
|
|
||||||
if ((disklabel = virDomainDiskDefGetSecurityLabelDef(disk, "dac")) &&
|
if ((disklabel = virDomainDiskDefGetSecurityLabelDef(disk, "dac")) &&
|
||||||
|
@ -2771,6 +2771,7 @@ qemuOpenFile(virQEMUDriverPtr driver,
|
|||||||
/* TODO: Take imagelabel into account? */
|
/* TODO: Take imagelabel into account? */
|
||||||
if (vm &&
|
if (vm &&
|
||||||
(seclabel = virDomainDefGetSecurityLabelDef(vm->def, "dac")) != NULL &&
|
(seclabel = virDomainDefGetSecurityLabelDef(vm->def, "dac")) != NULL &&
|
||||||
|
seclabel->label != NULL &&
|
||||||
(virParseOwnershipIds(seclabel->label, &user, &group) < 0))
|
(virParseOwnershipIds(seclabel->label, &user, &group) < 0))
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user