Skip to contentSkip to conversation

Label /var/cache/man with a private man cache type for mandb

PATCH New Dominick Grift 1 participant 2 messages Oct 31, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Label /var/cache/man with a private man cache type for mandb

policy/modules/system/miscfiles.fc +1 -1
index 9116567..50e058c 100644
@@ -75,9 +75,9 @@
 
 /var/lib/texmf(/.*)?		gen_context(system_u:object_r:tetex_data_t,s0)
 
+/var/cache/man(/.*)?	gen_context(system_u:object_r:man_cache_t,s0)
 /var/cache/fontconfig(/.*)?	gen_context(system_u:object_r:fonts_cache_t,s0)
 /var/cache/fonts(/.*)?		gen_context(system_u:object_r:tetex_data_t,s0)
-/var/cache/man(/.*)?		gen_context(system_u:object_r:man_t,s0)
 
 /var/named/chroot/etc/pki(/.*)? gen_context(system_u:object_r:cert_t,s0)
 
policy/modules/system/miscfiles.if +43 -0

49 lines not on this page · raw message

policy/modules/system/miscfiles.te +3 -0
index dcc5233..c6e5d3b 100644
@@ -41,6 +41,9 @@
 type man_t alias catman_t;
 files_type(man_t)
 
+type man_cache_t;
+files_type(man_cache_t)
+
 #
 # Types for public content
 #
#1 lore raw

PATCH 1/1 Label /var/cache/man with a private man cache type for mandb

Quoted 75 lines · Dominick Grift
policy/modules/system/miscfiles.fc +1 -1
index 9116567..50e058c 100644
@@ -75,9 +75,9 @@
 
 /var/lib/texmf(/.*)?		gen_context(system_u:object_r:tetex_data_t,s0)
 
+/var/cache/man(/.*)?	gen_context(system_u:object_r:man_cache_t,s0)
 /var/cache/fontconfig(/.*)?	gen_context(system_u:object_r:fonts_cache_t,s0)
 /var/cache/fonts(/.*)?		gen_context(system_u:object_r:tetex_data_t,s0)
-/var/cache/man(/.*)?		gen_context(system_u:object_r:man_t,s0)
 
 /var/named/chroot/etc/pki(/.*)? gen_context(system_u:object_r:cert_t,s0)
 
policy/modules/system/miscfiles.if +43 -0
index 926ba65..677dc6e 100644
@@ -582,6 +582,49 @@
 
 ########################################
 ## <summary>
+##	Read man cache files.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed access.
+##	</summary>
+## </param>
+#
+interface(`miscfiles_read_man_cache_content',`
+	gen_require(`
+		type man_cache_t;
+	')
+
+	files_search_var($1)
+	allow $1 man_cache_t:dir list_dir_perms;
+	allow $1 man_cache_t:file read_file_perms;
+	allow $1 man_cache_t:lnk_file read_lnk_file_perms;
+')
+
+########################################
+## <summary>
+##	Create, read, write, and delete
+##	man cache content.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed access.
+##	</summary>
+## </param>
+#
+interface(`miscfiles_manage_man_cache_content',`
+	gen_require(`
+		type man_cache_t;
+	')
+
+	files_search_var($1)
+	allow $1 man_cache_t:dir manage_dir_perms;
+	allow $1 man_cache_t:file manage_file_perms;
+	allow $1 man_cache_t:lnk_file manage_lnk_file_perms;
+')
+
+########################################
+## <summary>
 ##	Read public files used for file
 ##	transfer services.
 ## </summary>
policy/modules/system/miscfiles.te +0 -0
index dcc5233..c6e5d3b 100644

policy/modules/system/miscfiles.te line 49

Quoted 9 lines
policy/modules/system/miscfiles.te +3 -0
@@ -41,6 +41,9 @@
 type man_t alias catman_t;
 files_type(man_t)
 
+type man_cache_t;
+files_type(man_cache_t)
+
 #
 # Types for public content
 #

Hmm let me clean this up a bit first