mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 21:55:25 +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;
|
||||
}
|
||||
|
||||
if (vm && (vmlabel = virDomainDefGetSecurityLabelDef(vm->def, "dac")))
|
||||
if (vm && (vmlabel = virDomainDefGetSecurityLabelDef(vm->def, "dac")) &&
|
||||
vmlabel->label)
|
||||
virParseOwnershipIds(vmlabel->label, uid, gid);
|
||||
|
||||
if ((disklabel = virDomainDiskDefGetSecurityLabelDef(disk, "dac")) &&
|
||||
|
@ -2771,6 +2771,7 @@ qemuOpenFile(virQEMUDriverPtr driver,
|
||||
/* TODO: Take imagelabel into account? */
|
||||
if (vm &&
|
||||
(seclabel = virDomainDefGetSecurityLabelDef(vm->def, "dac")) != NULL &&
|
||||
seclabel->label != NULL &&
|
||||
(virParseOwnershipIds(seclabel->label, &user, &group) < 0))
|
||||
goto cleanup;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user