samba_manage_var_files(sambagui_t)
samba_read_secrets(sambagui_t)
samba_initrc_domtrans(sambagui_t)
+ samba_systemctl(sambagui_t)
samba_domtrans_smbd(sambagui_t)
samba_domtrans_nmbd(sambagui_t)
')
/etc/samba/smbpasswd -- gen_context(system_u:object_r:samba_secrets_t,s0)
/etc/samba(/.*)? gen_context(system_u:object_r:samba_etc_t,s0)
+/lib/systemd/system/smb.service -- gen_context(system_u:object_r:samba_unit_file_t,s0)
+
#
# /usr
#
init_labeled_script_domtrans($1, samba_initrc_exec_t)
')
+########################################
+## <summary>
+## Execute samba server in the samba domain.
+## </summary>
+## <param name="domain">
+## <summary>
+## Domain allowed to transition.
+## </summary>
+## </param>
+#
+interface(`samba_systemctl',`
+ gen_require(`
+ type samba_unit_t;
+ type smbd_t;
+ ')
+
+ systemd_exec_systemctl($1)
+ systemd_search_unit_dirs($1)
+ allow $1 samba_unit_t:file read_file_perms;
+ allow $1 samba_unit_t:service all_service_perms;
+
+ ps_process_pattern($1, smbd_t)
+')
+
########################################
## <summary>
## Execute samba net in the samba_net domain.
type samba_initrc_exec_t;
init_script_file(samba_initrc_exec_t)
+type samba_unit_file_t;
+systemd_unit_file(samba_unit_file_t)
+
type samba_log_t;
logging_log_file(samba_log_t)