mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
qemu: Return -EINVAL to keep qemuDomainOpenFile() consistent
The description of the function says that the return value is a file descriptor on success and negative errno on failure which is not true. If the 'if' case with check on security labels fails, the return value is -1 not -errno. The solution is to return '-EINVAL' instead. Signed-off-by: Kristina Hanicova <khanicov@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
bcdaa91a27
commit
b6b6725c95
@ -11509,7 +11509,7 @@ qemuDomainOpenFile(virQEMUDriver *driver,
|
|||||||
(seclabel = virDomainDefGetSecurityLabelDef(vm->def, "dac")) != NULL &&
|
(seclabel = virDomainDefGetSecurityLabelDef(vm->def, "dac")) != NULL &&
|
||||||
seclabel->label != NULL &&
|
seclabel->label != NULL &&
|
||||||
(virParseOwnershipIds(seclabel->label, &user, &group) < 0))
|
(virParseOwnershipIds(seclabel->label, &user, &group) < 0))
|
||||||
return -1;
|
return -EINVAL;
|
||||||
|
|
||||||
return virQEMUFileOpenAs(user, group, dynamicOwnership,
|
return virQEMUFileOpenAs(user, group, dynamicOwnership,
|
||||||
path, oflags, needUnlink);
|
path, oflags, needUnlink);
|
||||||
|
Loading…
Reference in New Issue
Block a user