Chris PeBenito e181fe
Chris PeBenito 960373
policy_module(getty,1.0)
Chris PeBenito 960373
Chris PeBenito 4bf4ed
########################################
Chris PeBenito 4bf4ed
#
Chris PeBenito 4bf4ed
# Declarations
Chris PeBenito 4bf4ed
#
Chris PeBenito 4bf4ed
Chris PeBenito e9a6fc
type getty_t;
Chris PeBenito b470e3
type getty_exec_t;
Chris PeBenito c9428d
init_domain(getty_t,getty_exec_t)
Chris PeBenito c9428d
domain_wide_inherit_fd(getty_t)
Chris PeBenito b470e3
Chris PeBenito b470e3
type getty_etc_t;
Chris PeBenito b470e3
typealias getty_etc_t alias etc_getty_t;
Chris PeBenito 603f90
files_type(getty_etc_t)
Chris PeBenito b470e3
Chris PeBenito 0907bd
type getty_lock_t;
Chris PeBenito 0907bd
files_lock_file(getty_lock_t)
Chris PeBenito 0907bd
Chris PeBenito b470e3
type getty_log_t;
Chris PeBenito c9428d
logging_log_file(getty_log_t)
Chris PeBenito b470e3
Chris PeBenito 38e24a
type getty_tmp_t;
Chris PeBenito c9428d
files_tmp_file(getty_tmp_t)
Chris PeBenito 38e24a
Chris PeBenito 0907bd
type getty_var_run_t;
Chris PeBenito 0907bd
files_pid_file(getty_var_run_t)
Chris PeBenito 0907bd
Chris PeBenito b470e3
########################################
Chris PeBenito b470e3
#
Chris PeBenito b470e3
# Getty local policy
Chris PeBenito b470e3
#
Chris PeBenito b470e3
Chris PeBenito b470e3
# Use capabilities.
Chris PeBenito 0907bd
allow getty_t self:capability { dac_override chown sys_resource sys_tty_config fowner fsetid };
Chris PeBenito b470e3
allow getty_t self:process { getpgid getsession };
Chris PeBenito b470e3
Chris PeBenito dd8229
allow getty_t getty_etc_t:dir r_dir_perms;
Chris PeBenito dd8229
allow getty_t getty_etc_t:file r_file_perms;
Chris PeBenito c9428d
files_create_etc_config(getty_t,getty_etc_t,{ file dir })
Chris PeBenito b470e3
Chris PeBenito 0907bd
allow getty_t getty_lock_t:file create_file_perms;
Chris PeBenito 0907bd
files_create_lock(getty_t,getty_lock_t)
Chris PeBenito 0907bd
Chris PeBenito 0907bd
allow getty_t getty_log_t:file { getattr append setattr };
Chris PeBenito 0907bd
Chris PeBenito b470e3
allow getty_t getty_tmp_t:file { getattr create read setattr write setattr unlink };
Chris PeBenito b470e3
allow getty_t getty_tmp_t:dir { getattr search create read setattr write setattr unlink rmdir };
Chris PeBenito c9428d
files_create_tmp_files(getty_t,getty_tmp_t,{ file dir })
Chris PeBenito 4bf4ed
Chris PeBenito 0907bd
allow getty_t getty_var_run_t:file create_file_perms;
Chris PeBenito 0907bd
allow getty_t getty_var_run_t:dir create_dir_perms;
Chris PeBenito 0907bd
files_create_pid(getty_t,getty_var_run_t)
Chris PeBenito b470e3
Chris PeBenito 8bd678
dev_read_sysfs(getty_t)
Chris PeBenito b470e3
Chris PeBenito 4600e0
# for error condition handling
Chris PeBenito 0fd9dc
fs_getattr_xattr_fs(getty_t)
Chris PeBenito b470e3
Chris PeBenito 4600e0
# Chown, chmod, read and write ttys.
Chris PeBenito 0fd9dc
term_use_all_user_ttys(getty_t)
Chris PeBenito 0fd9dc
term_use_unallocated_tty(getty_t)
Chris PeBenito 0fd9dc
term_setattr_all_user_ttys(getty_t)
Chris PeBenito 0fd9dc
term_setattr_unallocated_ttys(getty_t)
Chris PeBenito 0fd9dc
term_setattr_console(getty_t)
Chris PeBenito b470e3
Chris PeBenito c9428d
auth_rw_login_records(getty_t)
Chris PeBenito d115b2
Chris PeBenito c9428d
corecmd_search_bin(getty_t)
Chris PeBenito 0907bd
corecmd_search_sbin(getty_t)
Chris PeBenito b470e3
Chris PeBenito c9428d
files_rw_generic_pids(getty_t)
Chris PeBenito c9428d
files_read_etc_runtime_files(getty_t)
Chris PeBenito 8fd367
files_read_etc_files(getty_t)
Chris PeBenito b470e3
Chris PeBenito c9428d
init_rw_script_pid(getty_t)
Chris PeBenito c9428d
init_use_script_pty(getty_t)
Chris PeBenito b470e3
Chris PeBenito c9428d
libs_use_ld_so(getty_t)
Chris PeBenito c9428d
libs_use_shared_libs(getty_t)
Chris PeBenito efd8ed
Chris PeBenito c9428d
locallogin_domtrans(getty_t)
Chris PeBenito b470e3
Chris PeBenito c9428d
logging_send_syslog_msg(getty_t)
Chris PeBenito b470e3
Chris PeBenito 4600e0
miscfiles_read_localization(getty_t)
Chris PeBenito 0907bd
Chris PeBenito 0907bd
ifdef(`TODO',`
Chris PeBenito 0907bd
#
Chris PeBenito 0907bd
# getty needs to be able to run pppd
Chris PeBenito 0907bd
#
Chris PeBenito 0907bd
ifdef(`pppd.te', `
Chris PeBenito 0907bd
domain_auto_trans(getty_t, pppd_exec_t, pppd_t)
Chris PeBenito 0907bd
')
Chris PeBenito 0907bd
') dnl end TODO