All of lore.kernel.org
 help / color / mirror / Atom feed
* [refpolicy] [PATCH] Introduce init_manage_service_template interface
@ 2015-05-14 22:28 Jason Zaman
  2015-05-18 12:57 ` Christopher J. PeBenito
  0 siblings, 1 reply; 9+ messages in thread
From: Jason Zaman @ 2015-05-14 22:28 UTC (permalink / raw)
  To: refpolicy

This is to be used where a role needs to start and stop a 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 0e7eaec..7938735 100644
--- a/policy/modules/system/init.if
+++ b/policy/modules/system/init.if
@@ -963,6 +963,46 @@ interface(`init_all_labeled_script_domtrans',`
 
 ########################################
 ## <summary>
+##	Allow the role to start and stop
+##	labeled services.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed to transition.
+##	</summary>
+## </param>
+## <param name="role">
+##	<summary>
+##	The role to be performing this action.
+##	</summary>
+## </param>
+## <param name="domain">
+##	<summary>
+##	Type to be used as a daemon domain.
+##	</summary>
+## </param>
+## <param name="init_script_file">
+##	<summary>
+##	Labeled init script file.
+##	</summary>
+## </param>
+#
+interface(`init_manage_service_template',`
+	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;
+	')
+')
+
+########################################
+## <summary>
 ##	Start and stop daemon programs directly.
 ## </summary>
 ## <desc>
-- 
2.3.6

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2015-05-22 12:40 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-14 22:28 [refpolicy] [PATCH] Introduce init_manage_service_template interface Jason Zaman
2015-05-18 12:57 ` Christopher J. PeBenito
2015-05-18 13:21   ` Jason Zaman
2015-05-18 13:27     ` Sven Vermeulen
2015-05-18 14:11       ` Jason Zaman
2015-05-20 13:02         ` Christopher J. PeBenito
2015-05-20 13:43           ` Jason Zaman
2015-05-22 12:33             ` Christopher J. PeBenito
2015-05-22 12:40               ` Jason Zaman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.