Chris PeBenito 2274f9
Chris PeBenito 2274f9
policy_module(clock,1.0)
Chris PeBenito 2274f9
Chris PeBenito 2274f9
########################################
Chris PeBenito 2274f9
#
Chris PeBenito 2274f9
# Declarations
Chris PeBenito 2274f9
#
Chris PeBenito 2274f9
Chris PeBenito 2274f9
type adjtime_t;
Chris PeBenito 2274f9
files_make_file(adjtime_t)
Chris PeBenito 2274f9
Chris PeBenito 2274f9
type hwclock_t;
Chris PeBenito 2274f9
type hwclock_exec_t;
Chris PeBenito ff3138
init_make_system_domain(hwclock_t,hwclock_exec_t)
Chris PeBenito 2274f9
role system_r types hwclock_t;
Chris PeBenito 2274f9
Chris PeBenito 2274f9
########################################
Chris PeBenito 2274f9
#
Chris PeBenito 2274f9
# Local policy
Chris PeBenito 2274f9
#
Chris PeBenito 2274f9
Chris PeBenito dd8229
allow hwclock_t self:process signal_perms;
Chris PeBenito 2274f9
Chris PeBenito 2274f9
# Give hwclock the capabilities it requires.  dac_override is a surprise,
Chris PeBenito 2274f9
# but hwclock does require it.
Chris PeBenito 2274f9
allow hwclock_t self:capability { dac_override sys_rawio sys_time sys_tty_config };
Chris PeBenito 2274f9
dontaudit hwclock_t self:capability sys_tty_config;
Chris PeBenito 2274f9
Chris PeBenito 2274f9
# Allow hwclock to store & retrieve correction factors.
Chris PeBenito 2274f9
allow hwclock_t adjtime_t:file { setattr ioctl read getattr lock write append };
Chris PeBenito 2274f9
Chris PeBenito 2274f9
kernel_read_kernel_sysctl(hwclock_t)
Chris PeBenito 2274f9
kernel_read_hardware_state(hwclock_t)
Chris PeBenito 2274f9
Chris PeBenito 2274f9
devices_modify_realtime_clock(hwclock_t)
Chris PeBenito 2274f9
Chris PeBenito 0fd9dc
fs_getattr_xattr_fs(hwclock_t)
Chris PeBenito 2274f9
Chris PeBenito 0fd9dc
term_dontaudit_use_console(hwclock_t)
Chris PeBenito 0fd9dc
term_use_unallocated_tty(hwclock_t)
Chris PeBenito 0fd9dc
term_use_all_user_ttys(hwclock_t)
Chris PeBenito 0fd9dc
term_use_all_user_ptys(hwclock_t)
Chris PeBenito 2274f9
Chris PeBenito 2274f9
init_use_file_descriptors(hwclock_t)
Chris PeBenito 2274f9
init_script_use_pseudoterminal(hwclock_t)
Chris PeBenito 2274f9
Chris PeBenito 2274f9
domain_use_widely_inheritable_file_descriptors(hwclock_t)
Chris PeBenito 2274f9
Chris PeBenito d490eb
files_read_general_system_config_directory(hwclock_t)
Chris PeBenito 3b857e
# for when /usr is not mounted:
Chris PeBenito 3b857e
files_ignore_search_isid_type_dir(hwclock_t)
Chris PeBenito d490eb
Chris PeBenito 2274f9
libraries_use_dynamic_loader(hwclock_t)
Chris PeBenito dd14d0
libraries_use_shared_libraries(hwclock_t)
Chris PeBenito 2274f9
Chris PeBenito 2274f9
logging_send_system_log_message(hwclock_t)
Chris PeBenito 2274f9
Chris PeBenito 2274f9
miscfiles_read_localization(hwclock_t)
Chris PeBenito 2274f9
Chris PeBenito 254bbc
ifdef(`targeted_policy', `
Chris PeBenito 0fd9dc
	term_dontaudit_use_unallocated_tty(hwclock_t)
Chris PeBenito 0c73cd
	terminal_ignore_use_general_pseudoterminal(hwclock_t)
Chris PeBenito 0c73cd
	files_ignore_read_rootfs_file(hwclock_t)
Chris PeBenito 2274f9
')
Chris PeBenito 2274f9
Chris PeBenito 2274f9
optional_policy(`selinux.te',`
Chris PeBenito 0c73cd
	selinux_newrole_sigchld(hwclock_t)
Chris PeBenito 2274f9
')
Chris PeBenito 2274f9
Chris PeBenito 2274f9
optional_policy(`udev.te', `
Chris PeBenito 0c73cd
	udev_read_database(hwclock_t)
Chris PeBenito 2274f9
')
Chris PeBenito 2274f9
Chris PeBenito daa0e0
optional_policy(`userdomain.te',`
Chris PeBenito 0c73cd
	userdomain_ignore_use_all_unprivileged_users_file_descriptors(hwclock_t)
Chris PeBenito daa0e0
')
Chris PeBenito daa0e0
Chris PeBenito 2274f9
ifdef(`TODO',`
Chris PeBenito 2274f9
Chris PeBenito 2274f9
allow hwclock_t proc_t:dir r_dir_perms;
Chris PeBenito 2274f9
allow hwclock_t proc_t:lnk_file read;
Chris PeBenito 2274f9
Chris PeBenito 2274f9
optional_policy(`rhgb.te', `
Chris PeBenito 2274f9
allow hwclock_t rhgb_t:process sigchld;
Chris PeBenito 2274f9
allow hwclock_t rhgb_t:fd use;
Chris PeBenito dd8229
allow hwclock_t rhgb_t:fifo_file rw_file_perms;
Chris PeBenito 2274f9
')
Chris PeBenito 2274f9
Chris PeBenito 2274f9
allow hwclock_t autofs_t:dir { search getattr };
Chris PeBenito 2274f9
Chris PeBenito 2274f9
optional_policy(`gnome-pty-helper.te', `allow hwclock_t sysadm_gph_t:fd use;')
Chris PeBenito 2274f9
Chris PeBenito 2274f9
optional_policy(`apmd.te', `
Chris PeBenito 2274f9
domain_auto_trans(apmd_t, hwclock_exec_t, hwclock_t)
Chris PeBenito 2274f9
')
Chris PeBenito 2274f9
Chris PeBenito 2274f9
') dnl end TODO