加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-Allow-chronyd-send-a-message-to-sosreport-over-datag.patch 1.67 KB
一键复制 编辑 原始数据 按行查看 历史
lujie54 提交于 2022-09-15 09:20 . backport upstream patches
From 05e940f535497768c2b4a8c37365b5b5156eda75 Mon Sep 17 00:00:00 2001
From: Zdenek Pytela <zpytela@redhat.com>
Date: Fri, 25 Feb 2022 14:16:52 +0100
Subject: [PATCH] Allow chronyd send a message to sosreport over datagram
socket
Reference: https://gitbub.com/fedora-selinux/selinux-policy/commit/05e940f535497768c2b4a8c37365b5b5156eda75
Conflict: NA
The sosreport_dgram_send() interface was added.
Signed-off-by: lujie54 <lujie54@huawei.com>
---
policy/modules/contrib/chronyd.te | 4 ++++
policy/modules/contrib/sosreport.if | 18 ++++++++++++++++++
2 files changed, 22 insertions(+)
diff --git a/policy/modules/contrib/chronyd.te b/policy/modules/contrib/chronyd.te
index 8da80de..142139d 100644
--- a/policy/modules/contrib/chronyd.te
+++ b/policy/modules/contrib/chronyd.te
@@ -175,6 +175,10 @@ optional_policy(`
rolekit_dgram_send(chronyd_t)
')
+optional_policy(`
+ sosreport_dgram_send(chronyd_t)
+')
+
########################################
#
# Local policy
diff --git a/policy/modules/contrib/sosreport.if b/policy/modules/contrib/sosreport.if
index c5fbb7a..44b13a8 100644
--- a/policy/modules/contrib/sosreport.if
+++ b/policy/modules/contrib/sosreport.if
@@ -166,3 +166,21 @@ interface(`sosreport_dbus_chat',`
allow $1 sosreport_t:dbus send_msg;
allow sosreport_t $1:dbus send_msg;
')
+
+########################################
+## <summary>
+## Send a message to sosreport over the datagram socket.
+## </summary>
+## <param name="domain">
+## <summary>
+## Domain allowed access.
+## </summary>
+## </param>
+#
+interface(`sosreport_dgram_send',`
+ gen_require(`
+ type sosreport_t;
+ ')
+
+ allow $1 sosreport_t:unix_dgram_socket sendto;
+')
--
1.8.3.1
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化