Chris PeBenito e181fe
# Copyright (C) 2005 Tresys Technology, LLC
Chris PeBenito e181fe
Chris PeBenito b470e3
type getty_t; #, privfd
Chris PeBenito b470e3
domain_make_domain(getty_t)
Chris PeBenito b470e3
Chris PeBenito b470e3
type getty_exec_t;
Chris PeBenito b470e3
domain_make_entrypoint_file(getty_t,getty_exec_t)
Chris PeBenito b470e3
Chris PeBenito b470e3
type getty_etc_t;
Chris PeBenito b470e3
typealias getty_etc_t alias etc_getty_t;
Chris PeBenito b470e3
Chris PeBenito b470e3
type getty_tmp_t;
Chris PeBenito b470e3
files_make_file(getty_tmp_t)
Chris PeBenito b470e3
Chris PeBenito b470e3
type getty_log_t;
Chris PeBenito b470e3
logging_make_log_file(getty_log_t)
Chris PeBenito b470e3
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 b470e3
allow getty_t self:capability { dac_override chown sys_resource sys_tty_config };
Chris PeBenito b470e3
# fbgetty needs fsetid for some reason
Chris PeBenito b470e3
#allow getty_t self:capability fsetid;
Chris PeBenito b470e3
Chris PeBenito b470e3
allow getty_t self:process { getpgid getsession };
Chris PeBenito b470e3
Chris PeBenito b470e3
allow getty_t getty_etc_t:dir { getattr search read };
Chris PeBenito b470e3
allow getty_t getty_etc_t:file { getattr read };
Chris PeBenito b470e3
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 b470e3
allow getty_t getty_log_t:file { getattr append setattr };
Chris PeBenito b470e3
Chris PeBenito b470e3
kernel_read_hardware_state(getty_t)
Chris PeBenito b470e3
Chris PeBenito b470e3
files_create_private_config(getty_t,getty_etc_t,{ file dir })
Chris PeBenito b470e3
files_create_private_tmp_data(getty_t,getty_tmp_t,{ file dir })
Chris PeBenito b470e3
Chris PeBenito b470e3
authlogin_modify_login_records(getty_t)
Chris PeBenito b470e3
logging_send_system_log_message(getty_t)
Chris PeBenito b470e3
Chris PeBenito b470e3
# Write to /var/run/utmp.
Chris PeBenito b470e3
files_modify_system_runtime_data(getty_t)
Chris PeBenito b470e3
Chris PeBenito 033c80
files_manage_system_lock_files(getty_t)
Chris PeBenito b470e3
files_read_runtime_system_config(getty_t)
Chris PeBenito b470e3
files_read_general_system_config(getty_t)
Chris PeBenito b470e3
miscfiles_read_localization(getty_t)
Chris PeBenito b470e3
Chris PeBenito b470e3
# for error condition handling
Chris PeBenito 8a0da1
filesystem_read_persistent_filesystem_attributes(getty_t)
Chris PeBenito b470e3
Chris PeBenito b470e3
# Chown, chmod, read and write ttys.
Chris PeBenito b470e3
terminal_use_all_terminals(getty_t)
Chris PeBenito b470e3
Chris PeBenito b470e3
##############
Chris PeBenito b470e3
# TODO Items
Chris PeBenito b470e3
Chris PeBenito b470e3
# TODO:May need to create a new interface for setting device node attributes
Chris PeBenito b470e3
#allow getty_t console_device_t:chr_file setattr;
Chris PeBenito b470e3
Chris PeBenito b470e3
# TODO: to allow w to display everyone...
Chris PeBenito b470e3
#bool user_ttyfile_stat false;
Chris PeBenito b470e3
#if (user_ttyfile_stat) {
Chris PeBenito b470e3
#allow userdomain ttyfile:chr_file getattr;
Chris PeBenito b470e3
#}
Chris PeBenito b470e3
Chris PeBenito b470e3
# TODO: Run login in local_login_t domain. 
Chris PeBenito b470e3
#allow getty_t bin_t:dir search;
Chris PeBenito b470e3
#domain_auto_trans(getty_t, login_exec_t, local_login_t)
Chris PeBenito b470e3
Chris PeBenito b470e3
# TODO: There is no interface for this in init.if yet.
Chris PeBenito b470e3
#allow getty_t initrc_devpts_t:chr_file { read write };
Chris PeBenito b470e3
Chris PeBenito b470e3
# TODO: This needs to go into the init module. Allow init module to transition into getty domain.
Chris PeBenito b470e3
#getty_transition(init_t)