From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id ADD2E138825 for ; Tue, 11 Nov 2014 16:00:35 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 1D03FE0B12; Tue, 11 Nov 2014 16:00:34 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 97BE9E0B12 for ; Tue, 11 Nov 2014 16:00:33 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 62ED4340536 for ; Tue, 11 Nov 2014 16:00:32 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 0834C9EC2 for ; Tue, 11 Nov 2014 16:00:31 +0000 (UTC) From: "Sven Vermeulen" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sven Vermeulen" Message-ID: <1415721546.91b06086bea526e22411773d54c897ef06d85861.swift@gentoo> Subject: [gentoo-commits] proj/hardened-refpolicy:bitcoin commit in: policy/modules/system/ X-VCS-Repository: proj/hardened-refpolicy X-VCS-Files: policy/modules/system/init.if policy/modules/system/init.te X-VCS-Directories: policy/modules/system/ X-VCS-Committer: swift X-VCS-Committer-Name: Sven Vermeulen X-VCS-Revision: 91b06086bea526e22411773d54c897ef06d85861 X-VCS-Branch: bitcoin Date: Tue, 11 Nov 2014 16:00:31 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: abb348aa-403d-4e00-9d22-907a13e2b0ab X-Archives-Hash: 81ec3c1e4d59fb4a02321d827389a9ee commit: 91b06086bea526e22411773d54c897ef06d85861 Author: Sven Vermeulen siphos be> AuthorDate: Tue Nov 11 15:58:55 2014 +0000 Commit: Sven Vermeulen gentoo org> CommitDate: Tue Nov 11 15:59:06 2014 +0000 URL: http://sources.gentoo.org/gitweb/?p=proj/hardened-refpolicy.git;a=commit;h=91b06086 Add support for init_script_readable --- policy/modules/system/init.if | 18 ++++++++++++++++++ policy/modules/system/init.te | 5 +++++ 2 files changed, 23 insertions(+) diff --git a/policy/modules/system/init.if b/policy/modules/system/init.if index 2b7793a..7cdf3a8 100644 --- a/policy/modules/system/init.if +++ b/policy/modules/system/init.if @@ -1906,3 +1906,21 @@ interface(`init_relabelto_script_state',` relabelto_files_pattern($1, initrc_state_t, initrc_state_t) relabelto_dirs_pattern($1, initrc_state_t, initrc_state_t) ') + +######################################### +## +## Mark as a readable type for the initrc_t domain +## +## +## +## Type that initrc_t needs read access to +## +## +# +interface(`init_script_readable_type',` + gen_require(` + attribute init_script_readable; + ') + + typeattribute $1 init_script_readable; +') diff --git a/policy/modules/system/init.te b/policy/modules/system/init.te index cd2b0e4..cd3d18d 100644 --- a/policy/modules/system/init.te +++ b/policy/modules/system/init.te @@ -935,12 +935,17 @@ optional_policy(` ') ifdef(`distro_gentoo',` + # Attribute to assign to types that the initrc_t domain needs read access to + attribute init_script_readable; + ##################################### # # Local initrc_t policy # allow initrc_t self:capability sys_admin; + read_files_pattern(initrc_t, init_script_readable, init_script_readable) + manage_dirs_pattern(initrc_t, initrc_var_run_t, initrc_var_run_t) files_pid_filetrans(initrc_t, initrc_var_run_t, dir)