commit:     398957b79b03d3239da9883387bff498c4a281af
Author:     Rahul Sandhu <nvraxn <AT> gmail <DOT> com>
AuthorDate: Wed Jun 11 17:29:16 2025 +0000
Commit:     Kenton Groombridge <concord <AT> gentoo <DOT> org>
CommitDate: Fri Jun 27 18:57:53 2025 +0000
URL:        
https://gitweb.gentoo.org/proj/hardened-refpolicy.git/commit/?id=398957b7

bitcoin: gatekeep call of init_script_readable_type behind Gentoo

The init_script_readable_type interface is a Gentoo-specific one [1],
and is only available on builds where DISTRO = gentoo, hence gatekeep
its calling behind that.

[1] 
https://github.com/gentoo/hardened-refpolicy/blob/356b8ae1e31f8ec2c53d67caf6ac37343a4ab767/policy/modules/system/init.te#L1559-L1561

Signed-off-by: Rahul Sandhu <nvraxn <AT> gmail.com>
Part-of: https://github.com/gentoo/hardened-refpolicy/pull/13
Closes: https://github.com/gentoo/hardened-refpolicy/pull/13
Signed-off-by: Kenton Groombridge <concord <AT> gentoo.org>

 policy/modules/contrib/bitcoin.te | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/policy/modules/contrib/bitcoin.te 
b/policy/modules/contrib/bitcoin.te
index 2852f6b47..38376c758 100644
--- a/policy/modules/contrib/bitcoin.te
+++ b/policy/modules/contrib/bitcoin.te
@@ -22,14 +22,12 @@ init_script_file(bitcoin_initrc_exec_t)
 
 type bitcoin_etc_t;
 files_config_file(bitcoin_etc_t)
-init_script_readable_type(bitcoin_etc_t)
 
 type bitcoin_log_t;
 logging_log_file(bitcoin_log_t)
 
 type bitcoin_var_lib_t;
 files_type(bitcoin_var_lib_t)
-init_script_readable_type(bitcoin_var_lib_t)
 
 type bitcoin_runtime_t alias bitcoin_var_run_t;
 files_runtime_file(bitcoin_runtime_t)
@@ -37,6 +35,11 @@ files_runtime_file(bitcoin_runtime_t)
 type bitcoin_tmp_t;
 files_tmp_file(bitcoin_tmp_t)
 
+ifdef(`distro_gentoo',`
+       init_script_readable_type(bitcoin_etc_t)
+       init_script_readable_type(bitcoin_var_lib_t)
+')
+
 #########################################
 #
 # Local policy

Reply via email to