From: dominick.grift@gmail.com (Dominick Grift) Date: Wed, 31 Oct 2012 17:12:15 +0100 Subject: [refpolicy] [PATCH v2] Label /var/cache/man with a private man cache type for mandb Message-ID: <1351699935-26732-1-git-send-email-dominick.grift@gmail.com> To: refpolicy@oss.tresys.com List-Id: refpolicy.oss.tresys.com With some cosmetic fixes Signed-off-by: Dominick Grift diff --git a/policy/modules/system/miscfiles.fc b/policy/modules/system/miscfiles.fc index 9116567..855792f 100644 --- a/policy/modules/system/miscfiles.fc +++ b/policy/modules/system/miscfiles.fc @@ -77,7 +77,7 @@ /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/cache/man(/.*)? gen_context(system_u:object_r:man_cache_t,s0) /var/named/chroot/etc/pki(/.*)? gen_context(system_u:object_r:cert_t,s0) diff --git a/policy/modules/system/miscfiles.if b/policy/modules/system/miscfiles.if index 926ba65..2394263 100644 --- a/policy/modules/system/miscfiles.if +++ b/policy/modules/system/miscfiles.if @@ -582,6 +582,49 @@ ######################################## ## +## Read man cache content. +## +## +## +## Domain allowed access. +## +## +# +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; +') + +######################################## +## +## Create, read, write, and delete +## man cache content. +## +## +## +## Domain allowed access. +## +## +# +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; +') + +######################################## +## ## Read public files used for file ## transfer services. ## diff --git a/policy/modules/system/miscfiles.te b/policy/modules/system/miscfiles.te index dcc5233..c6e5d3b 100644 --- a/policy/modules/system/miscfiles.te +++ b/policy/modules/system/miscfiles.te @@ -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 #