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 B5877138CD3 for ; Tue, 9 Jun 2015 13:24:22 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id B6EA5E0835; Tue, 9 Jun 2015 13:24:19 +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 0E7A5E07E8 for ; Tue, 9 Jun 2015 13:24:18 +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 57FF63409B8 for ; Tue, 9 Jun 2015 13:24:18 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 03B87A09 for ; Tue, 9 Jun 2015 13:24:17 +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: <1432322203.5454b1692fd734babb5b459922136c7dfc7c4aa2.swift@gentoo> Subject: [gentoo-commits] proj/hardened-refpolicy:swift 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: swift X-VCS-Committer-Name: Sven Vermeulen X-VCS-Revision: 5454b1692fd734babb5b459922136c7dfc7c4aa2 X-VCS-Branch: swift Date: Tue, 9 Jun 2015 13:24:17 +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: f125751b-33de-42e4-b676-b1f4a0c764c3 X-Archives-Hash: bf204bbfe1b4c257efbb57403e09d311 commit: 5454b1692fd734babb5b459922136c7dfc7c4aa2 Author: Jason Zaman perfinion com> AuthorDate: Fri May 22 14:08:05 2015 +0000 Commit: Sven Vermeulen gentoo org> CommitDate: Fri May 22 19:16:43 2015 +0000 URL: https://gitweb.gentoo.org/proj/hardened-refpolicy.git/commit/?id=5454b169 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 61db079..acf1fae 100644 --- a/policy/modules/system/init.if +++ b/policy/modules/system/init.if @@ -1008,6 +1008,46 @@ interface(`init_startstop_service',` ######################################## ## +## 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. ## ##