2005-04-29 17:45:15 +00:00
|
|
|
#DESC Getty - Manage ttys
|
|
|
|
#
|
|
|
|
# Authors: Stephen Smalley <sds@epoch.ncsc.mil> and Timothy Fraser
|
|
|
|
# X-Debian-Packages: util-linux fbgetty mingetty mgetty rungetty
|
|
|
|
#
|
|
|
|
|
|
|
|
#################################
|
|
|
|
#
|
|
|
|
# Rules for the getty_t domain.
|
|
|
|
#
|
|
|
|
init_service_domain(getty, `, privfd')
|
|
|
|
|
|
|
|
etcdir_domain(getty)
|
|
|
|
|
|
|
|
allow getty_t console_device_t:chr_file setattr;
|
|
|
|
|
|
|
|
tmp_domain(getty)
|
|
|
|
log_domain(getty)
|
|
|
|
|
|
|
|
allow getty_t { etc_t etc_runtime_t }:file { getattr read };
|
|
|
|
allow getty_t etc_t:lnk_file read;
|
|
|
|
allow getty_t self:process { getpgid getsession };
|
|
|
|
allow getty_t self:unix_dgram_socket create_socket_perms;
|
|
|
|
allow getty_t self:unix_stream_socket create_socket_perms;
|
|
|
|
|
|
|
|
# Use capabilities.
|
|
|
|
allow getty_t self:capability { dac_override chown sys_resource sys_tty_config };
|
|
|
|
|
|
|
|
read_locale(getty_t)
|
|
|
|
|
|
|
|
# Run login in local_login_t domain.
|
2005-09-13 13:06:07 +00:00
|
|
|
allow getty_t { sbin_t bin_t }:dir search;
|
2005-04-29 17:45:15 +00:00
|
|
|
domain_auto_trans(getty_t, login_exec_t, local_login_t)
|
|
|
|
|
|
|
|
# Write to /var/run/utmp.
|
|
|
|
allow getty_t { var_t var_run_t }:dir search;
|
|
|
|
allow getty_t initrc_var_run_t:file rw_file_perms;
|
|
|
|
|
|
|
|
# Write to /var/log/wtmp.
|
|
|
|
allow getty_t wtmp_t:file rw_file_perms;
|
|
|
|
|
|
|
|
# Chown, chmod, read and write ttys.
|
|
|
|
allow getty_t tty_device_t:chr_file { setattr rw_file_perms };
|
|
|
|
allow getty_t ttyfile:chr_file { setattr rw_file_perms };
|
2005-09-15 15:34:31 +00:00
|
|
|
dontaudit getty_t initrc_devpts_t:chr_file rw_file_perms;
|
2005-04-29 17:45:15 +00:00
|
|
|
|
|
|
|
# for error condition handling
|
|
|
|
allow getty_t fs_t:filesystem getattr;
|
|
|
|
|
2005-09-13 13:06:07 +00:00
|
|
|
lock_domain(getty)
|
2005-04-29 17:45:15 +00:00
|
|
|
r_dir_file(getty_t, sysfs_t)
|
2005-09-13 13:06:07 +00:00
|
|
|
# for mgetty
|
|
|
|
var_run_domain(getty)
|
|
|
|
allow getty_t self:capability { fowner fsetid };
|
|
|
|
|
|
|
|
#
|
|
|
|
# getty needs to be able to run pppd
|
|
|
|
#
|
|
|
|
ifdef(`pppd.te', `
|
|
|
|
domain_auto_trans(getty_t, pppd_exec_t, pppd_t)
|
|
|
|
')
|