Skip to contentSkip to conversation

Let users read/manage symlinks on fs that do not support xattr

PATCH New Guido Trentalancia 2 participants 2 messages Oct 29, 2016 – Oct 30, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Let users read/manage symlinks on fs that do not support xattr

Let unprivileged and administrative users read symbolic links on filesystems that do not support extended attributes (xattr) such as cdroms, FAT, NTFS and so on.

---
 policy/modules/kernel/filesystem.if |   18 ++++++++++++++++++
 policy/modules/system/userdomain.if |    4 +++-
 2 files changed, 21 insertions(+), 1 deletion(-)
policy/modules/kernel/filesystem.if +18 -0
diff -pru refpolicy-git-29102016-orig/policy/modules/kernel/filesystem.if refpolicy-git-29102016/policy/modules/kernel/filesystem.if
@@ -1257,6 +1257,24 @@ interface(`fs_read_noxattr_fs_symlinks',
 
 ########################################
 ## <summary>
+##	Manage all noxattrfs symbolic links.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed access.
+##	</summary>
+## </param>
+#
+interface(`fs_manage_noxattr_fs_symlinks',`
+	gen_require(`
+		attribute noxattrfs;
+	')
+
+	manage_lnk_files_pattern($1, noxattrfs, noxattrfs)
+')
+
+########################################
+## <summary>
 ##	Relabel all objets from filesystems that
 ##	do not support extended attributes.
 ## </summary>
policy/modules/system/userdomain.if +3 -1
diff -pru refpolicy-git-29102016-orig/policy/modules/system/userdomain.if refpolicy-git-29102016/policy/modules/system/userdomain.if
@@ -587,10 +587,12 @@ template(`userdom_common_user_template',
 	')
 
 	tunable_policy(`user_rw_noexattrfile',`
-		fs_manage_noxattr_fs_files($1_t)
 		fs_manage_noxattr_fs_dirs($1_t)
+		fs_manage_noxattr_fs_files($1_t)
+		fs_manage_noxattr_fs_symlinks($1_t)
 	',`
 		fs_read_noxattr_fs_files($1_t)
+		fs_read_noxattr_fs_symlinks($1_t)
 	')
 
 	tunable_policy(`user_ttyfile_stat',`
#1 lore raw

PATCH 1/1 Let users read/manage symlinks on fs that do not support xattr

Quoted 45 lines · Guido Trentalancia via refpolicy

Let unprivileged and administrative users read symbolic links on filesystems that do not support extended attributes (xattr) such as cdroms, FAT, NTFS and so on.

---
 policy/modules/kernel/filesystem.if |   18 ++++++++++++++++++
 policy/modules/system/userdomain.if |    4 +++-
 2 files changed, 21 insertions(+), 1 deletion(-)

diff -pru refpolicy-git-29102016-orig/policy/modules/kernel/filesystem.if refpolicy-git-29102016/policy/modules/kernel/filesystem.if

policy/modules/kernel/filesystem.if +18 -0
@@ -1257,6 +1257,24 @@ interface(`fs_read_noxattr_fs_symlinks',
 
 ########################################
 ## <summary>
+##	Manage all noxattrfs symbolic links.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed access.
+##	</summary>
+## </param>
+#
+interface(`fs_manage_noxattr_fs_symlinks',`
+	gen_require(`
+		attribute noxattrfs;
+	')
+
+	manage_lnk_files_pattern($1, noxattrfs, noxattrfs)
+')
+
+########################################
+## <summary>
 ##	Relabel all objets from filesystems that
 ##	do not support extended attributes.
 ## </summary>

diff -pru refpolicy-git-29102016-orig/policy/modules/system/userdomain.if refpolicy-git-29102016/policy/modules/system/userdomain.if

policy/modules/system/userdomain.if +0 -0
@@ -587,10 +587,12 @@ template(`userdom_common_user_template',
 	')
 
 	tunable_policy(`user_rw_noexattrfile',`

policy/modules/system/userdomain.if template(`userdom_common_user_template', · line 598

Quoted 10 lines
policy/modules/system/userdomain.if +3 -1
-		fs_manage_noxattr_fs_files($1_t)
 		fs_manage_noxattr_fs_dirs($1_t)
+		fs_manage_noxattr_fs_files($1_t)
+		fs_manage_noxattr_fs_symlinks($1_t)
 	',`
 		fs_read_noxattr_fs_files($1_t)
+		fs_read_noxattr_fs_symlinks($1_t)
 	')
 
 	tunable_policy(`user_ttyfile_stat',`

Merged.

Signature · 1 line
Chris PeBenito