1 Star 0 Fork 79

vicxhh/rpm

forked from src-openEuler/rpm 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
Silence-spurious-error-message-from-lsetfilecon-on-E.patch 1.25 KB
一键复制 编辑 原始数据 按行查看 历史
From 4a71a3eccd7e9e14ee0e83b1cb300386a93622cd Mon Sep 17 00:00:00 2001
From: Panu Matilainen <pmatilai@redhat.com>
Date: Fri, 13 Dec 2019 14:14:10 +0200
Subject: [PATCH] Silence spurious error message from lsetfilecon() on
-EOPNOTSUPP
We already filter out -EOPNOTSUPP and return OK, but the message was
getting logged before the filtering so we'd spit out spurious error
messages on filesystems that don't support SELinux (RhBug:1777502)
---
plugins/selinux.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/plugins/selinux.c b/plugins/selinux.c
index a51f95e..ba37ffa 100644
--- a/plugins/selinux.c
+++ b/plugins/selinux.c
@@ -168,11 +168,12 @@ static rpmRC selinux_fsm_file_prepare(rpmPlugin plugin, rpmfi fi,
if (selabel_lookup_raw(sehandle, &scon, dest, file_mode) == 0) {
int conrc = lsetfilecon(path, scon);
- rpmlog(loglvl(conrc < 0), "lsetfilecon: (%s, %s) %s\n",
- path, scon, (conrc < 0 ? strerror(errno) : ""));
-
if (conrc == 0 || (conrc < 0 && errno == EOPNOTSUPP))
rc = RPMRC_OK;
+
+ rpmlog(loglvl(rc != RPMRC_OK), "lsetfilecon: (%s, %s) %s\n",
+ path, scon, (conrc < 0 ? strerror(errno) : ""));
+
freecon(scon);
} else {
/* No context for dest is not our headache */
--
1.8.3.1
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/vicxhh/rpm.git
git@gitee.com:vicxhh/rpm.git
vicxhh
rpm
rpm
master

搜索帮助