提交 4165ea96 编写于 作者: P Peter Krempa

selinux: Don't mask errors of virSecuritySELinuxGenNewContext

Since cbe67ff9
virSecuritySELinuxGenNewContext reports good error messages. Fix callers
that mask the errors by generic error message.
上级 20cb7f3a
...@@ -685,13 +685,10 @@ virSecuritySELinuxGenSecurityLabel(virSecurityManagerPtr mgr, ...@@ -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,11 +706,8 @@ virSecuritySELinuxGenSecurityLabel(virSecurityManagerPtr mgr, ...@@ -709,11 +706,8 @@ 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 &&
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册