2005-04-20 19:07:16 +00:00
|
|
|
|
2008-10-14 15:46:36 +00:00
|
|
|
policy_module(getty, 1.7.0)
|
2005-04-26 17:00:25 +00:00
|
|
|
|
2005-05-31 19:52:57 +00:00
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Declarations
|
|
|
|
#
|
|
|
|
|
2006-10-04 17:25:34 +00:00
|
|
|
type getty_t;
|
2005-04-19 20:42:32 +00:00
|
|
|
type getty_exec_t;
|
2005-06-13 17:35:46 +00:00
|
|
|
init_domain(getty_t,getty_exec_t)
|
2008-08-14 14:19:50 +00:00
|
|
|
init_system_domain(getty_t, getty_exec_t)
|
2006-02-20 21:33:25 +00:00
|
|
|
domain_interactive_fd(getty_t)
|
2005-04-19 20:42:32 +00:00
|
|
|
|
|
|
|
type getty_etc_t;
|
|
|
|
typealias getty_etc_t alias etc_getty_t;
|
2005-10-24 18:40:24 +00:00
|
|
|
files_config_file(getty_etc_t)
|
2005-04-19 20:42:32 +00:00
|
|
|
|
2005-09-13 13:06:07 +00:00
|
|
|
type getty_lock_t;
|
|
|
|
files_lock_file(getty_lock_t)
|
|
|
|
|
2005-04-19 20:42:32 +00:00
|
|
|
type getty_log_t;
|
2005-06-13 17:35:46 +00:00
|
|
|
logging_log_file(getty_log_t)
|
2005-04-19 20:42:32 +00:00
|
|
|
|
2005-05-11 19:21:40 +00:00
|
|
|
type getty_tmp_t;
|
2005-06-13 17:35:46 +00:00
|
|
|
files_tmp_file(getty_tmp_t)
|
2005-05-11 19:21:40 +00:00
|
|
|
|
2005-09-13 13:06:07 +00:00
|
|
|
type getty_var_run_t;
|
|
|
|
files_pid_file(getty_var_run_t)
|
|
|
|
|
2005-04-19 20:42:32 +00:00
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Getty local policy
|
|
|
|
#
|
|
|
|
|
|
|
|
# Use capabilities.
|
2006-07-28 15:13:58 +00:00
|
|
|
allow getty_t self:capability { dac_override chown setgid sys_resource sys_tty_config fowner fsetid };
|
2005-10-26 16:00:13 +00:00
|
|
|
dontaudit getty_t self:capability sys_tty_config;
|
2007-02-16 23:01:42 +00:00
|
|
|
allow getty_t self:process { getpgid setpgid getsession signal_perms };
|
|
|
|
allow getty_t self:fifo_file rw_fifo_file_perms;
|
2005-04-19 20:42:32 +00:00
|
|
|
|
2006-12-12 20:08:08 +00:00
|
|
|
read_files_pattern(getty_t,getty_etc_t,getty_etc_t)
|
|
|
|
read_lnk_files_pattern(getty_t,getty_etc_t,getty_etc_t)
|
2006-02-21 18:40:44 +00:00
|
|
|
files_etc_filetrans(getty_t,getty_etc_t,{ file dir })
|
2005-04-19 20:42:32 +00:00
|
|
|
|
2006-12-12 20:08:08 +00:00
|
|
|
allow getty_t getty_lock_t:file manage_file_perms;
|
2006-03-02 23:41:11 +00:00
|
|
|
files_lock_filetrans(getty_t,getty_lock_t,file)
|
2005-09-13 13:06:07 +00:00
|
|
|
|
2006-12-12 20:08:08 +00:00
|
|
|
allow getty_t getty_log_t:file manage_file_perms;
|
2006-03-02 23:41:11 +00:00
|
|
|
logging_log_filetrans(getty_t,getty_log_t,file)
|
2005-09-13 13:06:07 +00:00
|
|
|
|
2006-12-12 20:08:08 +00:00
|
|
|
allow getty_t getty_tmp_t:file manage_file_perms;
|
|
|
|
allow getty_t getty_tmp_t:dir manage_dir_perms;
|
2006-02-21 18:40:44 +00:00
|
|
|
files_tmp_filetrans(getty_t,getty_tmp_t,{ file dir })
|
2005-05-31 19:52:57 +00:00
|
|
|
|
2006-12-12 20:08:08 +00:00
|
|
|
manage_files_pattern(getty_t,getty_var_run_t,getty_var_run_t)
|
2006-03-02 23:41:11 +00:00
|
|
|
files_pid_filetrans(getty_t,getty_var_run_t,file)
|
2005-04-19 20:42:32 +00:00
|
|
|
|
2005-10-26 16:00:13 +00:00
|
|
|
kernel_list_proc(getty_t)
|
|
|
|
kernel_read_proc_symlinks(getty_t)
|
|
|
|
|
2005-06-14 19:56:46 +00:00
|
|
|
dev_read_sysfs(getty_t)
|
2005-04-19 20:42:32 +00:00
|
|
|
|
2005-10-26 16:00:13 +00:00
|
|
|
fs_search_auto_mountpoints(getty_t)
|
2005-04-28 15:46:23 +00:00
|
|
|
# for error condition handling
|
2005-06-10 01:01:13 +00:00
|
|
|
fs_getattr_xattr_fs(getty_t)
|
2005-04-19 20:42:32 +00:00
|
|
|
|
2006-03-29 16:23:17 +00:00
|
|
|
mcs_process_set_categories(getty_t)
|
|
|
|
|
2007-08-20 18:26:08 +00:00
|
|
|
mls_file_read_all_levels(getty_t)
|
|
|
|
mls_file_write_all_levels(getty_t)
|
2006-01-06 22:51:40 +00:00
|
|
|
|
2005-04-28 15:46:23 +00:00
|
|
|
# Chown, chmod, read and write ttys.
|
2005-06-10 01:01:13 +00:00
|
|
|
term_use_all_user_ttys(getty_t)
|
2006-02-02 21:08:12 +00:00
|
|
|
term_use_unallocated_ttys(getty_t)
|
2005-06-10 01:01:13 +00:00
|
|
|
term_setattr_all_user_ttys(getty_t)
|
|
|
|
term_setattr_unallocated_ttys(getty_t)
|
|
|
|
term_setattr_console(getty_t)
|
2005-10-26 16:00:13 +00:00
|
|
|
term_dontaudit_use_console(getty_t)
|
2005-04-19 20:42:32 +00:00
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
auth_rw_login_records(getty_t)
|
2005-05-31 23:02:11 +00:00
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
corecmd_search_bin(getty_t)
|
2007-02-16 23:01:42 +00:00
|
|
|
corecmd_read_bin_symlinks(getty_t)
|
2005-04-19 20:42:32 +00:00
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
files_rw_generic_pids(getty_t)
|
|
|
|
files_read_etc_runtime_files(getty_t)
|
2005-06-29 14:26:41 +00:00
|
|
|
files_read_etc_files(getty_t)
|
2006-07-28 15:13:58 +00:00
|
|
|
files_search_spool(getty_t)
|
2005-04-19 20:42:32 +00:00
|
|
|
|
2006-01-18 18:08:39 +00:00
|
|
|
init_rw_utmp(getty_t)
|
2006-02-02 21:08:12 +00:00
|
|
|
init_use_script_ptys(getty_t)
|
|
|
|
init_dontaudit_use_script_ptys(getty_t)
|
2005-04-19 20:42:32 +00:00
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
locallogin_domtrans(getty_t)
|
2005-04-19 20:42:32 +00:00
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
logging_send_syslog_msg(getty_t)
|
2005-04-19 20:42:32 +00:00
|
|
|
|
2005-04-28 15:46:23 +00:00
|
|
|
miscfiles_read_localization(getty_t)
|
2005-09-13 13:06:07 +00:00
|
|
|
|
2006-09-19 17:02:29 +00:00
|
|
|
ifdef(`distro_gentoo',`
|
|
|
|
# Gentoo default /etc/issue makes agetty
|
|
|
|
# do a DNS lookup for the hostname
|
2008-03-14 14:55:34 +00:00
|
|
|
sysnet_dns_name_resolve(getty_t)
|
2006-09-19 17:02:29 +00:00
|
|
|
')
|
|
|
|
|
2008-02-18 18:44:40 +00:00
|
|
|
ifdef(`distro_redhat',`
|
|
|
|
# getty requires sys_admin #209426
|
|
|
|
allow getty_t self:capability sys_admin;
|
|
|
|
')
|
|
|
|
|
2008-02-05 18:24:43 +00:00
|
|
|
ifdef(`distro_ubuntu',`
|
|
|
|
optional_policy(`
|
|
|
|
unconfined_domain(getty_t)
|
|
|
|
')
|
|
|
|
')
|
|
|
|
|
2006-04-12 15:04:28 +00:00
|
|
|
optional_policy(`
|
|
|
|
mta_send_mail(getty_t)
|
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2006-02-02 21:08:12 +00:00
|
|
|
nscd_socket_use(getty_t)
|
2005-10-24 14:15:29 +00:00
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2005-10-21 21:35:25 +00:00
|
|
|
ppp_domtrans(getty_t)
|
2005-09-13 13:06:07 +00:00
|
|
|
')
|
2005-10-26 16:00:13 +00:00
|
|
|
|
2007-02-16 23:01:42 +00:00
|
|
|
optional_policy(`
|
|
|
|
rhgb_dontaudit_use_ptys(getty_t)
|
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2005-11-08 22:00:30 +00:00
|
|
|
udev_read_db(getty_t)
|
2005-10-26 16:00:13 +00:00
|
|
|
')
|