HEX
Server: Apache
System: Linux hp3-stn-1011028.hostingp3.local 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
User: csh958633 (951153)
PHP: 8.3.30
Disabled: shell_exec,exec,system,popen,set_time_limit
Upload Files
File: //usr/share/selinux/devel/include/system/authlogin.if
## <summary>Common policy for authentication and user login.</summary>

########################################
## <summary>
##	Role access for password authentication.
## </summary>
## <param name="role">
##	<summary>
##	Role allowed access.
##	</summary>
## </param>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
#
interface(`auth_role',`
	gen_require(`
		type chkpwd_t, chkpwd_exec_t, shadow_t;
	')

	role $1 types chkpwd_t;

	# Transition from the user domain to this domain.
	auth_domtrans_chkpwd($2)

	ps_process_pattern($2, chkpwd_t)

	dontaudit $2 shadow_t:file read_file_perms;

	logging_send_syslog_msg($2)
	logging_send_audit_msgs($2)

	usermanage_read_crack_db($2)

')

########################################
## <summary>
##	Use PAM for authentication.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
#
interface(`auth_use_pam',`

	# for SSP/ProPolice
	dev_read_urand($1)
	# for encrypted homedir
	dev_read_sysfs($1)

	auth_domtrans_chk_passwd($1)
	auth_domtrans_upd_passwd($1)
	auth_dontaudit_read_shadow($1)
	auth_read_login_records($1)
	auth_append_login_records($1)
	auth_rw_lastlog($1)
	auth_create_lastlog($1)
	auth_manage_faillog($1)
	auth_exec_pam($1)
	auth_use_nsswitch($1)

	init_rw_stream_sockets($1)

	logging_send_audit_msgs($1)
	logging_send_syslog_msg($1)

	userdom_search_user_tmp_dirs($1)

	optional_policy(`
		dbus_system_bus_client($1)

		optional_policy(`
			consolekit_dbus_chat($1)
		')

		optional_policy(`
			fprintd_dbus_chat($1)
		')
	')

	optional_policy(`
		kerberos_manage_host_rcache($1)
		kerberos_read_config($1)
	')

	optional_policy(`
		locallogin_getattr_home_content($1)
 	')

	optional_policy(`
		nis_authenticate($1)
	')

	optional_policy(`
		systemd_dbus_chat_logind($1)
		systemd_use_fds_logind($1)
		systemd_write_inherited_logind_sessions_pipes($1)
		systemd_read_logind_sessions_files($1)
	')
')

########################################
## <summary>
##	Make the specified domain used for a login program.
## </summary>
## <param name="domain">
##	<summary>
##	Domain type used for a login program domain.
##	</summary>
## </param>
#
interface(`auth_login_pgm_domain',`
	gen_require(`
		type var_auth_t, auth_cache_t;
		attribute polydomain;
		attribute login_pgm;
	')

	domain_type($1)
	typeattribute $1 polydomain;
	typeattribute $1 login_pgm;

	domain_subj_id_change_exemption($1)
	domain_role_change_exemption($1)
	domain_obj_id_change_exemption($1)
	role system_r types $1;

	selinux_get_fs_mount($1)

	mls_file_read_all_levels($1)
	mls_file_write_all_levels($1)
	mls_file_upgrade($1)
	mls_file_downgrade($1)
	mls_process_set_level($1)
    mls_process_write_to_clearance($1)
	mls_fd_share_all_levels($1)

	auth_use_pam($1)
')

########################################
## <summary>
##	Read authlogin state files.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
#
interface(`authlogin_read_state',`
	gen_require(`
		attribute polydomain;
	')

	kernel_search_proc($1)
	ps_process_pattern($1, polydomain)
')

########################################
## <summary>
##	Read and write a authlogin unnamed pipe.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
#
interface(`authlogin_rw_pipes',`
	gen_require(`
		attribute polydomain;
	')

	allow $1 polydomain:fifo_file rw_inherited_fifo_file_perms;
')

########################################
## <summary>
##	Use the login program as an entry point program.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
#
interface(`auth_login_entry_type',`
	gen_require(`
		type login_exec_t;
	')

	domain_entry_file($1, login_exec_t)
')

########################################
## <summary>
##	Make the specified type usable as a
##	login file.
## </summary>
## <desc>
##	<p>
##	Make the specified type usable as a login file,
##	This type has restricted modification capabilities when used with
##	other interfaces that permit files_type access.
##	The default type has properties similar to that of the shadow file.
##	This will also make the type usable as a security file, making
##	calls to files_security_file() redundant.
##	</p>
## </desc>
## <param name="type">
##	<summary>
##	Type to be used as a login file.
##	</summary>
## </param>
## <infoflow type="none"/>
#
interface(`auth_file',`
	refpolicywarn(`$0($*) has been deprecated, use files_auth_file() instead.')
	files_auth_file($1)
')

########################################
## <summary>
##	Execute a login_program in the target domain.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed to transition.
##	</summary>
## </param>
## <param name="target_domain">
##	<summary>
##	The type of the login_program process.
##	</summary>
## </param>
#
interface(`auth_domtrans_login_program',`
	gen_require(`
		type login_exec_t;
	')

	corecmd_search_bin($1)
	domtrans_pattern($1, login_exec_t, $2)
    allow $1 login_exec_t:file map;
')

########################################
## <summary>
##	Execute a login_program in the caller domain.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed to transition.
##	</summary>
## </param>
#
interface(`auth_exec_login_program',`
	gen_require(`
		type login_exec_t;
	')

	corecmd_search_bin($1)
	can_exec($1, login_exec_t)
')

########################################
## <summary>
##	Execute a login_program in the target domain,
##	with a range transition.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed to transition.
##	</summary>
## </param>
## <param name="target_domain">
##	<summary>
##	The type of the login_program process.
##	</summary>
## </param>
## <param name="range">
##	<summary>
##	Range of the login program.
##	</summary>
## </param>
#
interface(`auth_ranged_domtrans_login_program',`
	gen_require(`
		type login_exec_t;
	')

	auth_domtrans_login_program($1, $2)

	ifdef(`enable_mcs',`
		range_transition $1 login_exec_t:process $3;
	')

	ifdef(`enable_mls',`
		range_transition $1 login_exec_t:process $3;
	')
')

########################################
## <summary>
##	Search authentication cache
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
#
interface(`auth_search_cache',`
	gen_require(`
		type auth_cache_t;
	')

	allow $1 auth_cache_t:dir search_dir_perms;
')

########################################
## <summary>
##	Read authentication cache
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
#
interface(`auth_read_cache',`
	gen_require(`
		type auth_cache_t;
	')

	read_files_pattern($1, auth_cache_t, auth_cache_t)
')

########################################
## <summary>
##	Read/Write authentication cache
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
#
interface(`auth_rw_cache',`
	gen_require(`
		type auth_cache_t;
	')

	rw_files_pattern($1, auth_cache_t, auth_cache_t)
')

########################################
## <summary>
##	Create authentication cache
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
#
interface(`auth_create_cache',`
	gen_require(`
		type auth_cache_t;
	')

	create_files_pattern($1, auth_cache_t, auth_cache_t)
')

########################################
## <summary>
##	Manage authentication cache
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
#
interface(`auth_manage_cache',`
	gen_require(`
		type auth_cache_t;
	')

	manage_dirs_pattern($1, auth_cache_t, auth_cache_t)
	manage_files_pattern($1, auth_cache_t, auth_cache_t)
    allow $1 auth_cache_t:file map;
')

#######################################
## <summary>
##	Automatic transition from cache_t to cache.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
#
interface(`auth_var_filetrans_cache',`
	gen_require(`
		type auth_cache_t;
	')

	files_var_filetrans($1, auth_cache_t, { file dir } )
')

########################################
## <summary>
##	Run unix_chkpwd to check a password.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed to transition.
##	</summary>
## </param>
#
interface(`auth_domtrans_chk_passwd',`
	gen_require(`
		type chkpwd_t, chkpwd_exec_t, shadow_t;
		type auth_cache_t;
	')

	allow $1 auth_cache_t:dir search_dir_perms;

	corecmd_search_bin($1)
	domtrans_pattern($1, chkpwd_exec_t, chkpwd_t)
    allow $1 chkpwd_exec_t:file map;

	dontaudit $1 shadow_t:file read_file_perms;

	dev_read_rand($1)
	dev_read_urand($1)

	auth_use_nsswitch($1)
	auth_rw_faillog($1)

	logging_send_audit_msgs($1)

	miscfiles_read_generic_certs($1)

	optional_policy(`
		kerberos_read_keytab($1)
	')

	optional_policy(`
		pcscd_read_pid_files($1)
		pcscd_stream_connect($1)
	')

	optional_policy(`
		samba_stream_connect_winbind($1)
	')

	auth_domtrans_upd_passwd($1)
')

########################################
## <summary>
##	Run unix_chkpwd to check a password.
## 	Stripped down version to be called within boolean
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed to transition.
##	</summary>
## </param>
#
interface(`auth_domtrans_chkpwd',`
	gen_require(`
		type chkpwd_t, chkpwd_exec_t, shadow_t;
	')

	corecmd_search_bin($1)
	domtrans_pattern($1, chkpwd_exec_t, chkpwd_t)
	dontaudit $1 shadow_t:file { getattr read };
	auth_domtrans_upd_passwd($1)
')

########################################
## <summary>
##  Execute chkpwd in the caller domain.
## </summary>
## <param name="domain">
##  <summary>
##  Domain allowed to transition.
##  </summary>
##  </param>
#
interface(`auth_exec_chkpwd',`
    gen_require(`
        type chkpwd_exec_t;
    ')

    allow $1 chkpwd_exec_t:file execute;
')

########################################
## <summary>
##	Execute chkpwd programs in the chkpwd domain.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed to transition.
##	</summary>
## </param>
## <param name="role">
##	<summary>
##	The role to allow the chkpwd domain.
##	</summary>
## </param>
#
interface(`auth_run_chk_passwd',`
	gen_require(`
		type chkpwd_t;
	')

	auth_domtrans_chk_passwd($1)
	role $2 types chkpwd_t;
	auth_run_upd_passwd($1, $2)
')

########################################
## <summary>
##	Send generic signals to chkpwd processes.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
#
interface(`auth_signal_chk_passwd',`
	gen_require(`
		type chkpwd_t;
	')

	allow $1 chkpwd_t:process signal;
')

########################################
## <summary>
##	Execute a domain transition to run unix_update.
## </summary>
## <param name="domain">
## <summary>
##	Domain allowed to transition.
## </summary>
## </param>
#
interface(`auth_domtrans_upd_passwd',`
	gen_require(`
		type updpwd_t, updpwd_exec_t;
	')

	domtrans_pattern($1, updpwd_exec_t, updpwd_t)
	auth_dontaudit_read_shadow($1)
')

########################################
## <summary>
##	Execute updpwd programs in the updpwd domain.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed to transition.
##	</summary>
## </param>
## <param name="role">
##	<summary>
##	The role to allow the updpwd domain.
##	</summary>
## </param>
#
interface(`auth_run_upd_passwd',`
	gen_require(`
		type updpwd_t;
	')

	auth_domtrans_upd_passwd($1)
	role $2 types updpwd_t;
')

########################################
## <summary>
##	Get the attributes of the shadow passwords file.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
#
interface(`auth_getattr_shadow',`
	gen_require(`
		type shadow_t;
	')

	files_search_etc($1)
	allow $1 shadow_t:file getattr;
')

########################################
## <summary>
##	Do not audit attempts to get the attributes
##	of the shadow passwords file.
## </summary>
## <param name="domain">
##	<summary>
##	Domain to not audit.
##	</summary>
## </param>
#
interface(`auth_dontaudit_getattr_shadow',`
	gen_require(`
		type shadow_t;
	')

	dontaudit $1 shadow_t:file getattr;
')

########################################
## <summary>
## Mmap the shadow passwords file.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
#
interface(`auth_map_shadow',`
	gen_require(`
		type shadow_t;
	')

	allow $1 shadow_t:file map;
')

########################################
## <summary>
##	Read the shadow passwords file (/etc/shadow)
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
#
# cjp: these next three interfaces are split
# since typeattribute does not work in conditionals
# yet, otherwise they should be one interface.
#
interface(`auth_read_shadow',`
	auth_can_read_shadow_passwords($1)
	auth_tunable_read_shadow($1)
')

########################################
## <summary>
##	Pass shadow assertion for reading.
## </summary>
## <desc>
##	<p>
##	Pass shadow assertion for reading.
##	This should only be used with
##	auth_tunable_read_shadow(), and
##	only exists because typeattribute
##	does not work in conditionals.
##	</p>
## </desc>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
#
interface(`auth_can_read_shadow_passwords',`
	gen_require(`
		attribute can_read_shadow_passwords;
	')

	typeattribute $1 can_read_shadow_passwords;
')

########################################
## <summary>
##	Read the shadow password file.
## </summary>
## <desc>
##	<p>
##	Read the shadow password file.  This
##	should only be used in a conditional;
##	it does not pass the reading shadow
##	assertion.
##	</p>
## </desc>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
#
interface(`auth_tunable_read_shadow',`
	gen_require(`
		type shadow_t;
	')

	files_list_etc($1)
	allow $1 shadow_t:file read_file_perms;
')

########################################
## <summary>
##	Do not audit attempts to read the shadow
##	password file (/etc/shadow).
## </summary>
## <param name="domain">
##	<summary>
##	Domain to not audit.
##	</summary>
## </param>
#
interface(`auth_dontaudit_read_shadow',`
	gen_require(`
		type shadow_t;
	')

	dontaudit $1 shadow_t:file read_file_perms;
')

########################################
## <summary>
##	Read and write the shadow password file (/etc/shadow).
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
#
interface(`auth_rw_shadow',`
	gen_require(`
		attribute can_read_shadow_passwords, can_write_shadow_passwords;
		type shadow_t;
	')

	files_list_etc($1)
	allow $1 shadow_t:file rw_file_perms;
	typeattribute $1 can_read_shadow_passwords, can_write_shadow_passwords;
')

########################################
## <summary>
##	Create, read, write, and delete the shadow
##	password file.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
#
interface(`auth_manage_shadow',`
	gen_require(`
		attribute can_read_shadow_passwords, can_write_shadow_passwords;
		type shadow_t;
	')

	allow $1 shadow_t:file manage_file_perms;
	typeattribute $1 can_read_shadow_passwords, can_write_shadow_passwords;
	files_var_filetrans($1, shadow_t, file, "shadow")
	files_var_filetrans($1, shadow_t, file, "shadow-")
	files_etc_filetrans($1, shadow_t, file, "gshadow")
	files_etc_filetrans($1, shadow_t, file, "nshadow")
	files_etc_filetrans($1, shadow_t, file, "opasswd")
')

#######################################
## <summary>
##	Automatic transition from etc to shadow.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
#
interface(`auth_etc_filetrans_shadow',`
	gen_require(`
		type shadow_t;
	')

	files_etc_filetrans($1, shadow_t, file)
')

#######################################
## <summary>
##	Relabel to the shadow
##	password file type.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
#
interface(`auth_relabelto_shadow',`
	gen_require(`
		attribute can_relabelto_shadow_passwords;
		type shadow_t;
	')

	files_search_etc($1)
	allow $1 shadow_t:file relabelto;
	typeattribute $1 can_relabelto_shadow_passwords;
')

#######################################
## <summary>
##	Relabel from and to the shadow
##	password file type.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
#
interface(`auth_relabel_shadow',`
	gen_require(`
		attribute can_relabelto_shadow_passwords;
		type shadow_t;
	')

	files_search_etc($1)
	allow $1 shadow_t:file relabel_file_perms;
	typeattribute $1 can_relabelto_shadow_passwords;
')

#######################################
## <summary>
##	Append to the login failure log.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
#
interface(`auth_append_faillog',`
	gen_require(`
		type faillog_t;
	')

	logging_search_logs($1)
	allow $1 faillog_t:file append_file_perms;
')

########################################
## <summary>
##	Read and write the login failure log.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
#
interface(`auth_rw_faillog',`
	gen_require(`
		type faillog_t;
	')

	logging_search_logs($1)
	rw_files_pattern($1, faillog_t, faillog_t)
')

########################################
## <summary>
##	Relabel the login failure log.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
#
interface(`auth_relabel_faillog',`
	gen_require(`
		type faillog_t;
	')

	allow $1 faillog_t:dir relabel_dir_perms;
	allow $1 faillog_t:file relabel_file_perms;
')

########################################
## <summary>
##	Manage the login failure log.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
#
interface(`auth_manage_faillog',`
	gen_require(`
		type faillog_t;
	')

	logging_search_logs($1)
	files_search_pids($1)
	allow $1 faillog_t:dir manage_dir_perms;
	allow $1 faillog_t:file manage_file_perms;
	logging_log_named_filetrans($1, faillog_t, file, "tallylog")
	logging_log_named_filetrans($1, faillog_t, file, "faillog")
	logging_log_named_filetrans($1, faillog_t, file, "btmp")
')

#######################################
## <summary>
##	Read the last logins log.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
## <rolecap/>
#
interface(`auth_read_lastlog',`
	gen_require(`
		type lastlog_t;
	')

	logging_search_logs($1)
	allow $1 lastlog_t:file read_file_perms;
')

#######################################
## <summary>
##	Append only to the last logins log.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
#
interface(`auth_append_lastlog',`
	gen_require(`
		type lastlog_t;
	')

	logging_search_logs($1)
	allow $1 lastlog_t:file { append_file_perms lock };
')

#######################################
## <summary>
##	Read and write to the last logins log.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
#
interface(`auth_rw_lastlog',`
	gen_require(`
		type lastlog_t;
	')

	logging_search_logs($1)
	allow $1 lastlog_t:file { rw_file_perms lock setattr };
')

#######################################
## <summary>
##	Manage create logins log.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
#
interface(`auth_create_lastlog',`
	gen_require(`
		type lastlog_t;
	')

	logging_search_logs($1)
	allow $1 lastlog_t:file create;
	logging_log_named_filetrans($1, lastlog_t, file, "lastlog")
')

########################################
## <summary>
##	Execute pam timestamp programs in the pam timestamp domain.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed to transition.
##	</summary>
## </param>
#
interface(`auth_domtrans_pam_timestamp',`
	gen_require(`
		type pam_timestamp_t, pam_timestamp_exec_t;
	')

	domtrans_pattern($1, pam_timestamp_exec_t, pam_timestamp_t)
')

########################################
## <summary>
##	Execute pam timestamp programs in the pam timestamp domain.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed to transition.
##	</summary>
## </param>
#
interface(`auth_domtrans_pam',`
	auth_domtrans_pam_timestamp($1)
	refpolicywarn(`$0() has been deprecated, please use auth_domtrans_pam_timestamp() instead.')
')

########################################
## <summary>
##	Send generic signals to pam processes.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
#
interface(`auth_signal_pam',`
	gen_require(`
		type pam_timestamp_t;
	')

	allow $1 pam_timestamp_t:process signal;
')

########################################
## <summary>
##	Execute pam_timestamp programs in the PAM timestamp domain.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed to transition.
##	</summary>
## </param>
## <param name="role">
##	<summary>
##	The role to allow the PAM domain.
##	</summary>
## </param>
#
interface(`auth_run_pam_timestamp',`
	gen_require(`
		type pam_timestamp_t;
	')

	auth_domtrans_pam_timestamp($1)
	role $2 types pam_timestamp_t;
')

########################################
## <summary>
##	Execute pam_timestamp programs in the PAM timestamp domain.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed to transition.
##	</summary>
## </param>
## <param name="role">
##	<summary>
##	The role to allow the PAM domain.
##	</summary>
## </param>
#
interface(`auth_run_pam',`
	auth_run_pam_timestamp($1, $2)
	refpolicywarn(`$0() has been deprecated, please use auth_run_pam_timestamp.')
')

########################################
## <summary>
##	Execute the pam program.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
#
interface(`auth_exec_pam',`
	gen_require(`
		type pam_exec_t;
	')

	can_exec($1, pam_exec_t)
')

########################################
## <summary>
##	Read var auth files. Used by various other applications
##	and pam applets etc.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
#
interface(`auth_read_var_auth',`
	gen_require(`
		type var_auth_t;
	')

	files_search_var($1)
	read_files_pattern($1, var_auth_t, var_auth_t)
')

#######################################
## <summary>
##  Read and write var auth files. Used by various other applications
##  and pam applets etc.
## </summary>
## <param name="domain">
##  <summary>
##  Domain allowed access.
##  </summary>
## </param>
#
interface(`auth_rw_var_auth',`
    gen_require(`
		type var_auth_t;
    ')

    files_search_var($1)
    rw_files_pattern($1, var_auth_t, var_auth_t)
')

########################################
## <summary>
##	Manage var auth files. Used by various other applications
##	and pam applets etc.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
#
interface(`auth_manage_var_auth',`
	gen_require(`
		type var_auth_t;
	')

	files_search_var($1)

	manage_dirs_pattern($1, var_auth_t, var_auth_t)
	manage_files_pattern($1, var_auth_t, var_auth_t)
	manage_lnk_files_pattern($1, var_auth_t, var_auth_t)
')

########################################
## <summary>
##	Relabel all var auth files. Used by various other applications
##	and pam applets etc.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
#
interface(`auth_relabel_var_auth_dirs',`
	gen_require(`
		type var_auth_t;
	')

	files_search_var($1)
	relabel_dirs_pattern($1, var_auth_t, var_auth_t)
')

########################################
## <summary>
##	Read PAM PID files.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
#
interface(`auth_read_pam_pid',`
	gen_require(`
		type pam_var_run_t;
	')

	files_search_pids($1)
	allow $1 pam_var_run_t:dir list_dir_perms;
	allow $1 pam_var_run_t:file read_file_perms;
')

#######################################
## <summary>
##	Do not audit attemps to read PAM PID files.
## </summary>
## <param name="domain">
##	<summary>
##	Domain to not audit.
##	</summary>
## </param>
#
interface(`auth_dontaudit_read_pam_pid',`
	gen_require(`
		type pam_var_run_t;
	')

	dontaudit $1 pam_var_run_t:file { getattr read };
')

########################################
## <summary>
##	Delete pam PID files.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
#
interface(`auth_delete_pam_pid',`
	gen_require(`
		type pam_var_run_t;
	')

	files_search_pids($1)
	allow $1 pam_var_run_t:dir del_entry_dir_perms;
	allow $1 pam_var_run_t:file delete_file_perms;
')

########################################
## <summary>
##	Manage pam PID files.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
#
interface(`auth_manage_pam_pid',`
	gen_require(`
		type pam_var_run_t;
	')

	files_search_pids($1)
	allow $1 pam_var_run_t:dir manage_dir_perms;
	allow $1 pam_var_run_t:file manage_file_perms;
	files_pid_filetrans($1, pam_var_run_t, dir, "pam_mount")
	files_pid_filetrans($1, pam_var_run_t, dir, "pam_ssh")
	files_pid_filetrans($1, pam_var_run_t, dir, "sepermit")
	files_pid_filetrans($1, pam_var_run_t, dir, "sudo")
')

########################################
## <summary>
##	Execute pam_console with a domain transition.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed to transition.
##	</summary>
## </param>
#
interface(`auth_domtrans_pam_console',`
	gen_require(`
		type pam_console_t, pam_console_exec_t;
	')

	domtrans_pattern($1, pam_console_exec_t, pam_console_t)
')

########################################
## <summary>
##	Search the contents of the
##	pam_console data directory.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
#
interface(`auth_search_pam_console_data',`
	gen_require(`
		type pam_var_console_t;
	')

	files_search_pids($1)
	allow $1 pam_var_console_t:dir search_dir_perms;
')

########################################
## <summary>
##	List the contents of the pam_console
##	data directory.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
#
interface(`auth_list_pam_console_data',`
	gen_require(`
		type pam_var_console_t;
	')

	files_search_pids($1)
	allow $1 pam_var_console_t:dir list_dir_perms;
')

########################################
## <summary>
##	Create pam var console pid directories.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
#
interface(`auth_create_pam_console_data_dirs',`
	gen_require(`
		type pam_var_console_t;
	')

	files_search_pids($1)
	allow $1 pam_var_console_t:dir create_dir_perms;
')

########################################
## <summary>
##	Relabel pam_console data directories.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
#
interface(`auth_relabel_pam_console_data_dirs',`
	gen_require(`
		type pam_var_console_t;
	')

	relabel_dirs_pattern($1, pam_var_console_t, pam_var_console_t)
')

########################################
## <summary>
##	Read pam_console data files.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
#
interface(`auth_read_pam_console_data',`
	gen_require(`
		type pam_var_console_t;
	')

	files_search_pids($1)
	allow $1 pam_var_console_t:dir list_dir_perms;
	allow $1 pam_var_console_t:file read_file_perms;
')

########################################
## <summary>
##	Create, read, write, and delete
##	pam_console data files.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
#
interface(`auth_manage_pam_console_data',`
	gen_require(`
		type pam_var_console_t;
	')

	files_search_pids($1)
	manage_files_pattern($1, pam_var_console_t, pam_var_console_t)
	manage_lnk_files_pattern($1, pam_var_console_t, pam_var_console_t)
	files_pid_filetrans($1, pam_var_console_t, dir, "console")
')

#######################################
## <summary>
##	Delete pam_console data.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
#
interface(`auth_delete_pam_console_data',`
	gen_require(`
		type pam_var_console_t;
	')

	files_search_var($1)
	files_search_pids($1)
	delete_files_pattern($1, pam_var_console_t, pam_var_console_t)
')

########################################
## <summary>
##	Create specified objects in
##	pid directories with the pam var
##      console pid file type using a
##      file type transition.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
## <param name="object_class">
##	<summary>
##	Class of the object being created.
##	</summary>
## </param>
## <param name="name" optional="true">
##	<summary>
##	The name of the object being created.
##	</summary>
## </param>
#
interface(`auth_pid_filetrans_pam_var_console',`
	gen_require(`
		type pam_var_console_t;
	')

	files_pid_filetrans($1, pam_var_console_t, $2, $3)
')

########################################
## <summary>
##	Read all directories on the filesystem, except
##	login files and listed exceptions.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
## <param name="exception_types" optional="true">
##	<summary>
##	The types to be excluded.  Each type or attribute
##	must be negated by the caller.
##	</summary>
## </param>
#
interface(`auth_read_all_dirs_except_auth_files',`
	refpolicywarn(`$0($*) has been deprecated, use files_list_non_auth_dirs() instead.')
	files_list_non_auth_dirs($1)
')

########################################
## <summary>
##	Read all directories on the filesystem, except
##	the shadow passwords and listed exceptions.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
## <param name="exception_types" optional="true">
##	<summary>
##	The types to be excluded.  Each type or attribute
##	must be negated by the caller.
##	</summary>
## </param>
#
interface(`auth_read_all_dirs_except_shadow',`
	refpolicywarn(`$0($*) has been deprecated, use files_list_non_auth_dirs() instead.')
	files_list_non_auth_dirs($1)
')

########################################
## <summary>
##	Read all files on the filesystem, except
##	login files and listed exceptions.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
## <param name="exception_types" optional="true">
##	<summary>
##	The types to be excluded.  Each type or attribute
##	must be negated by the caller.
##	</summary>
## </param>
## <rolecap/>
#
interface(`auth_read_all_files_except_auth_files',`
	refpolicywarn(`$0($*) has been deprecated, use files_read_non_auth_files() instead.')
	files_read_non_auth_files($1)
')

########################################
## <summary>
##	Read all files on the filesystem, except
##	the shadow passwords and listed exceptions.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
## <param name="exception_types" optional="true">
##	<summary>
##	The types to be excluded.  Each type or attribute
##	must be negated by the caller.
##	</summary>
## </param>
## <rolecap/>
#
interface(`auth_read_all_files_except_shadow',`
	refpolicywarn(`$0($*) has been deprecated, use files_read_non_auth_files() instead.')
	files_read_non_auth_files($1)
')

########################################
## <summary>
##	Read all symbolic links on the filesystem, except
##	login files and listed exceptions.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
## <param name="exception_types" optional="true">
##	<summary>
##	The types to be excluded.  Each type or attribute
##	must be negated by the caller.
##	</summary>
## </param>
#
interface(`auth_read_all_symlinks_except_auth_files',`
	refpolicywarn(`$0($*) has been deprecated, use files_read_non_auth_symlinks() instead.')
	files_read_non_auth_symlinks($1)
')

########################################
## <summary>
##	Read all symbolic links on the filesystem, except
##	the shadow passwords and listed exceptions.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
## <param name="exception_types" optional="true">
##	<summary>
##	The types to be excluded.  Each type or attribute
##	must be negated by the caller.
##	</summary>
## </param>
#
interface(`auth_read_all_symlinks_except_shadow',`
	refpolicywarn(`$0($*) has been deprecated, use files_read_non_auth_symlinks() instead.')
	files_read_non_auth_symlinks($1)
')

#######################################
## <summary>
##	Relabel all files on the filesystem, except
##	login files and listed exceptions.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
## <param name="exception_types" optional="true">
##	<summary>
##	The types to be excluded.  Each type or attribute
##	must be negated by the caller.
##	</summary>
## </param>
#
interface(`auth_relabel_all_files_except_auth_files',`
	refpolicywarn(`$0($*) has been deprecated, use files_relabel_non_auth_files() instead.')
	files_relabel_non_auth_files($1)
')

########################################
## <summary>
##	Relabel all files on the filesystem, except
##	the shadow passwords and listed exceptions.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
## <param name="exception_types" optional="true">
##	<summary>
##	The types to be excluded.  Each type or attribute
##	must be negated by the caller.
##	</summary>
## </param>
#
interface(`auth_relabel_all_files_except_shadow',`
	refpolicywarn(`$0($*) has been deprecated, use files_relabel_non_auth_files() instead.')
	files_relabel_non_auth_files($1)
')

########################################
## <summary>
##	Read and write all files on the filesystem, except
##	login files and listed exceptions.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
## <param name="exception_types" optional="true">
##	<summary>
##	The types to be excluded.  Each type or attribute
##	must be negated by the caller.
##	</summary>
## </param>
#
interface(`auth_rw_all_files_except_auth_files',`
	refpolicywarn(`$0($*) has been deprecated, use files_rw_non_auth_files() instead.')
	files_rw_non_auth_files($1)
')

########################################
## <summary>
##	Read and write all files on the filesystem, except
##	the shadow passwords and listed exceptions.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
## <param name="exception_types" optional="true">
##	<summary>
##	The types to be excluded.  Each type or attribute
##	must be negated by the caller.
##	</summary>
## </param>
#
interface(`auth_rw_all_files_except_shadow',`
	refpolicywarn(`$0($*) has been deprecated, use files_rw_non_auth_files() instead.')
	files_rw_non_auth_files($1)
')

########################################
## <summary>
##	Manage all files on the filesystem, except
##	login files passwords and listed exceptions.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
## <param name="exception_types" optional="true">
##	<summary>
##	The types to be excluded.  Each type or attribute
##	must be negated by the caller.
##	</summary>
## </param>
#
interface(`auth_manage_all_files_except_auth_files',`
	refpolicywarn(`$0($*) has been deprecated, use files_manage_non_auth_files() instead.')
	files_manage_non_auth_files($1)
')

########################################
## <summary>
##	Manage all files on the filesystem, except
##	the shadow passwords and listed exceptions.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
## <param name="exception_types" optional="true">
##	<summary>
##	The types to be excluded.  Each type or attribute
##	must be negated by the caller.
##	</summary>
## </param>
#
interface(`auth_manage_all_files_except_shadow',`
	refpolicywarn(`$0($*) has been deprecated, use files_manage_non_auth_files() instead.')
	files_manage_non_auth_files($1)
')

########################################
## <summary>
##	Execute utempter programs in the utempter domain.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed to transition.
##	</summary>
## </param>
#
interface(`auth_domtrans_utempter',`
	gen_require(`
		type utempter_t, utempter_exec_t;
	')

	domtrans_pattern($1, utempter_exec_t, utempter_t)
')

########################################
## <summary>
##	Execute utempter programs in the utempter domain.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed to transition.
##	</summary>
## </param>
## <param name="role">
##	<summary>
##	The role to allow the utempter domain.
##	</summary>
## </param>
#
interface(`auth_run_utempter',`
	gen_require(`
		type utempter_t;
	')

	auth_domtrans_utempter($1)
	role $2 types utempter_t;
')

#######################################
## <summary>
##	Do not audit attemps to execute utempter executable.
## </summary>
## <param name="domain">
##	<summary>
##	Domain to not audit.
##	</summary>
## </param>
#
interface(`auth_dontaudit_exec_utempter',`
	gen_require(`
		type utempter_exec_t;
	')

	dontaudit $1 utempter_exec_t:file { execute execute_no_trans };
')

########################################
## <summary>
##	Set the attributes of login record files.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
#
interface(`auth_setattr_login_records',`
	gen_require(`
		type wtmp_t;
	')

	allow $1 wtmp_t:file setattr;
	logging_search_logs($1)
')

########################################
## <summary>
##	Relabel login record files.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
#
interface(`auth_relabel_login_records',`
	gen_require(`
		type wtmp_t;
	')

	allow $1 wtmp_t:file relabel_file_perms;
')


########################################
## <summary>
##	Read login records files (/var/log/wtmp).
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
## <rolecap/>
#
interface(`auth_read_login_records',`
	gen_require(`
		type wtmp_t;
	')

	logging_search_logs($1)
	allow $1 wtmp_t:file read_file_perms;
')

########################################
## <summary>
##	Do not audit attempts to read login records
##	files (/var/log/wtmp).
## </summary>
## <param name="domain">
##	<summary>
##	Domain to not audit.
##	</summary>
## </param>
## <rolecap/>
#
interface(`auth_dontaudit_read_login_records',`
	gen_require(`
		type wtmp_t;
	')

	dontaudit $1 wtmp_t:file read_file_perms;
')

########################################
## <summary>
##	Do not audit attempts to write to
##	login records files.
## </summary>
## <param name="domain">
##	<summary>
##	Domain to not audit.
##	</summary>
## </param>
#
interface(`auth_dontaudit_write_login_records',`
	gen_require(`
		type wtmp_t;
	')

	dontaudit $1 wtmp_t:file write;
')

#######################################
## <summary>
##	Append to login records (wtmp).
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
#
interface(`auth_append_login_records',`
	gen_require(`
		type wtmp_t;
	')

	allow $1 wtmp_t:file append_file_perms;
	logging_search_logs($1)
')

#######################################
## <summary>
##	Write to login records (wtmp).
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
#
interface(`auth_write_login_records',`
	gen_require(`
		type wtmp_t;
	')

	allow $1 wtmp_t:file { write_file_perms lock };
')

########################################
## <summary>
##	Read and write login records.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
#
interface(`auth_rw_login_records',`
	gen_require(`
		type wtmp_t;
	')

	allow $1 wtmp_t:file rw_file_perms;
	logging_search_logs($1)
')

########################################
## <summary>
##	Create a login records in the log directory
##	using a type transition.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
#
interface(`auth_log_filetrans_login_records',`
	gen_require(`
		type wtmp_t;
	')

	logging_log_filetrans($1, wtmp_t, file)
')

########################################
## <summary>
##	Create, read, write, and delete login
##	records files.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
#
interface(`auth_manage_login_records',`
	gen_require(`
		type wtmp_t;
	')

	logging_rw_generic_log_dirs($1)
	allow $1 wtmp_t:file manage_file_perms;
	logging_log_named_filetrans($1, wtmp_t, file, "wtmp")
')

########################################
## <summary>
##	Use nsswitch to look up user, password, group, or
##	host information.
## </summary>
## <desc>
##	<p>
##	Allow the specified domain to look up user, password,
##	group, or host information using the name service.
##	The most common use of this interface is for services
##	that do host name resolution (usually DNS resolution).
##	</p>
## </desc>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
## <infoflow type="both" weight="10"/>
#
interface(`auth_use_nsswitch',`
	gen_require(`
		attribute nsswitch_domain;
	')

	typeattribute $1 nsswitch_domain;

	corenet_all_recvfrom_netlabel($1)
')

########################################
## <summary>
##	Unconfined access to the authlogin module.
## </summary>
## <desc>
##	<p>
##	Unconfined access to the authlogin module.
##	</p>
##	<p>
##	Currently, this only allows assertions for
##	the shadow passwords file (/etc/shadow) to
##	be passed.  No access is granted yet.
##	</p>
## </desc>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
#
interface(`auth_unconfined',`
	gen_require(`
		attribute can_read_shadow_passwords;
		attribute can_write_shadow_passwords;
		attribute can_relabelto_shadow_passwords;
	')

	typeattribute $1 can_read_shadow_passwords;
	typeattribute $1 can_write_shadow_passwords;
	typeattribute $1 can_relabelto_shadow_passwords;
')

########################################
## <summary>
##	Transition to authlogin named content
## </summary>
## <param name="domain">
##	<summary>
##      Domain allowed access.
##	</summary>
## </param>
#
interface(`auth_filetrans_named_content',`
	gen_require(`
		type shadow_t;
		type passwd_file_t;
		type faillog_t;
		type lastlog_t;
		type wtmp_t;
		type pam_var_console_t;
		type pam_var_run_t;
		type auth_cache_t;
	')

	files_etc_filetrans($1, passwd_file_t, file, "group")
	files_etc_filetrans($1, passwd_file_t, file, "group-")
	#files_etc_filetrans($1, passwd_file_t, file, "group+")
	files_etc_filetrans($1, passwd_file_t, file, "passwd")
	files_etc_filetrans($1, passwd_file_t, file, "passwd-")
	#files_etc_filetrans($1, passwd_file_t, file, "passwd+")
	files_etc_filetrans($1, passwd_file_t, file, "passwd.OLD")
	files_etc_filetrans($1, passwd_file_t, file, "ptmptmp")
	files_etc_filetrans($1, passwd_file_t, file, "passwd.lock")
	files_etc_filetrans($1, passwd_file_t, file, "group.lock")
	files_etc_filetrans($1, passwd_file_t, file, "passwd.adjunct")
	files_etc_filetrans($1, passwd_file_t, file, ".pwd.lock")
	files_etc_filetrans($1, shadow_t, file, "shadow")
	files_etc_filetrans($1, shadow_t, file, "shadow-")
	files_etc_filetrans($1, shadow_t, file, "gshadow")
	files_etc_filetrans($1, shadow_t, file, "opasswd")
	logging_log_named_filetrans($1, lastlog_t, file, "lastlog")
	logging_log_named_filetrans($1, faillog_t, file, "tallylog")
	logging_log_named_filetrans($1, faillog_t, file, "faillog")
	logging_log_named_filetrans($1, faillog_t, file, "btmp")
	files_pid_filetrans($1, faillog_t, file, "faillog")
	files_pid_filetrans($1, faillog_t, dir, "faillock")
	files_pid_filetrans($1, pam_var_console_t, dir, "console")
	files_pid_filetrans($1, pam_var_run_t, dir, "pam_mount")
	files_pid_filetrans($1, pam_var_run_t, dir, "pam_ssh")
	files_pid_filetrans($1, pam_var_run_t, dir, "sepermit")
	files_pid_filetrans($1, pam_var_run_t, dir, "sudo")
	logging_log_named_filetrans($1, wtmp_t, file, "wtmp")
	files_var_filetrans($1, auth_cache_t, dir, "coolkey")
')

########################################
## <summary>
##	Get the attributes of the passwd passwords file.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
#
interface(`auth_getattr_passwd',`
	gen_require(`
		type passwd_file_t;
	')

	files_search_etc($1)
	allow $1 passwd_file_t:file getattr;
')

########################################
## <summary>
##	Do not audit attempts to get the attributes
##	of the passwd passwords file.
## </summary>
## <param name="domain">
##	<summary>
##	Domain to not audit.
##	</summary>
## </param>
#
interface(`auth_dontaudit_getattr_passwd',`
	gen_require(`
		type passwd_file_t;
	')

	dontaudit $1 passwd_file_t:file getattr;
')

########################################
## <summary>
##	Read the passwd passwords file (/etc/passwd)
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
#
interface(`auth_read_passwd',`
	gen_require(`
		type passwd_file_t;
	')

	allow $1 passwd_file_t:file read_file_perms;
')

########################################
## <summary>
##	Mmap the passwd passwords file (/etc/passwd)
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
#
interface(`auth_map_passwd',`
	gen_require(`
		type passwd_file_t;
	')

	allow $1 passwd_file_t:file map;
')

########################################
## <summary>
##	Do not audit attempts to read the passwd
##	password file (/etc/passwd).
## </summary>
## <param name="domain">
##	<summary>
##	Domain to not audit.
##	</summary>
## </param>
#
interface(`auth_dontaudit_read_passwd',`
	gen_require(`
		type passwd_file_t;
	')

	dontaudit $1 passwd_file_t:file read_file_perms;
')

########################################
## <summary>
##	Create, read, write, and delete the passwd
##	password file.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
#
interface(`auth_manage_passwd',`
	gen_require(`
		type passwd_file_t;
	')

	files_rw_etc_dirs($1)
	allow $1 passwd_file_t:file manage_file_perms;
	files_etc_filetrans($1, passwd_file_t, file, "passwd")
	files_etc_filetrans($1, passwd_file_t, file, "passwd-")
	files_etc_filetrans($1, passwd_file_t, file, "ptmptmp")
	files_etc_filetrans($1, passwd_file_t, file, "group")
	files_etc_filetrans($1, passwd_file_t, file, "group-")
	files_etc_filetrans($1, passwd_file_t, file, ".pwd.lock")
	files_etc_filetrans($1, passwd_file_t, file, "passwd.lock")
	files_etc_filetrans($1, passwd_file_t, file, "group.lock")
')

########################################
## <summary>
##	Create auth directory in the /root directory
##	with an correct label.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
#
interface(`auth_filetrans_admin_home_content',`
	gen_require(`
		type auth_home_t;
	')

	userdom_admin_home_dir_filetrans($1, auth_home_t, file, ".google_authenticator")
	userdom_admin_home_dir_filetrans($1, auth_home_t, file, ".google_authenticator~")
	userdom_admin_home_dir_filetrans($1, auth_home_t, dir, ".yubico")
')


########################################
## <summary>
##	Read the authorization data in the user home directory
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
#
interface(`auth_read_home_content',`
	
	gen_require(`
		type auth_home_t;
	')

	userdom_search_user_home_dirs($1)
	read_files_pattern($1, auth_home_t, auth_home_t)
')

########################################
## <summary>
##	Read the authorization data in the user home directory
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
#
interface(`auth_manage_home_content',`
	
	gen_require(`
		type auth_home_t;
	')

	userdom_search_user_home_dirs($1)
	manage_files_pattern($1, auth_home_t, auth_home_t)
    manage_dirs_pattern($1, auth_home_t, auth_home_t)
')

########################################
## <summary>
##	Create auth directory in the user home directory
##	with an correct label.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
#
interface(`auth_filetrans_home_content',`
	
	gen_require(`
		type auth_home_t;
	')

	userdom_user_home_dir_filetrans($1, auth_home_t, file, ".google_authenticator")
	userdom_user_home_dir_filetrans($1, auth_home_t, file, ".google_authenticator~")
	userdom_user_home_dir_filetrans($1, auth_home_t, dir, ".yubico")
')

########################################
## <summary>
##	Send a SIGCHLD signal to login programs.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
#
interface(`auth_login_pgm_sigchld',`
	gen_require(`
		attribute login_pgm;
	')

	allow $1 login_pgm:process sigchld;
')

########################################
## <summary>
##	Manage the keyrings of all login programs
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
#
interface(`auth_login_manage_key',`
	gen_require(`
		attribute login_pgm;
	')

	allow $1 login_pgm:key manage_key_perms;
')