提交 c90a1ad7 编写于 作者: J Jiri Denemark

Report all errors in SELinuxRestoreSecurityFileLabel

上级 5054e892
......@@ -364,12 +364,20 @@ SELinuxRestoreSecurityFileLabel(const char *path)
goto err;
}
if (stat(newpath, &buf) != 0)
if (stat(newpath, &buf) != 0) {
virReportSystemError(errno,
_("cannot stat %s"), newpath);
goto err;
}
if (matchpathcon(newpath, buf.st_mode, &fcon) == 0) {
rc = SELinuxSetFilecon(newpath, fcon);
} else {
virSecurityReportError(VIR_ERR_INTERNAL_ERROR,
_("cannot restore selinux file label for %s"),
newpath);
}
err:
VIR_FREE(fcon);
VIR_FREE(newpath);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册