Chris PeBenito 3ffe29
## <summary>Java virtual machine</summary>
Chris PeBenito 3ffe29
Chris PeBenito 296273
########################################
Chris PeBenito 3ffe29
## <summary>
Chris PeBenito 296273
##	Role access for java
Chris PeBenito 3ffe29
## </summary>
Chris PeBenito 296273
## <param name="role">
Chris PeBenito 885b83
##	<summary>
Chris PeBenito 296273
##	Role allowed access
Chris PeBenito 885b83
##	</summary>
Chris PeBenito 3ffe29
## </param>
Chris PeBenito 296273
## <param name="domain">
Chris PeBenito 885b83
##	<summary>
Chris PeBenito 296273
##	User domain for the role
Chris PeBenito 885b83
##	</summary>
Chris PeBenito 3ffe29
## </param>
Chris PeBenito 3ffe29
#
Chris PeBenito 296273
interface(`java_role',`
Chris PeBenito 3ffe29
	gen_require(`
Chris PeBenito 296273
		type java_t, java_exec_t;
Chris PeBenito 3ffe29
	')
Chris PeBenito 2a9837
Chris PeBenito 296273
	role $1 types java_t;
Chris PeBenito 2a9837
Chris PeBenito 3ffe29
	# The user role is authorized for this domain.
Chris PeBenito 296273
	domtrans_pattern($2, java_exec_t, java_t)
Chris PeBenito 296273
	allow java_t $2:process signull;
Chris PeBenito 3ffe29
	# Unrestricted inheritance from the caller.
Chris PeBenito 296273
	allow $2 java_t:process { noatsecure siginh rlimitinh };
Chris PeBenito 3ffe29
Chris PeBenito 296273
	allow java_t $2:unix_stream_socket connectto;
Chris PeBenito 296273
	allow java_t $2:unix_stream_socket { read write };
Chris PeBenito 3ffe29
')
Chris PeBenito 46c69c
Chris PeBenito 46c69c
########################################
Chris PeBenito 46c69c
## <summary>
Chris PeBenito 6b19be
##	Run java in javaplugin domain.
Chris PeBenito 6b19be
## </summary>
Chris PeBenito 6b19be
## <param name="domain">
Chris PeBenito 6b19be
##	<summary>
Chris PeBenito 6b19be
##	Domain allowed access.
Chris PeBenito 6b19be
##	</summary>
Chris PeBenito 6b19be
## </param>
Chris PeBenito 6b19be
#
Chris PeBenito 296273
template(`java_domtrans',`
Chris PeBenito 6b19be
	gen_require(`
Chris PeBenito 296273
		type java_t, java_exec_t;
Chris PeBenito 6b19be
	')
Chris PeBenito 6b19be
Chris PeBenito 296273
	domtrans_pattern($1, java_exec_t, java_t)
Chris PeBenito 6b19be
')
Chris PeBenito 6b19be
Chris PeBenito 6b19be
########################################
Chris PeBenito 6b19be
## <summary>
Chris PeBenito 296273
##	Execute the java program in the unconfined java domain.
Chris PeBenito 46c69c
## </summary>
Chris PeBenito 46c69c
## <param name="domain">
Chris PeBenito 46c69c
##	<summary>
Chris PeBenito 46c69c
##	Domain allowed access.
Chris PeBenito 46c69c
##	</summary>
Chris PeBenito 46c69c
## </param>
Chris PeBenito 46c69c
#
Chris PeBenito 296273
interface(`java_domtrans_unconfined',`
Chris PeBenito 350b6a
	gen_require(`
Chris PeBenito 296273
		type unconfined_java_t, java_exec_t;
Chris PeBenito 46c69c
	')
Chris PeBenito 350b6a
Chris PeBenito 296273
	domtrans_pattern($1, java_exec_t, unconfined_java_t)
Chris PeBenito 350b6a
	corecmd_search_bin($1)
Chris PeBenito 46c69c
')
Chris PeBenito b26482
Chris PeBenito b26482
########################################
Chris PeBenito b26482
## <summary>
Chris PeBenito b26482
##	Execute the java program in the unconfined java domain.
Chris PeBenito b26482
## </summary>
Chris PeBenito b26482
## <param name="domain">
Chris PeBenito b26482
##	<summary>
Chris PeBenito b26482
##	Domain allowed access.
Chris PeBenito b26482
##	</summary>
Chris PeBenito b26482
## </param>
Chris PeBenito b26482
## <param name="role">
Chris PeBenito b26482
##	<summary>
Chris PeBenito b26482
##	Role allowed access.
Chris PeBenito b26482
##	</summary>
Chris PeBenito b26482
## </param>
Chris PeBenito b26482
#
Chris PeBenito b26482
interface(`java_run_unconfined',`
Chris PeBenito b26482
	gen_require(`
Chris PeBenito b26482
		type unconfined_java_t;
Chris PeBenito b26482
	')
Chris PeBenito b26482
Chris PeBenito b26482
	java_domtrans_unconfined($1)
Chris PeBenito b26482
	role $2 types unconfined_java_t;
Chris PeBenito b26482
')