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 03E56138CD0 for ; Fri, 22 May 2015 19:32:40 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 73564E0876; Fri, 22 May 2015 19:32:39 +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 00B14E0909 for ; Fri, 22 May 2015 19:32: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 5534B340BEA for ; Fri, 22 May 2015 19:32:28 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 9C2589F6 for ; Fri, 22 May 2015 19:32:23 +0000 (UTC) From: "Jason Zaman" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Jason Zaman" Message-ID: <1432322203.c2986eed04bbae7ef6ff1bdad6df31022abdc970.perfinion@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 X-VCS-Directories: policy/modules/system/ X-VCS-Committer: perfinion X-VCS-Committer-Name: Jason Zaman X-VCS-Revision: c2986eed04bbae7ef6ff1bdad6df31022abdc970 X-VCS-Branch: master Date: Fri, 22 May 2015 19:32:23 +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: c9e37195-3a2f-45d1-ba91-8c666c8eacf9 X-Archives-Hash: be62babbe73ecada126cbc12cd97eb2b commit: c2986eed04bbae7ef6ff1bdad6df31022abdc970 Author: Jason Zaman perfinion com> AuthorDate: Tue May 12 20:03:40 2015 +0000 Commit: Jason Zaman gentoo org> CommitDate: Fri May 22 19:16:43 2015 +0000 URL: https://gitweb.gentoo.org/proj/hardened-refpolicy.git/commit/?id=c2986eed Introduce init_startstop_service interface This is to be used where a role needs to start and stop a labeled service. It centralizes all the rules for redhat < 6 sysvinit that were used in the _admin interfaces. The rules for other inits will be added later. policy/modules/system/init.if | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/policy/modules/system/init.if b/policy/modules/system/init.if index 1f897d2..61db079 100644 --- a/policy/modules/system/init.if +++ b/policy/modules/system/init.if @@ -968,6 +968,46 @@ interface(`init_all_labeled_script_domtrans',` ######################################## ## +## Allow the role to start and stop +## labeled services. +## +## +## +## Domain allowed to transition. +## +## +## +## +## The role to be performing this action. +## +## +## +## +## Type to be used as a daemon domain. +## +## +## +## +## Labeled init script file. +## +## +# +interface(`init_startstop_service',` + gen_require(` + role system_r; + ') + + ifndef(`direct_sysadm_daemon',` + # rules for sysvinit / upstart + init_labeled_script_domtrans($1, $4) + domain_system_change_exemption($1) + role_transition $2 $4 system_r; + allow $2 system_r; + ') +') + +######################################## +## ## Start and stop daemon programs directly. ## ##