Blob Blame History Raw
## <summary>Policy for changing the system host name.</summary>

########################################
## <summary>
##	Execute hostname in the hostname domain.
## </summary>
## <param name="domain">
##	The type of the process performing this action.
## </param>
#
interface(`hostname_domtrans',`
	gen_require(`
		type hostname_t, hostname_exec_t;
	')

	corecmd_search_bin($1)
	domain_auto_trans($1,hostname_exec_t,hostname_t)

	allow $1 hostname_t:fd use;
	allow hostname_t $1:fd use;
	allow hostname_t $1:fifo_file rw_file_perms;
	allow hostname_t $1:process sigchld;
')

########################################
## <summary>
##	Execute hostname in the hostname domain, and
##	allow the specified role the hostname domain.
## </summary>
## <param name="domain">
##	The type of the process performing this action.
## </param>
## <param name="role">
##	The role to be allowed the hostname domain.
## </param>
## <param name="terminal">
##	The type of the terminal allow the hostname domain to use.
## </param>
#
interface(`hostname_run',`
	gen_require(`
		type hostname_t;
	')

	hostname_domtrans($1)
	role $2 types hostname_t;
	allow hostname_t $3:chr_file { getattr read write ioctl };
')

########################################
##     <summary>
##             Execute hostname in the caller domain.
##     </summary>
##     <param name="domain">
##             The type of the process performing this action.
##     </param>
#
interface(`hostname_exec',`
	gen_require(`
		type hostname_exec_t;
	')

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