Blob Blame History Raw
## <module name="usermanage">
## <summary>Policy for managing user accounts.</summary>

########################################
## <interface name="usermanage_domtrans_chfn">
##	<desc>
##		Execute chfn in the chfn domain.
##	</desc>
##	<param name="domain">
##		The type of the process performing this action.
##	</param>
## </interface>
#
interface(`usermanage_domtrans_chfn',`
	gen_require(`
		type chfn_t, chfn_exec_t;
		class process sigchld;
		class fd use;
		class fifo_file rw_file_perms;
	')

	files_search_usr($1)
	corecmd_search_bin($1)
	domain_auto_trans($1,chfn_exec_t,chfn_t)

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

########################################
## <interface name="usermanage_run_chfn">
##	<desc>
##		Execute chfn in the chfn domain, and
##		allow the specified role the chfn domain.
##	</desc>
##	<param name="domain">
##		The type of the process performing this action.
##	</param>
##	<param name="role">
##		The role to be allowed the chfn domain.
##	</param>
##	<param name="terminal">
##		The type of the terminal allow the chfn domain to use.
##	</param>
## </interface>
#
interface(`usermanage_run_chfn',`
	gen_require(`
		type chfn_t;
		class chr_file rw_term_perms;
	')

	usermanage_domtrans_chfn($1)
	role $2 types chfn_t;
	allow chfn_t $3:chr_file rw_term_perms;
')

########################################
## <interface name="usermanage_domtrans_groupadd">
##	<desc>
##		Execute groupadd in the groupadd domain.
##	</desc>
##	<param name="domain">
##		The type of the process performing this action.
##	</param>
## </interface>
#
interface(`usermanage_domtrans_groupadd',`
	gen_require(`
		type groupadd_t, groupadd_exec_t;
		class process sigchld;
		class fd use;
		class fifo_file rw_file_perms;
	')

	files_search_usr($1)
	corecmd_search_sbin($1)
	domain_auto_trans($1,groupadd_exec_t,groupadd_t)

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

########################################
## <interface name="usermanage_run_groupadd">
##	<desc>
##		Execute groupadd in the groupadd domain, and
##		allow the specified role the groupadd domain.
##	</desc>
##	<param name="domain">
##		The type of the process performing this action.
##	</param>
##	<param name="role">
##		The role to be allowed the groupadd domain.
##	</param>
##	<param name="terminal">
##		The type of the terminal allow the groupadd domain to use.
##	</param>
## </interface>
#
interface(`usermanage_run_groupadd',`
	gen_require(`
		type groupadd_t;
		class chr_file rw_term_perms;
	')

	usermanage_domtrans_groupadd($1)
	role $2 types groupadd_t;
	allow groupadd_t $3:chr_file rw_term_perms;
')

########################################
## <interface name="usermanage_domtrans_passwd">
##	<desc>
##		Execute passwd in the passwd domain.
##	</desc>
##	<param name="domain">
##		The type of the process performing this action.
##	</param>
## </interface>
#
interface(`usermanage_domtrans_passwd',`
	gen_require(`
		type passwd_t, passwd_exec_t;
		class process sigchld;
		class fd use;
		class fifo_file rw_file_perms;
	')

	files_search_usr($1)
	corecmd_search_bin($1)
	domain_auto_trans($1,passwd_exec_t,passwd_t)

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

########################################
## <interface name="usermanage_run_passwd">
##	<desc>
##		Execute passwd in the passwd domain, and
##		allow the specified role the passwd domain.
##	</desc>
##	<param name="domain">
##		The type of the process performing this action.
##	</param>
##	<param name="role">
##		The role to be allowed the passwd domain.
##	</param>
##	<param name="terminal">
##		The type of the terminal allow the passwd domain to use.
##	</param>
## </interface>
#
interface(`usermanage_run_passwd',`
	gen_require(`
		type passwd_t;
		class chr_file rw_term_perms;
	')

	usermanage_domtrans_passwd($1)
	role $2 types passwd_t;
	allow passwd_t $3:chr_file rw_term_perms;
')

########################################
## <interface name="usermanage_domtrans_useradd">
##	<desc>
##		Execute useradd in the useradd domain.
##	</desc>
##	<param name="domain">
##		The type of the process performing this action.
##	</param>
## </interface>
#
interface(`usermanage_domtrans_useradd',`
	gen_require(`
		type useradd_t, useradd_exec_t;
		class process sigchld;
		class fd use;
		class fifo_file rw_file_perms;
	')

	files_search_usr($1)
	corecmd_search_sbin($1)
	domain_auto_trans($1,useradd_exec_t,useradd_t)

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

########################################
## <interface name="usermanage_run_useradd">
##	<desc>
##		Execute useradd in the useradd domain, and
##		allow the specified role the useradd domain.
##	</desc>
##	<param name="domain">
##		The type of the process performing this action.
##	</param>
##	<param name="role">
##		The role to be allowed the useradd domain.
##	</param>
##	<param name="terminal">
##		The type of the terminal allow the useradd domain to use.
##	</param>
## </interface>
#
interface(`usermanage_run_useradd',`
	gen_require(`
		type useradd_t;
		class chr_file rw_term_perms;
	')

	usermanage_domtrans_useradd($1)
	role $2 types useradd_t;
	allow useradd_t $3:chr_file rw_term_perms;
')

## </module>