Chris PeBenito 17de1b
## <summary>File transfer protocol service</summary>
Chris PeBenito 17de1b
Chris PeBenito 17de1b
#######################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito bbcd3c
##	The per role template for the ftp module.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <desc>
Chris PeBenito 17de1b
##	

Chris PeBenito 17de1b
##	This template allows ftpd to manage files in
Chris PeBenito 17de1b
##	a user home directory, creating files with the
Chris PeBenito 17de1b
##	correct type.
Chris PeBenito 17de1b
##	

Chris PeBenito 17de1b
##	

Chris PeBenito 17de1b
##	This template is invoked automatically for each user, and
Chris PeBenito 17de1b
##	generally does not need to be invoked directly
Chris PeBenito 17de1b
##	by policy writers.
Chris PeBenito 17de1b
##	

Chris PeBenito 17de1b
## </desc>
Chris PeBenito 17de1b
## <param name="userdomain_prefix">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	The prefix of the user domain (e.g., user
Chris PeBenito 17de1b
##	is the prefix for user_t).
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito bbcd3c
template(`ftp_per_role_template',`
Chris PeBenito 6b19be
	gen_require(`
Chris PeBenito 6b19be
		type ftpd_t;
Chris PeBenito 6b19be
	')
Chris PeBenito 6b19be
Chris PeBenito 56e1b3
	userdom_manage_user_home_content_files($1,ftpd_t)
Chris PeBenito 56e1b3
	userdom_manage_user_home_content_symlinks($1,ftpd_t)
Chris PeBenito 56e1b3
	userdom_manage_user_home_content_sockets($1,ftpd_t)
Chris PeBenito 56e1b3
	userdom_manage_user_home_content_pipes($1,ftpd_t)
Chris PeBenito 56e1b3
	userdom_user_home_dir_filetrans_user_home_content($1,ftpd_t,{ dir file lnk_file sock_file fifo_file })
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 33c7e6
##      Use ftp by connecting over TCP.  (Deprecated)
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##      Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`ftp_tcp_connect',`
Chris PeBenito 33c7e6
	refpolicywarn(`$0($*) has been deprecated.')
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##      Read ftpd etc files
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##      Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`ftp_read_config',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type ftpd_etc_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	files_search_etc($1)
Chris PeBenito 17de1b
	allow $1 ftpd_etc_t:file { getattr read };
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##      Execute FTP daemon entry point programs.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##      Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`ftp_check_exec',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type ftpd_exec_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 8021cb
	corecmd_search_bin($1)
Chris PeBenito ef659a
	allow $1 ftpd_exec_t:file { getattr execute };
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##      Read FTP transfer logs
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##      Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`ftp_read_log',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type xferlog_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	logging_search_logs($1)
Chris PeBenito c0868a
	allow $1 xferlog_t:file read_file_perms;
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##      Execute the ftpdctl program in the ftpdctl domain.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##      <summary>
Chris PeBenito 17de1b
##      Domain allowed access.
Chris PeBenito 17de1b
##      </summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`ftp_domtrans_ftpdctl',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type ftpdctl_t, ftpdctl_exec_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	corecmd_search_bin($1)
Chris PeBenito c0868a
	domtrans_pattern($1, ftpdctl_exec_t, ftpdctl_t)
Chris PeBenito 17de1b
')
Chris PeBenito 350b6a
Chris PeBenito 350b6a
########################################
Chris PeBenito 350b6a
## <summary>
Chris PeBenito 350b6a
##	Execute the ftpdctl program in the ftpdctl domain.
Chris PeBenito 350b6a
## </summary>
Chris PeBenito 350b6a
## <param name="domain">
Chris PeBenito 350b6a
##	<summary>
Chris PeBenito 350b6a
##	Domain allowed access.
Chris PeBenito 350b6a
##	</summary>
Chris PeBenito 350b6a
## </param>
Chris PeBenito 350b6a
## <param name="role">
Chris PeBenito 350b6a
##	<summary>
Chris PeBenito 350b6a
##	The role to allow the ftpdctl domain.
Chris PeBenito 350b6a
##	</summary>
Chris PeBenito 350b6a
## </param>
Chris PeBenito 350b6a
## <param name="terminal">
Chris PeBenito 350b6a
##	<summary>
Chris PeBenito 350b6a
##	The type of the terminal allow the ftpdctl domain to use.
Chris PeBenito 350b6a
##	</summary>
Chris PeBenito 350b6a
## </param>
Chris PeBenito 350b6a
## <rolecap/>
Chris PeBenito 350b6a
#
Chris PeBenito 350b6a
interface(`ftp_run_ftpdctl',`
Chris PeBenito 350b6a
	gen_require(`
Chris PeBenito 350b6a
		type ftpdctl_t;
Chris PeBenito 350b6a
	')
Chris PeBenito 350b6a
Chris PeBenito 350b6a
	ftp_domtrans_ftpdctl($1)
Chris PeBenito 350b6a
	role $2 types ftpdctl_t;
Chris PeBenito 350b6a
	allow ftpdctl_t $3:chr_file rw_term_perms;
Chris PeBenito 350b6a
')