policy_module(fakehwclock, 1.3.0)

########################################
#
# Declarations
#

attribute_role fakehwclock_roles;

type fakehwclock_t;
type fakehwclock_exec_t;
init_system_domain(fakehwclock_t, fakehwclock_exec_t)
role fakehwclock_roles types fakehwclock_t;

type fakehwclock_backup_t;
files_type(fakehwclock_backup_t)

type fakehwclock_initrc_exec_t;
init_script_file(fakehwclock_initrc_exec_t)

type fakehwclock_unit_t;
init_unit_file(fakehwclock_unit_t)

########################################
#
# policy
#

# sys_time : set system time
allow fakehwclock_t self:capability sys_time;
allow fakehwclock_t self:fifo_file rw_fifo_file_perms;

allow fakehwclock_t fakehwclock_backup_t:file manage_file_perms;

corecmd_exec_bin(fakehwclock_t)
corecmd_exec_shell(fakehwclock_t)

miscfiles_read_localization(fakehwclock_t)

optional_policy(`
        cron_system_entry(fakehwclock_t, fakehwclock_exec_t)
')
