Chris PeBenito 79cde3
## <summary>
Chris PeBenito 79cde3
##	SMB and CIFS client/server programs for UNIX and
Chris PeBenito 79cde3
##	name  Service  Switch  daemon for resolving names
Chris PeBenito 79cde3
##	from Windows NT servers.
Chris PeBenito 79cde3
## </summary>
Chris PeBenito 84c922
Chris PeBenito 84c922
#######################################
Chris PeBenito 84c922
## <summary>
Chris PeBenito 84c922
##	The per user domain template for the samba module.
Chris PeBenito 84c922
## </summary>
Chris PeBenito 84c922
## <desc>
Chris PeBenito 84c922
##	

Chris PeBenito 84c922
##	This template allows smbd to manage files in
Chris PeBenito 84c922
##	a user home directory, creating files with the
Chris PeBenito 84c922
##	correct type.
Chris PeBenito 84c922
##	

Chris PeBenito 84c922
##	

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

Chris PeBenito 84c922
## </desc>
Chris PeBenito 84c922
## <param name="userdomain_prefix">
Chris PeBenito 84c922
##	The prefix of the user domain (e.g., user
Chris PeBenito 84c922
##	is the prefix for user_t).
Chris PeBenito 84c922
## </param>
Chris PeBenito 84c922
#
Chris PeBenito 84c922
template(`samba_per_userdomain_template',`
Chris PeBenito a996bd
	gen_require(`
Chris PeBenito a996bd
		type smbd_t;
Chris PeBenito 84c922
	')
Chris PeBenito a996bd
Chris PeBenito a996bd
	userdom_manage_user_home_subdir_files($1,smbd_t)
Chris PeBenito a996bd
	userdom_manage_user_home_subdir_symlinks($1,smbd_t)
Chris PeBenito a996bd
	userdom_manage_user_home_subdir_sockets($1,smbd_t)
Chris PeBenito a996bd
	userdom_manage_user_home_subdir_pipes($1,smbd_t)
Chris PeBenito a996bd
#	userdom_create_user_home($1,smbd_t,{ dir file lnk_file sock_file fifo_file })
Chris PeBenito 84c922
')
Chris PeBenito 84c922
Chris PeBenito 84c922
########################################
Chris PeBenito 84c922
## <summary>
Chris PeBenito 84c922
##	Execute samba net in the samba_net domain.
Chris PeBenito 84c922
## </summary>
Chris PeBenito 84c922
## <param name="domain">
Chris PeBenito 84c922
##	The type of the process performing this action.
Chris PeBenito 84c922
## </param>
Chris PeBenito 84c922
#
Chris PeBenito 84c922
interface(`samba_domtrans_net',`
Chris PeBenito 84c922
	gen_require(`
Chris PeBenito 84c922
		type samba_net_t, samba_net_exec_t;
Chris PeBenito 84c922
	')
Chris PeBenito 84c922
Chris PeBenito 84c922
	corecmd_search_bin($1)
Chris PeBenito 84c922
	domain_auto_trans($1,samba_net_exec_t,samba_net_t)
Chris PeBenito 84c922
Chris PeBenito 84c922
	allow $1 samba_net_t:fd use;
Chris PeBenito 84c922
	allow samba_net_t $1:fd use;
Chris PeBenito 84c922
	allow samba_net_t $1:fifo_file rw_file_perms;
Chris PeBenito 84c922
	allow samba_net_t $1:process sigchld;
Chris PeBenito 84c922
')
Chris PeBenito 84c922
Chris PeBenito 84c922
########################################
Chris PeBenito 84c922
## <summary>
Chris PeBenito 84c922
##	Execute samba net in the samba_net domain, and
Chris PeBenito 84c922
##	allow the specified role the samba_net domain.
Chris PeBenito 84c922
## </summary>
Chris PeBenito 84c922
## <param name="domain">
Chris PeBenito 84c922
##	The type of the process performing this action.
Chris PeBenito 84c922
## </param>
Chris PeBenito 84c922
## <param name="role">
Chris PeBenito 84c922
##	The role to be allowed the samba_net domain.
Chris PeBenito 84c922
## </param>
Chris PeBenito 84c922
## <param name="terminal">
Chris PeBenito 84c922
##	The type of the terminal allow the samba_net domain to use.
Chris PeBenito 84c922
## </param>
Chris PeBenito 84c922
#
Chris PeBenito 84c922
interface(`samba_run_net',`
Chris PeBenito 84c922
	gen_require(`
Chris PeBenito 84c922
		type samba_net_t;
Chris PeBenito 84c922
	')
Chris PeBenito 84c922
Chris PeBenito 84c922
	samba_domtrans_net($1)
Chris PeBenito 84c922
	role $2 types samba_net_t;
Chris PeBenito 84c922
	allow samba_net_t $3:chr_file rw_term_perms;
Chris PeBenito 84c922
')
Chris PeBenito 84c922
Chris PeBenito 84c922
########################################
Chris PeBenito 84c922
## <summary>
Chris PeBenito 84c922
##	Execute smbmount in the smbmount domain.
Chris PeBenito 84c922
## </summary>
Chris PeBenito 84c922
## <param name="domain">
Chris PeBenito 84c922
##	The type of the process performing this action.
Chris PeBenito 84c922
## </param>
Chris PeBenito 84c922
#
Chris PeBenito 84c922
interface(`samba_domtrans_smbmount',`
Chris PeBenito 84c922
	gen_require(`
Chris PeBenito 84c922
		type smbmount_t, smbmount_exec_t;
Chris PeBenito 84c922
	')
Chris PeBenito 84c922
Chris PeBenito 84c922
	corecmd_search_bin($1)
Chris PeBenito 84c922
	domain_auto_trans($1,smbmount_exec_t,smbmount_t)
Chris PeBenito 84c922
Chris PeBenito 84c922
	allow $1 smbmount_t:fd use;
Chris PeBenito 84c922
	allow smbmount_t $1:fd use;
Chris PeBenito 84c922
	allow smbmount_t $1:fifo_file rw_file_perms;
Chris PeBenito 84c922
	allow smbmount_t $1:process sigchld;
Chris PeBenito 84c922
')
Chris PeBenito 84c922
Chris PeBenito 84c922
########################################
Chris PeBenito 84c922
## <summary>
Chris PeBenito 84c922
##	Allow the specified domain to read
Chris PeBenito 84c922
##	samba configuration files.
Chris PeBenito 84c922
## </summary>
Chris PeBenito 84c922
## <param name="domain">
Chris PeBenito 84c922
##	Domain allowed access.
Chris PeBenito 84c922
## </param>
Chris PeBenito 84c922
#
Chris PeBenito 84c922
interface(`samba_read_config',`
Chris PeBenito 84c922
	gen_require(`
Chris PeBenito 84c922
		type samba_etc_t;
Chris PeBenito 84c922
	')
Chris PeBenito 84c922
Chris PeBenito 84c922
	files_search_etc($1)
Chris PeBenito 84c922
	allow $1 samba_etc_t:file { read getattr lock };
Chris PeBenito 84c922
')
Chris PeBenito 84c922
Chris PeBenito 84c922
########################################
Chris PeBenito 84c922
## <summary>
Chris PeBenito 84c922
##	Allow the specified domain to read
Chris PeBenito 84c922
##	and write samba configuration files.
Chris PeBenito 84c922
## </summary>
Chris PeBenito 84c922
## <param name="domain">
Chris PeBenito 84c922
##	Domain allowed access.
Chris PeBenito 84c922
## </param>
Chris PeBenito 84c922
#
Chris PeBenito 84c922
interface(`samba_rw_config',`
Chris PeBenito 84c922
	gen_require(`
Chris PeBenito 84c922
		type samba_etc_t;
Chris PeBenito 84c922
	')
Chris PeBenito 84c922
Chris PeBenito 84c922
	files_search_etc($1)
Chris PeBenito 84c922
	allow $1 samba_etc_t:file rw_file_perms;
Chris PeBenito 84c922
')
Chris PeBenito 84c922
Chris PeBenito 84c922
########################################
Chris PeBenito 84c922
## <summary>
Chris PeBenito 84c922
##	Allow the specified domain to read samba's log files.
Chris PeBenito 84c922
## </summary>
Chris PeBenito 84c922
## <param name="domain">
Chris PeBenito 84c922
##	Domain allowed access.
Chris PeBenito 84c922
## </param>
Chris PeBenito 84c922
#
Chris PeBenito 84c922
interface(`samba_read_log',`
Chris PeBenito 84c922
	gen_require(`
Chris PeBenito 84c922
		type samba_log_t;
Chris PeBenito 84c922
	')
Chris PeBenito 84c922
Chris PeBenito 84c922
	logging_search_logs($1)
Chris PeBenito 84c922
	allow $1 samba_log_t:file { read getattr lock };
Chris PeBenito 84c922
')
Chris PeBenito 84c922
Chris PeBenito 84c922
########################################
Chris PeBenito 84c922
## <summary>
Chris PeBenito 84c922
##	Execute samba log in the caller domain.
Chris PeBenito 84c922
## </summary>
Chris PeBenito 84c922
## <param name="domain">
Chris PeBenito 84c922
##	The type of the process performing this action.
Chris PeBenito 84c922
## </param>
Chris PeBenito 84c922
#
Chris PeBenito 84c922
interface(`samba_exec_log',`
Chris PeBenito 84c922
	gen_require(`
Chris PeBenito 84c922
		type samba_log_t;
Chris PeBenito 84c922
	')
Chris PeBenito 84c922
Chris PeBenito 84c922
	logging_search_logs($1)
Chris PeBenito 84c922
	can_exec($1,samba_log_t)
Chris PeBenito 84c922
')
Chris PeBenito 84c922
Chris PeBenito 84c922
########################################
Chris PeBenito 84c922
## <summary>
Chris PeBenito 84c922
##	Allow the specified domain to read samba's secrets.
Chris PeBenito 84c922
## </summary>
Chris PeBenito 84c922
## <param name="domain">
Chris PeBenito 84c922
##	Domain allowed access.
Chris PeBenito 84c922
## </param>
Chris PeBenito 84c922
#
Chris PeBenito 84c922
interface(`samba_read_secrets',`
Chris PeBenito 84c922
	gen_require(`
Chris PeBenito 84c922
		type samba_secrets_t;
Chris PeBenito 84c922
	')
Chris PeBenito 84c922
Chris PeBenito 84c922
	files_search_etc($1)
Chris PeBenito 84c922
	allow $1 samba_secrets_t:file { read getattr lock };
Chris PeBenito 84c922
')
Chris PeBenito 84c922
Chris PeBenito 84c922
########################################
Chris PeBenito 84c922
## <summary>
Chris PeBenito 84c922
##	Allow the specified domain to write to smbmount tcp sockets.
Chris PeBenito 84c922
## </summary>
Chris PeBenito 84c922
## <param name="domain">
Chris PeBenito 84c922
##	Domain allowed access.
Chris PeBenito 84c922
## </param>
Chris PeBenito 84c922
#
Chris PeBenito 84c922
interface(`samba_write_smbmount_tcp_socket',`
Chris PeBenito 84c922
	gen_require(`
Chris PeBenito 84c922
		type smbmount_t;
Chris PeBenito 84c922
	')
Chris PeBenito 84c922
Chris PeBenito 84c922
	allow $1 smbmount_t:tcp_socket write;
Chris PeBenito 84c922
')
Chris PeBenito 84c922
Chris PeBenito 84c922
########################################
Chris PeBenito 84c922
## <summary>
Chris PeBenito 84c922
##	Allow the specified domain to read and write to smbmount tcp sockets.
Chris PeBenito 84c922
## </summary>
Chris PeBenito 84c922
## <param name="domain">
Chris PeBenito 84c922
##	Domain allowed access.
Chris PeBenito 84c922
## </param>
Chris PeBenito 84c922
#
Chris PeBenito 84c922
interface(`samba_rw_smbmount_tcp_socket',`
Chris PeBenito 84c922
	gen_require(`
Chris PeBenito 84c922
		type smbmount_t;
Chris PeBenito 84c922
	')
Chris PeBenito 84c922
Chris PeBenito 84c922
	allow $1 smbmount_t:tcp_socket { read write };
Chris PeBenito 84c922
')
Chris PeBenito 79cde3
Chris PeBenito 79cde3
########################################
Chris PeBenito 79cde3
## <summary>
Chris PeBenito 79cde3
##	Execute winbind_helper in the winbind_helper domain.
Chris PeBenito 79cde3
## </summary>
Chris PeBenito 79cde3
## <param name="domain">
Chris PeBenito 79cde3
##	The type of the process performing this action.
Chris PeBenito 79cde3
## </param>
Chris PeBenito 79cde3
#
Chris PeBenito 79cde3
interface(`samba_domtrans_winbind_helper',`
Chris PeBenito 79cde3
	gen_require(`
Chris PeBenito 79cde3
		type winbind_helper_t, winbind_helper_exec_t;
Chris PeBenito 79cde3
	')
Chris PeBenito 79cde3
Chris PeBenito 79cde3
	domain_auto_trans($1,winbind_helper_exec_t,winbind_helper_t)
Chris PeBenito 79cde3
Chris PeBenito 79cde3
	allow $1 winbind_helper_t:fd use;
Chris PeBenito 79cde3
	allow winbind_helper_t $1:fd use;
Chris PeBenito 79cde3
	allow winbind_helper_t $1:fifo_file rw_file_perms;
Chris PeBenito 79cde3
	allow winbind_helper_t $1:process sigchld;
Chris PeBenito 79cde3
')
Chris PeBenito 79cde3
Chris PeBenito 79cde3
########################################
Chris PeBenito 79cde3
## <summary>
Chris PeBenito 79cde3
##	Execute winbind_helper in the winbind_helper domain, and
Chris PeBenito 79cde3
##	allow the specified role the winbind_helper domain.
Chris PeBenito 79cde3
## </summary>
Chris PeBenito 79cde3
## <param name="domain">
Chris PeBenito 79cde3
##	The type of the process performing this action.
Chris PeBenito 79cde3
## </param>
Chris PeBenito 79cde3
## <param name="role">
Chris PeBenito 79cde3
##	The role to be allowed the winbind_helper domain.
Chris PeBenito 79cde3
## </param>
Chris PeBenito 79cde3
## <param name="terminal">
Chris PeBenito 79cde3
##	The type of the terminal allow the winbind_helper domain to use.
Chris PeBenito 79cde3
## </param>
Chris PeBenito 79cde3
#
Chris PeBenito 79cde3
interface(`samba_run_winbind_helper',`
Chris PeBenito 79cde3
	gen_require(`
Chris PeBenito 79cde3
		type winbind_helper_t;
Chris PeBenito 79cde3
	')
Chris PeBenito 79cde3
Chris PeBenito 79cde3
	samba_domtrans_winbind_helper($1)
Chris PeBenito 79cde3
	role $2 types winbind_helper_t;
Chris PeBenito 79cde3
	allow winbind_helper_t $3:chr_file rw_term_perms;
Chris PeBenito 79cde3
')
Chris PeBenito 79cde3
Chris PeBenito 79cde3
########################################
Chris PeBenito 79cde3
## <summary>
Chris PeBenito 79cde3
##	Allow the specified domain to read the winbind pid files.
Chris PeBenito 79cde3
## </summary>
Chris PeBenito 79cde3
## <param name="domain">
Chris PeBenito 79cde3
##	Domain allowed access.
Chris PeBenito 79cde3
## </param>
Chris PeBenito 79cde3
#
Chris PeBenito 79cde3
interface(`samba_read_winbind_pid',`
Chris PeBenito 79cde3
	gen_require(`
Chris PeBenito 79cde3
		type winbind_var_run_t;
Chris PeBenito 79cde3
	')
Chris PeBenito 79cde3
Chris PeBenito 79cde3
	files_search_pids($1)
Chris PeBenito 79cde3
	allow $1 winbind_var_run_t:file r_file_perms;
Chris PeBenito 79cde3
')
Chris PeBenito 79cde3
Chris PeBenito 79cde3
########################################
Chris PeBenito 79cde3
## <summary>
Chris PeBenito 79cde3
##	Allow the specified domain to read the winbind pid files.
Chris PeBenito 79cde3
## </summary>
Chris PeBenito 79cde3
## <param name="domain">
Chris PeBenito 79cde3
##	Domain allowed access.
Chris PeBenito 79cde3
## </param>
Chris PeBenito 79cde3
#
Chris PeBenito 79cde3
interface(`samba_read_winbind_pid',`
Chris PeBenito 79cde3
	gen_require(`
Chris PeBenito 79cde3
		type winbind_var_run_t;
Chris PeBenito 79cde3
	')
Chris PeBenito 79cde3
Chris PeBenito 79cde3
	files_search_pids($1)
Chris PeBenito 79cde3
	allow $1 winbind_var_run_t:file r_file_perms;
Chris PeBenito 79cde3
')