0 Star 0 Fork 33

lixiao/selinux-policy

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-Allow-dhclient-manage-pid-files-used-by-chronyd.patch 1.77 KB
一键复制 编辑 原始数据 按行查看 历史
lujie54 提交于 2022-09-15 10:25 . backport upstream patches
From bf1751a3a139dfb05160330d04f68d4ab89a80f4 Mon Sep 17 00:00:00 2001
From: Zdenek Pytela <zpytela@redhat.com>
Date: Tue, 21 Jun 2022 17:45:28 +0200
Subject: [PATCH] Allow dhclient manage pid files used by chronyd
Reference: https://gitbub.com/fedora-selinux/selinux-policy/commit/bf1751a3a139dfb05160330d04f68d4ab89a80f4
Conflict: NA
The chronyd_manage_pid_files() interface was added.
Resolves: rhbz#2093709
Signed-off-by: lujie54 <lujie54@huawei.com>
---
policy/modules/contrib/chronyd.if | 19 +++++++++++++++++++
policy/modules/system/sysnetwork.te | 1 +
2 files changed, 20 insertions(+)
diff --git a/policy/modules/contrib/chronyd.if b/policy/modules/contrib/chronyd.if
index cad4d31..d2f5504 100644
--- a/policy/modules/contrib/chronyd.if
+++ b/policy/modules/contrib/chronyd.if
@@ -236,6 +236,25 @@ interface(`chronyd_manage_pid',`
manage_dirs_pattern($1, chronyd_var_run_t, chronyd_var_run_t)
')
+########################################
+## <summary>
+## Manage pid files used by chronyd
+## </summary>
+## <param name="domain">
+## <summary>
+## Domain allowed access.
+## </summary>
+## </param>
+#
+interface(`chronyd_manage_pid_files',`
+ gen_require(`
+ type chronyd_var_run_t;
+ ')
+
+ files_search_pids($1)
+ manage_files_pattern($1, chronyd_var_run_t, chronyd_var_run_t)
+')
+
######################################
## <summary>
## Create objects in /var/run
diff --git a/policy/modules/system/sysnetwork.te b/policy/modules/system/sysnetwork.te
index 1bb35d1..41b851f 100644
--- a/policy/modules/system/sysnetwork.te
+++ b/policy/modules/system/sysnetwork.te
@@ -201,6 +201,7 @@ optional_policy(`
chronyd_systemctl(dhcpc_t)
chronyd_domtrans(dhcpc_t)
chronyd_domtrans_chronyc(dhcpc_t)
+ chronyd_manage_pid_files(dhcpc_t)
chronyd_read_keys(dhcpc_t)
')
--
1.8.3.1
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/lixiao2023/selinux-policy.git
git@gitee.com:lixiao2023/selinux-policy.git
lixiao2023
selinux-policy
selinux-policy
master

搜索帮助