mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-02 01:45:17 +00:00
security: Don't overwrite error of GetProcessLabel
Security impls of this function already raise errors, don't overwrite them.
This commit is contained in:
parent
7fb4c471d1
commit
efdfd1c5bf
@ -1348,11 +1348,9 @@ static int lxcDomainGetSecurityLabel(virDomainPtr dom, virSecurityLabelPtr secla
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (virSecurityManagerGetProcessLabel(driver->securityManager,
|
if (virSecurityManagerGetProcessLabel(driver->securityManager,
|
||||||
vm->def, priv->initpid, seclabel) < 0) {
|
vm->def, priv->initpid,
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
seclabel) < 0)
|
||||||
"%s", _("Failed to get security label"));
|
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
@ -6111,11 +6111,8 @@ static int qemuDomainGetSecurityLabel(virDomainPtr dom, virSecurityLabelPtr secl
|
|||||||
*/
|
*/
|
||||||
if (virDomainObjIsActive(vm)) {
|
if (virDomainObjIsActive(vm)) {
|
||||||
if (qemuSecurityGetProcessLabel(driver->securityManager,
|
if (qemuSecurityGetProcessLabel(driver->securityManager,
|
||||||
vm->def, vm->pid, seclabel) < 0) {
|
vm->def, vm->pid, seclabel) < 0)
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
|
||||||
"%s", _("Failed to get security label"));
|
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
@ -6173,8 +6170,6 @@ static int qemuDomainGetSecurityLabelList(virDomainPtr dom,
|
|||||||
for (i = 0; i < len; i++) {
|
for (i = 0; i < len; i++) {
|
||||||
if (qemuSecurityGetProcessLabel(mgrs[i], vm->def, vm->pid,
|
if (qemuSecurityGetProcessLabel(mgrs[i], vm->def, vm->pid,
|
||||||
&(*seclabels)[i]) < 0) {
|
&(*seclabels)[i]) < 0) {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
|
||||||
"%s", _("Failed to get security label"));
|
|
||||||
VIR_FREE(mgrs);
|
VIR_FREE(mgrs);
|
||||||
VIR_FREE(*seclabels);
|
VIR_FREE(*seclabels);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user