代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/selinux-policy 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 369f900039cff9443e86fdf7254ba8b11dc6adb5 Mon Sep 17 00:00:00 2001
From: Patrik Koncity <pkoncity@redhat.com>
Date: Thu, 10 Feb 2022 11:46:13 +0100
Subject: [PATCH] Allow sysadm_passwd_t to relabel passwd and group files
Reference: https://gitbub.com/fedora-selinux/selinux-policy/commit/369f900039cff9443e86fdf7254ba8b11dc6adb5
Conflict: NA
Vigr mechanism of editing group and passwd
files work on principle of recreating the current
file with new changes. Due to this mechanism is
need to again relabel file with selinux label.
Creating interface allowing relabel to the passwd_file_t
type. Allow relabeling for sysadm_passwd_t domain.
Allow dac_override permission for sysadm_passwd_t type.
Signed-off-by: lujie54 <lujie54@huawei.com>
---
policy/modules/admin/usermanage.te | 3 ++-
policy/modules/system/authlogin.if | 20 ++++++++++++++++++++
2 files changed, 22 insertions(+), 1 deletion(-)
diff --git a/policy/modules/admin/usermanage.te b/policy/modules/admin/usermanage.te
index 8fdbfbc..155fb68 100644
--- a/policy/modules/admin/usermanage.te
+++ b/policy/modules/admin/usermanage.te
@@ -433,7 +433,7 @@ optional_policy(`
# Password admin local policy
#
-allow sysadm_passwd_t self:capability { chown dac_read_search fsetid setuid setgid sys_resource };
+allow sysadm_passwd_t self:capability { chown dac_override dac_read_search fsetid setuid setgid sys_resource };
allow sysadm_passwd_t self:process ~{ ptrace setcurrent setexec setfscreate setrlimit execmem execstack execheap };
allow sysadm_passwd_t self:process { setrlimit setfscreate };
allow sysadm_passwd_t self:fd use;
@@ -478,6 +478,7 @@ term_getattr_all_ptys(sysadm_passwd_t)
auth_manage_passwd(sysadm_passwd_t)
auth_manage_shadow(sysadm_passwd_t)
auth_relabel_shadow(sysadm_passwd_t)
+auth_relabelto_passwd_files(sysadm_passwd_t)
auth_etc_filetrans_shadow(sysadm_passwd_t)
auth_use_nsswitch(sysadm_passwd_t)
diff --git a/policy/modules/system/authlogin.if b/policy/modules/system/authlogin.if
index ad55205..b5b3702 100644
--- a/policy/modules/system/authlogin.if
+++ b/policy/modules/system/authlogin.if
@@ -851,6 +851,26 @@ interface(`auth_relabel_shadow',`
#######################################
## <summary>
+## Relabel to the
+## password file type.
+## </summary>
+## <param name="domain">
+## <summary>
+## Domain allowed access.
+## </summary>
+## </param>
+#
+interface(`auth_relabelto_passwd_files',`
+ gen_require(`
+ type passwd_file_t;
+ ')
+
+ files_search_etc($1)
+ allow $1 passwd_file_t:file relabelto;
+')
+
+#######################################
+## <summary>
## Append to the login failure log.
## </summary>
## <param name="domain">
--
1.8.3.1
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。