From 705fc27141d8aeb736fecdd6a6048f59c55f6d1f Mon Sep 17 00:00:00 2001
From: Zdenek Pytela <zpytela@redhat.com>
Date: Wed, 27 Jul 2022 18:11:34 +0200
Subject: [PATCH] Add permissions to manage lnk_files into
 gnome_manage_home_config

Reference: https://gitbub.com/fedora-selinux/selinux-policy/commit/705fc27141d8aeb736fecdd6a6048f59c55f6d1f
Conflict: NA

The gnome_manage_home_config() interface contains manage_files_pattern()
call for config_home_t files only, but symlinks can be there, too.

Addresses the following AVC denial:
type=AVC msg=audit(1652884370.574:523): avc:  denied  { unlink } for  pid=45745 comm="systemd-user-ru" name="user" dev="tmpfs" ino=240 scontext=system_u:system_r:systemd_logind_t:s0 tcontext=unconfined_u:object_r:config_home_t:s0 tclass=lnk_file permissive=0

Resolves: rhbz#2088269
Signed-off-by: lujie54 <lujie54@huawei.com>
---
 policy/modules/contrib/gnome.if | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/policy/modules/contrib/gnome.if b/policy/modules/contrib/gnome.if
index 1d62f2a..f52d635 100644
--- a/policy/modules/contrib/gnome.if
+++ b/policy/modules/contrib/gnome.if
@@ -1398,7 +1398,8 @@ interface(`gnome_manage_home_config',`
 	')
 
 	manage_files_pattern($1, config_home_t, config_home_t)
-    allow $1 config_home_t:file map;
+	manage_lnk_files_pattern($1, config_home_t, config_home_t)
+	allow $1 config_home_t:file map;
 ')
 
 #######################################
-- 
1.8.3.1

