commit: 8965c4d3d3a84629546c3c36e9841cd2f80e2b09 Author: Jason Zaman <jason <AT> perfinion <DOT> com> AuthorDate: Mon Aug 18 09:51:22 2014 +0000 Commit: Jason Zaman <gentoo <AT> perfinion <DOT> com> CommitDate: Sun Aug 31 20:49:57 2014 +0000 URL: http://sources.gentoo.org/gitweb/?p=proj/hardened-refpolicy.git;a=commit;h=8965c4d3
Add java_domain_type interface This interface will enable another domain to use Java without having to domtrans to java_t --- policy/modules/contrib/java.if | 34 ++++++++++++++++++++++++++++++++++ policy/modules/contrib/java.te | 3 +++ 2 files changed, 37 insertions(+) diff --git a/policy/modules/contrib/java.if b/policy/modules/contrib/java.if index acf6a63..f4b9444 100644 --- a/policy/modules/contrib/java.if +++ b/policy/modules/contrib/java.if @@ -327,3 +327,37 @@ template(`java_noatsecure_domtrans',` java_domtrans($1) ') + +####################################### +## <summary> +## The template for using java in a domain. +## </summary> +## <desc> +## <p> +## This template creates a derived domains which are used +## for java applications. +## </p> +## </desc> +## <param name="domain"> +## <summary> +## The type of the domain to be given java privs. +## </summary> +## </param> +# +template(`java_domain_type',` + gen_require(` + attribute java_domain; + type java_exec_t, java_tmp_t, java_tmpfs_t; + type java_home_t; + ') + + ######################################## + # + # Policy + # + + typeattribute $1 java_domain; + + # cannot be called on the attribute, so do it now + auth_use_nsswitch($1) +') diff --git a/policy/modules/contrib/java.te b/policy/modules/contrib/java.te index 11e996d..67af775 100644 --- a/policy/modules/contrib/java.te +++ b/policy/modules/contrib/java.te @@ -120,6 +120,9 @@ ifdef(`distro_gentoo',` manage_dirs_pattern(java_domain, java_home_t, java_home_t) manage_files_pattern(java_domain, java_home_t, java_home_t) userdom_user_home_dir_filetrans(java_domain, java_home_t, dir, ".icedtea") + + manage_lnk_files_pattern(java_domain, java_tmp_t, java_tmp_t) + files_tmp_filetrans(java_domain, java_tmp_t, lnk_file) ') tunable_policy(`allow_java_execstack',`