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 BCEF5138A1A for ; Sun, 23 Nov 2014 14:06:24 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id F2133E086E; Sun, 23 Nov 2014 14:06:17 +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 6A65CE0851 for ; Sun, 23 Nov 2014 14:06:16 +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 889E13404F0 for ; Sun, 23 Nov 2014 14:06:15 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id BAB86ABFB for ; Sun, 23 Nov 2014 14:06:11 +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: <1416751512.dee50b31c6dc717c65323de7df18f8a7a8d37400.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: dee50b31c6dc717c65323de7df18f8a7a8d37400 X-VCS-Branch: bitcoin Date: Sun, 23 Nov 2014 14:06:11 +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: 380a9f2c-9edc-4fbb-9085-dfbffec72334 X-Archives-Hash: 49b810e945c85534836b78648157e8ff commit: dee50b31c6dc717c65323de7df18f8a7a8d37400 Author: Sven Vermeulen siphos be> AuthorDate: Tue Nov 11 15:58:55 2014 +0000 Commit: Sven Vermeulen gentoo org> CommitDate: Sun Nov 23 14:05:12 2014 +0000 URL: http://sources.gentoo.org/gitweb/?p=proj/hardened-refpolicy.git;a=commit;h=dee50b31 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 cd2b0e4..6fd1d7f 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)