policy_module(fprintd)

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

type fprintd_t;
type fprintd_exec_t;
init_daemon_domain(fprintd_t, fprintd_exec_t)

type fprintd_var_lib_t;
files_type(fprintd_var_lib_t)

########################################
#
# Local policy
#

allow fprintd_t self:capability sys_nice;
allow fprintd_t self:process { getsched setsched sigkill signal };
allow fprintd_t self:fifo_file rw_fifo_file_perms;

manage_dirs_pattern(fprintd_t, fprintd_var_lib_t, fprintd_var_lib_t)
manage_files_pattern(fprintd_t, fprintd_var_lib_t, fprintd_var_lib_t)

kernel_read_system_state(fprintd_t)

dev_list_usbfs(fprintd_t)
dev_read_sysfs(fprintd_t)
dev_rw_generic_usb_dev(fprintd_t)

files_read_usr_files(fprintd_t)

fs_getattr_all_fs(fprintd_t)

auth_use_nsswitch(fprintd_t)

miscfiles_read_localization(fprintd_t)

userdom_use_user_ptys(fprintd_t)
userdom_read_all_users_state(fprintd_t)

optional_policy(`
	dbus_system_domain(fprintd_t, fprintd_exec_t)

	optional_policy(`
		policykit_dbus_chat(fprintd_t)
		policykit_dbus_chat_auth(fprintd_t)
	')
')

optional_policy(`
	policykit_domtrans_auth(fprintd_t)
	policykit_read_reload(fprintd_t)
	policykit_read_lib(fprintd_t)
')
