Miscfiles patch from Dan Walsh.

This commit is contained in:
Chris PeBenito 2010-03-09 10:44:55 -05:00
parent 547d62ea9e
commit d0a6df5c47
3 changed files with 75 additions and 4 deletions

View File

@ -42,6 +42,7 @@ ifdef(`distro_redhat',`
/usr/man(/.*)? gen_context(system_u:object_r:man_t,s0)
/usr/share/fonts(/.*)? gen_context(system_u:object_r:fonts_t,s0)
/usr/share/X11/fonts(/.*)? gen_context(system_u:object_r:fonts_t,s0)
/usr/share/ghostscript/fonts(/.*)? gen_context(system_u:object_r:fonts_t,s0)
/usr/share/locale(/.*)? gen_context(system_u:object_r:locale_t,s0)
/usr/share/man(/.*)? gen_context(system_u:object_r:man_t,s0)
@ -70,15 +71,18 @@ ifdef(`distro_redhat',`
/var/lib/texmf(/.*)? gen_context(system_u:object_r:tetex_data_t,s0)
/var/cache/fontconfig(/.*)? gen_context(system_u:object_r:fonts_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/www/cobbler/images(/.*)? gen_context(system_u:object_r:public_content_rw_t, s0)
/var/lib/cobbler/webui_sessions(/.*)? gen_context(system_u:object_r:public_content_rw_t, s0)
/var/named/chroot/etc/pki(/.*)? gen_context(system_u:object_r:cert_t,s0)
/var/spool/texmf(/.*)? gen_context(system_u:object_r:tetex_data_t,s0)
/var/www/cobbler/images(/.*)? gen_context(system_u:object_r:public_content_rw_t, s0)
ifdef(`distro_debian',`
/var/lib/msttcorefonts(/.*)? gen_context(system_u:object_r:fonts_t,s0)
/var/lib/usbutils(/.*)? gen_context(system_u:object_r:hwdata_t,s0)

View File

@ -73,7 +73,7 @@ interface(`miscfiles_manage_cert_files',`
#
interface(`miscfiles_read_fonts',`
gen_require(`
type fonts_t;
type fonts_t, fonts_cache_t;
')
# cjp: fonts can be in either of these dirs
@ -83,6 +83,10 @@ interface(`miscfiles_read_fonts',`
allow $1 fonts_t:dir list_dir_perms;
read_files_pattern($1, fonts_t, fonts_t)
read_lnk_files_pattern($1, fonts_t, fonts_t)
allow $1 fonts_cache_t:dir list_dir_perms;
read_files_pattern($1, fonts_cache_t, fonts_cache_t)
read_lnk_files_pattern($1, fonts_cache_t, fonts_cache_t)
')
########################################
@ -169,6 +173,66 @@ interface(`miscfiles_manage_fonts',`
manage_lnk_files_pattern($1, fonts_t, fonts_t)
')
########################################
## <summary>
## Set the attributes on a fonts cache directory.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`miscfiles_setattr_fonts_cache_dirs',`
gen_require(`
type fonts_cache_t;
')
allow $1 fonts_cache_t:dir setattr;
')
########################################
## <summary>
## Do not audit attempts to set the attributes
## on a fonts cache directory.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`miscfiles_dontaudit_setattr_fonts_cache_dirs',`
gen_require(`
type fonts_cache_t;
')
dontaudit $1 fonts_cache_t:dir setattr;
')
########################################
## <summary>
## Create, read, write, and delete fonts cache.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
## <rolecap/>
#
interface(`miscfiles_manage_fonts_cache',`
gen_require(`
type fonts_cache_t;
')
files_search_var($1)
manage_dirs_pattern($1, fonts_cache_t, fonts_cache_t)
manage_files_pattern($1, fonts_cache_t, fonts_cache_t)
manage_lnk_files_pattern($1, fonts_cache_t, fonts_cache_t)
')
########################################
## <summary>
## Read hardware identification data.

View File

@ -1,5 +1,5 @@
policy_module(miscfiles, 1.7.2)
policy_module(miscfiles, 1.7.3)
########################################
#
@ -19,6 +19,9 @@ files_type(cert_t)
type fonts_t;
files_type(fonts_t)
type fonts_cache_t;
files_type(fonts_cache_t)
#
# type for /usr/share/hwdata
#