selinux-policy/policy/modules/services/lpd.if

216 lines
4.0 KiB
Plaintext
Raw Normal View History

2005-10-22 21:09:03 +00:00
## <summary>Line printer daemon</summary>
2008-11-05 16:10:46 +00:00
########################################
2006-01-18 22:26:26 +00:00
## <summary>
2008-11-05 16:10:46 +00:00
## Role access for lpd
2006-01-18 22:26:26 +00:00
## </summary>
2008-11-05 16:10:46 +00:00
## <param name="role">
## <summary>
2008-11-05 16:10:46 +00:00
## Role allowed access
## </summary>
2006-01-18 22:26:26 +00:00
## </param>
2008-11-05 16:10:46 +00:00
## <param name="domain">
## <summary>
2008-11-05 16:10:46 +00:00
## User domain for the role
## </summary>
2006-01-18 22:26:26 +00:00
## </param>
## <rolecap/>
2006-01-18 22:26:26 +00:00
#
2008-11-05 16:10:46 +00:00
interface(`lpd_role',`
2006-01-18 22:26:26 +00:00
gen_require(`
2008-11-05 16:10:46 +00:00
type lpr_t, lpr_exec_t, print_spool_t;
')
2006-01-18 22:26:26 +00:00
2008-11-05 16:10:46 +00:00
role $1 types lpr_t;
2006-01-18 22:26:26 +00:00
# Transition from the user domain to the derived domain.
2008-11-05 16:10:46 +00:00
domtrans_pattern($2, lpr_exec_t, lpr_t)
dontaudit lpr_t $2:unix_stream_socket { read write };
2006-01-18 22:26:26 +00:00
2008-11-05 16:10:46 +00:00
ps_process_pattern($2, lpr_t)
allow $2 lpr_t:process { ptrace signal_perms };
2006-01-18 22:26:26 +00:00
optional_policy(`
2006-01-18 22:26:26 +00:00
cups_read_config($2)
')
')
2005-10-22 21:09:03 +00:00
########################################
## <summary>
## Execute lpd in the lpd domain.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed to transition.
## </summary>
2005-10-22 21:09:03 +00:00
## </param>
#
interface(`lpd_domtrans_checkpc',`
gen_require(`
type checkpc_t, checkpc_exec_t;
')
domtrans_pattern($1, checkpc_exec_t, checkpc_t)
2005-10-22 21:09:03 +00:00
')
########################################
## <summary>
## Execute amrecover in the lpd domain, and
## allow the specified role the lpd domain.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed to transition.
## </summary>
2005-10-22 21:09:03 +00:00
## </param>
## <param name="role">
## <summary>
## Role allowed access.
## </summary>
2005-10-22 21:09:03 +00:00
## </param>
2006-09-06 22:07:25 +00:00
## <rolecap/>
2005-10-22 21:09:03 +00:00
#
interface(`lpd_run_checkpc',`
gen_require(`
type checkpc_t;
')
lpd_domtrans_checkpc($1)
role $2 types checkpc_t;
')
########################################
## <summary>
## List the contents of the printer spool directories.
## </summary>
## <param name="domain">
## <summary>
2005-10-22 21:09:03 +00:00
## Domain allowed access.
## </summary>
2005-10-22 21:09:03 +00:00
## </param>
#
interface(`lpd_list_spool',`
gen_require(`
type print_spool_t;
')
files_search_spool($1)
allow $1 print_spool_t:dir list_dir_perms;
')
2007-11-15 20:10:26 +00:00
########################################
## <summary>
## Read the printer spool files.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`lpd_read_spool',`
gen_require(`
type print_spool_t;
')
files_search_spool($1)
read_files_pattern($1, print_spool_t, print_spool_t)
2007-11-15 20:10:26 +00:00
')
2005-10-23 22:10:59 +00:00
########################################
## <summary>
## Create, read, write, and delete printer spool files.
## </summary>
## <param name="domain">
## <summary>
2005-10-23 22:10:59 +00:00
## Domain allowed access.
## </summary>
2005-10-23 22:10:59 +00:00
## </param>
#
interface(`lpd_manage_spool',`
gen_require(`
type print_spool_t;
')
files_search_spool($1)
2008-03-27 15:20:16 +00:00
manage_dirs_pattern($1, print_spool_t, print_spool_t)
manage_files_pattern($1, print_spool_t, print_spool_t)
2009-06-26 13:22:39 +00:00
manage_lnk_files_pattern($1, print_spool_t, print_spool_t)
2005-10-23 22:10:59 +00:00
')
########################################
## <summary>
## Relabel from and to the spool files.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`lpd_relabel_spool',`
gen_require(`
type print_spool_t;
')
files_search_spool($1)
allow $1 print_spool_t:file relabel_file_perms;
')
2005-10-22 21:09:03 +00:00
########################################
## <summary>
## List the contents of the printer spool directories.
## </summary>
## <param name="domain">
## <summary>
2005-10-22 21:09:03 +00:00
## Domain allowed access.
## </summary>
2005-10-22 21:09:03 +00:00
## </param>
2006-09-06 22:07:25 +00:00
## <rolecap/>
2005-10-22 21:09:03 +00:00
#
interface(`lpd_read_config',`
gen_require(`
type printconf_t;
')
allow $1 printconf_t:dir list_dir_perms;
read_files_pattern($1, printconf_t, printconf_t)
2005-10-22 21:09:03 +00:00
')
2006-03-08 20:09:42 +00:00
########################################
## <summary>
2008-12-03 19:16:20 +00:00
## Transition to a user lpr domain.
2006-03-08 20:09:42 +00:00
## </summary>
## <param name="domain">
## <summary>
## Domain allowed to transition.
2006-03-08 20:09:42 +00:00
## </summary>
## </param>
#
interface(`lpd_domtrans_lpr',`
2006-03-08 20:09:42 +00:00
gen_require(`
2008-11-05 16:10:46 +00:00
type lpr_t, lpr_exec_t;
2006-03-08 20:09:42 +00:00
')
2008-11-05 16:10:46 +00:00
domtrans_pattern($1, lpr_exec_t, lpr_t)
2006-03-08 20:09:42 +00:00
')
2007-09-07 13:41:20 +00:00
########################################
## <summary>
## Allow the specified domain to execute lpr
## in the caller domain.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`lpd_exec_lpr',`
gen_require(`
type lpr_exec_t;
')
can_exec($1, lpr_exec_t)
')