mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-24 22:55:23 +00:00
selinux: Don't mask errors of virSecuritySELinuxGenNewContext
Since cbe67ff9b0
virSecuritySELinuxGenNewContext reports good error messages. Fix callers
that mask the errors by generic error message.
This commit is contained in:
parent
20cb7f3a41
commit
4165ea9663
@ -685,13 +685,10 @@ virSecuritySELinuxGenSecurityLabel(virSecurityManagerPtr mgr,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
seclabel->label =
|
seclabel->label = virSecuritySELinuxGenNewContext(baselabel, mcs, false);
|
||||||
virSecuritySELinuxGenNewContext(baselabel, mcs, false);
|
if (!seclabel->label)
|
||||||
if (!seclabel->label) {
|
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
|
||||||
_("cannot generate selinux context for %s"), mcs);
|
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case VIR_DOMAIN_SECLABEL_NONE:
|
case VIR_DOMAIN_SECLABEL_NONE:
|
||||||
@ -709,12 +706,9 @@ virSecuritySELinuxGenSecurityLabel(virSecurityManagerPtr mgr,
|
|||||||
seclabel->imagelabel = virSecuritySELinuxGenNewContext(data->file_context,
|
seclabel->imagelabel = virSecuritySELinuxGenNewContext(data->file_context,
|
||||||
mcs,
|
mcs,
|
||||||
true);
|
true);
|
||||||
if (!seclabel->imagelabel) {
|
if (!seclabel->imagelabel)
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
|
||||||
_("cannot generate selinux context for %s"), mcs);
|
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (!seclabel->model &&
|
if (!seclabel->model &&
|
||||||
!(seclabel->model = strdup(SECURITY_SELINUX_NAME))) {
|
!(seclabel->model = strdup(SECURITY_SELINUX_NAME))) {
|
||||||
|
Loading…
Reference in New Issue
Block a user