1ec3d1a
## <summary>helper function for grantpt(3), changes ownship and permissions of pseudotty</summary>
1ec3d1a
1ec3d1a
########################################
1ec3d1a
## <summary>
1ec3d1a
##	Execute a domain transition to run ptchown.
1ec3d1a
## </summary>
1ec3d1a
## <param name="domain">
1ec3d1a
## <summary>
1ec3d1a
##	Domain allowed to transition.
1ec3d1a
## </summary>
1ec3d1a
## </param>
1ec3d1a
#
1ec3d1a
interface(`ptchown_domtrans',`
1ec3d1a
	gen_require(`
1ec3d1a
		type ptchown_t, ptchown_exec_t;
1ec3d1a
	')
1ec3d1a
1ec3d1a
	domtrans_pattern($1, ptchown_exec_t, ptchown_t)
1ec3d1a
')
1ec3d1a
5493ab3
#######################################
5493ab3
## <summary>
5493ab3
##  Execute ptchown in the caller domain.
5493ab3
## </summary>
5493ab3
## <param name="domain">
5493ab3
## <summary>
5493ab3
##  Domain allowed to transition.
5493ab3
## </summary>
5493ab3
## </param>
5493ab3
#
5493ab3
interface(`ptchown_exec',`
5493ab3
    gen_require(`
5493ab3
        type ptchown_exec_t;
5493ab3
    ')
5493ab3
5493ab3
    can_exec($1, ptchown_exec_t)
5493ab3
')
5493ab3
1ec3d1a
########################################
1ec3d1a
## <summary>
1ec3d1a
##	Execute ptchown in the ptchown domain, and
1ec3d1a
##	allow the specified role the ptchown domain.
1ec3d1a
## </summary>
1ec3d1a
## <param name="domain">
1ec3d1a
##	<summary>
1ec3d1a
##	Domain allowed to transition.
1ec3d1a
##	</summary>
1ec3d1a
## </param>
1ec3d1a
## <param name="role">
1ec3d1a
##	<summary>
1ec3d1a
##	Role allowed access.
1ec3d1a
##	</summary>
1ec3d1a
## </param>
1ec3d1a
#
1ec3d1a
interface(`ptchown_run',`
1ec3d1a
	gen_require(`
1ec3d1a
		type ptchown_t;
1ec3d1a
	')
1ec3d1a
1ec3d1a
	ptchown_domtrans($1)
1ec3d1a
	role $2 types ptchown_t;
1ec3d1a
')