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 37910138ACE for ; Mon, 15 Dec 2014 18:40:57 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id CB4F7E0914; Mon, 15 Dec 2014 18:40:56 +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 3ED3DE090A for ; Mon, 15 Dec 2014 18:40:56 +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 7E8B8340509 for ; Mon, 15 Dec 2014 18:40:55 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 26ED0C7EF for ; Mon, 15 Dec 2014 18:40:54 +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: <1418668679.538e55cdbf09b5d47ce328ce1da7064487323efc.swift@gentoo> Subject: [gentoo-commits] proj/hardened-refpolicy:master 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: 538e55cdbf09b5d47ce328ce1da7064487323efc X-VCS-Branch: master Date: Mon, 15 Dec 2014 18:40:54 +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: a7561a6e-9c97-4fd8-b07f-c627e92d8376 X-Archives-Hash: fe1b4c538b6f4bef1e8551799a6a0dd6 commit: 538e55cdbf09b5d47ce328ce1da7064487323efc Author: Sven Vermeulen siphos be> AuthorDate: Tue Nov 11 15:58:55 2014 +0000 Commit: Sven Vermeulen gentoo org> CommitDate: Mon Dec 15 18:37:59 2014 +0000 URL: http://sources.gentoo.org/gitweb/?p=proj/hardened-refpolicy.git;a=commit;h=538e55cd Add support for init_script_readable --- policy/modules/system/init.if | 18 ++++++++++++++++++ policy/modules/system/init.te | 6 ++++++ 2 files changed, 24 insertions(+) diff --git a/policy/modules/system/init.if b/policy/modules/system/init.if index 99e42fc..4d923d6 100644 --- a/policy/modules/system/init.if +++ b/policy/modules/system/init.if @@ -1916,3 +1916,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 04b07e1..5d83a49 100644 --- a/policy/modules/system/init.te +++ b/policy/modules/system/init.te @@ -935,12 +935,18 @@ 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) + read_lnk_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)