All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] init dbus patch for GetDynamicUsers
@ 2022-02-16 13:11 Russell Coker
  2022-02-16 15:46 ` Chris PeBenito
  0 siblings, 1 reply; 2+ messages in thread
From: Russell Coker @ 2022-02-16 13:11 UTC (permalink / raw)
  To: selinux-refpolicy

Small patches for dbus access to talk to init for getting dynamic users
with systemd.  The daemons do such checks from library code.

Signed-off-by: Russell Coker <russell@coker.com.au>

Index: refpolicy-2.20220216/policy/modules/services/dictd.te
===================================================================
--- refpolicy-2.20220216.orig/policy/modules/services/dictd.te
+++ refpolicy-2.20220216/policy/modules/services/dictd.te
@@ -79,3 +79,6 @@ optional_policy(`
 	seutil_sigchld_newrole(dictd_t)
 ')
 
+ifdef(`init_systemd',`
+	init_dbus_chat(dictd_t)
+')
Index: refpolicy-2.20220216/policy/modules/services/postfix.te
===================================================================
--- refpolicy-2.20220216.orig/policy/modules/services/postfix.te
+++ refpolicy-2.20220216/policy/modules/services/postfix.te
@@ -376,9 +376,6 @@ manage_lnk_files_pattern(postfix_bounce_
 
 optional_policy(`
 	init_dbus_chat(postfix_bounce_t)
-')
-
-optional_policy(`
 	dbus_system_bus_client(postfix_bounce_t)
 ')
 
@@ -754,6 +751,11 @@ optional_policy(`
 	unconfined_run_to(postfix_showq_t, postfix_showq_exec_t)
 ')
 
+ifdef(`init_systemd',`
+	init_dbus_chat(postfix_showq_t)
+	dbus_system_bus_client(postfix_showq_t)
+')
+
 ########################################
 #
 # Smtp delivery local policy
@@ -778,6 +780,12 @@ optional_policy(`
 ')
 
 optional_policy(`
+	dbus_send_system_bus(postfix_smtp_t)
+	dbus_system_bus_client(postfix_smtp_t)
+	init_dbus_chat(postfix_smtp_t)
+')
+
+optional_policy(`
 	dovecot_stream_connect(postfix_smtp_t)
 ')
 
@@ -815,9 +823,8 @@ optional_policy(`
 ')
 
 optional_policy(`
-	dbus_send_system_bus(postfix_smtp_t)
-	dbus_system_bus_client(postfix_smtp_t)
-	init_dbus_chat(postfix_smtp_t)
+	dbus_system_bus_client(postfix_smtpd_t)
+	init_dbus_chat(postfix_smtpd_t)
 ')
 
 optional_policy(`

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

* Re: [PATCH] init dbus patch for GetDynamicUsers
  2022-02-16 13:11 [PATCH] init dbus patch for GetDynamicUsers Russell Coker
@ 2022-02-16 15:46 ` Chris PeBenito
  0 siblings, 0 replies; 2+ messages in thread
From: Chris PeBenito @ 2022-02-16 15:46 UTC (permalink / raw)
  To: Russell Coker, selinux-refpolicy

On 2/16/2022 08:11, Russell Coker wrote:
> Small patches for dbus access to talk to init for getting dynamic users
> with systemd.  The daemons do such checks from library code.
> 
> Signed-off-by: Russell Coker <russell@coker.com.au>
> 
> Index: refpolicy-2.20220216/policy/modules/services/dictd.te
> ===================================================================
> --- refpolicy-2.20220216.orig/policy/modules/services/dictd.te
> +++ refpolicy-2.20220216/policy/modules/services/dictd.te
> @@ -79,3 +79,6 @@ optional_policy(`
>   	seutil_sigchld_newrole(dictd_t)
>   ')
>   
> +ifdef(`init_systemd',`
> +	init_dbus_chat(dictd_t)
> +')
> Index: refpolicy-2.20220216/policy/modules/services/postfix.te
> ===================================================================
> --- refpolicy-2.20220216.orig/policy/modules/services/postfix.te
> +++ refpolicy-2.20220216/policy/modules/services/postfix.te
> @@ -376,9 +376,6 @@ manage_lnk_files_pattern(postfix_bounce_
>   
>   optional_policy(`
>   	init_dbus_chat(postfix_bounce_t)
> -')
> -
> -optional_policy(`
>   	dbus_system_bus_client(postfix_bounce_t)
>   ')
>   
> @@ -754,6 +751,11 @@ optional_policy(`
>   	unconfined_run_to(postfix_showq_t, postfix_showq_exec_t)
>   ')
>   
> +ifdef(`init_systemd',`
> +	init_dbus_chat(postfix_showq_t)
> +	dbus_system_bus_client(postfix_showq_t)
> +')
> +
>   ########################################
>   #
>   # Smtp delivery local policy
> @@ -778,6 +780,12 @@ optional_policy(`
>   ')
>   
>   optional_policy(`
> +	dbus_send_system_bus(postfix_smtp_t)
> +	dbus_system_bus_client(postfix_smtp_t)
> +	init_dbus_chat(postfix_smtp_t)
> +')
> +
> +optional_policy(`
>   	dovecot_stream_connect(postfix_smtp_t)
>   ')
>   
> @@ -815,9 +823,8 @@ optional_policy(`
>   ')
>   
>   optional_policy(`
> -	dbus_send_system_bus(postfix_smtp_t)
> -	dbus_system_bus_client(postfix_smtp_t)
> -	init_dbus_chat(postfix_smtp_t)
> +	dbus_system_bus_client(postfix_smtpd_t)
> +	init_dbus_chat(postfix_smtpd_t)
>   ')
>   
>   optional_policy(`

Please use systemd_use_nss() instead of the individual dbus and init rules.

-- 
Chris PeBenito

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

end of thread, other threads:[~2022-02-16 15:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-16 13:11 [PATCH] init dbus patch for GetDynamicUsers Russell Coker
2022-02-16 15:46 ` Chris PeBenito

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.