Chris PeBenito 58c3da
## <summary>Tools for filesystem management, such as mkfs and fsck.</summary>
Chris PeBenito 58c3da
Chris PeBenito 58c3da
########################################
Chris PeBenito 58c3da
## <desc>
Chris PeBenito 58c3da
##	Execute fs tools in the fstools domain.
Chris PeBenito 58c3da
## </desc>
Chris PeBenito 58c3da
## <param name="domain">
Chris PeBenito 58c3da
##	The type of the process performing this action.
Chris PeBenito 58c3da
## </param>
Chris PeBenito 58c3da
#
Chris PeBenito 58c3da
interface(`fstools_domtrans',`
Chris PeBenito 58c3da
	gen_require(`
Chris PeBenito 58c3da
		type fsadm_t, fsadm_exec_t;
Chris PeBenito 58c3da
		class fd use;
Chris PeBenito 58c3da
		class fifo_file rw_file_perms;
Chris PeBenito 58c3da
	')
Chris PeBenito 58c3da
Chris PeBenito 58c3da
	domain_auto_trans($1,fsadm_exec_t,fsadm_t)
Chris PeBenito 58c3da
Chris PeBenito 58c3da
	allow $1 fsadm_t:fd use;
Chris PeBenito 58c3da
	allow fsadm_t $1:fd use;
Chris PeBenito 58c3da
	allow fsadm_t $1:fifo_file rw_file_perms;
Chris PeBenito 58c3da
	allow fsadm_t $1:process sigchld;
Chris PeBenito 58c3da
')
Chris PeBenito 58c3da
Chris PeBenito 58c3da
########################################
Chris PeBenito 58c3da
## <desc>
Chris PeBenito 58c3da
##	Execute fs tools in the fstools domain, and
Chris PeBenito 58c3da
##	allow the specified role the fs tools domain.
Chris PeBenito 58c3da
## </desc>
Chris PeBenito 58c3da
## <param name="domain">
Chris PeBenito 58c3da
##	The type of the process performing this action.
Chris PeBenito 58c3da
## </param>
Chris PeBenito 58c3da
## <param name="role">
Chris PeBenito 58c3da
##	The role to be allowed the fs tools domain.
Chris PeBenito 58c3da
## </param>
Chris PeBenito 58c3da
## <param name="terminal">
Chris PeBenito 58c3da
##	The type of the terminal allow the fs tools domain to use.
Chris PeBenito 58c3da
## </param>
Chris PeBenito 58c3da
#
Chris PeBenito 58c3da
interface(`fstools_run',`
Chris PeBenito 58c3da
	gen_require(`
Chris PeBenito 58c3da
		type fsadm_t;
Chris PeBenito 58c3da
		class chr_file { getattr read write ioctl };
Chris PeBenito 58c3da
	')
Chris PeBenito 58c3da
Chris PeBenito 58c3da
	fstools_domtrans($1)
Chris PeBenito 58c3da
	role $2 types fsadm_t;
Chris PeBenito 58c3da
	allow fsadm_t $3:chr_file { getattr read write ioctl };
Chris PeBenito 58c3da
')
Chris PeBenito 58c3da
Chris PeBenito 58c3da
########################################
Chris PeBenito 58c3da
##     <desc>
Chris PeBenito 58c3da
##             Execute fsadm in the caller domain.
Chris PeBenito 58c3da
##     </desc>
Chris PeBenito 58c3da
##     <param name="domain">
Chris PeBenito 58c3da
##             The type of the process performing this action.
Chris PeBenito 58c3da
##     </param>
Chris PeBenito 58c3da
#
Chris PeBenito 58c3da
interface(`fstools_exec',`
Chris PeBenito 58c3da
	gen_require(`
Chris PeBenito 58c3da
		type fsadm_exec_t;
Chris PeBenito 58c3da
	')
Chris PeBenito 58c3da
Chris PeBenito 58c3da
	can_exec($1,fsadm_exec_t)
Chris PeBenito 58c3da
')