From: Mike Edenfield <kutulu@kutulu.org>
To: SELinux Mailing List <selinux@tycho.nsa.gov>
Subject: [refpolicy patch, second try] samba policy updates
Date: Mon, 28 Jul 2008 12:00:58 -0400 [thread overview]
Message-ID: <488DED3A.1030005@kutulu.org> (raw)
[-- Attachment #1: Type: text/plain, Size: 245 bytes --]
* Allow winbindd to manage its own sockets
* Allow nbmd to rename log files
* Add new interface to encapsulate home directory creation.
* Provide tunable policy to allow samba to create home directories on
system without oddjobs PAM module.
[-- Attachment #2: samba.patch --]
[-- Type: text/plain, Size: 3321 bytes --]
Index: modules/services/samba.if
===================================================================
--- modules/services/samba.if (revision 2767)
+++ modules/services/samba.if (working copy)
@@ -484,17 +484,17 @@
## </param>
#
interface(`samba_stream_connect_winbind',`
- ifdef(`distro_redhat',`
- gen_require(`
- type samba_var_t, winbind_t, winbind_var_run_t;
- ')
+ gen_require(`
+ type samba_var_t, winbind_t, winbind_var_run_t;
+ ')
- files_search_pids($1)
- allow $1 samba_var_t:dir search_dir_perms;
- stream_connect_pattern($1, winbind_var_run_t, winbind_var_run_t, winbind_t)
- ',`
+ files_search_pids($1)
+ allow $1 samba_var_t:dir search_dir_perms;
+ stream_connect_pattern($1, winbind_var_run_t, winbind_var_run_t, winbind_t)
+
+ ifndef(`distro_redhat', `
gen_require(`
- type winbind_t, winbind_tmp_t;
+ type winbind_tmp_t;
')
# the default for the socket is (poorly named):
Index: modules/services/samba.te
===================================================================
--- modules/services/samba.te (revision 2767)
+++ modules/services/samba.te (working copy)
@@ -59,6 +59,13 @@
## </desc>
gen_tunable(samba_share_nfs, false)
+## <desc>
+## <p>
+## Allow samba to create new home directories (e.g. via PAM)
+## </p>
+## </desc>
+gen_tunable(samba_create_home_dirs, false)
+
type nmbd_t;
type nmbd_exec_t;
init_daemon_domain(nmbd_t, nmbd_exec_t)
@@ -379,6 +386,14 @@
unprivuser_home_dir_filetrans_home_content(nmbd_t, { file dir })
')
+tunable_policy(`samba_create_home_dirs',`
+ ifdef(`distro_redhat', `
+ refpolicywarn(`Use of samba_create_home_dirs is discouraged. Please use pam_oddjob_mkhomedir instead.')
+ ', `
+ unprivuser_create_home_dirs(smbd_t)
+ allow smbd_t self:capability chown;
+ ')
+')
########################################
#
# nmbd Local policy
@@ -404,8 +419,7 @@
read_files_pattern(nmbd_t, samba_etc_t, samba_etc_t)
manage_dirs_pattern(nmbd_t, samba_log_t, samba_log_t)
-append_files_pattern(nmbd_t, samba_log_t, samba_log_t)
-allow nmbd_t samba_log_t:file unlink;
+manage_files_pattern(nmbd_t, samba_log_t, samba_log_t)
read_files_pattern(nmbd_t, samba_log_t, samba_log_t)
create_files_pattern(nmbd_t, samba_log_t, samba_log_t)
@@ -675,6 +689,7 @@
manage_dirs_pattern(winbind_t, winbind_tmp_t, winbind_tmp_t)
manage_files_pattern(winbind_t, winbind_tmp_t, winbind_tmp_t)
+manage_sock_files_pattern(winbind_t, winbind_tmp_t, winbind_tmp_t)
files_tmp_filetrans(winbind_t, winbind_tmp_t, { file dir })
manage_files_pattern(winbind_t, winbind_var_run_t, winbind_var_run_t)
Index: modules/roles/unprivuser.if
===================================================================
--- modules/roles/unprivuser.if (revision 2767)
+++ modules/roles/unprivuser.if (working copy)
@@ -146,6 +146,22 @@
########################################
## <summary>
+## Create new home directories with the proper
+## home directory label.
+## </summary>
+## <param name="domain">
+## <summary>
+## Domain allowed access.
+## </summary>
+## </param>
+#
+interface(`unprivuser_create_home_dirs',`
+ unprivuser_home_filetrans_home_dir($1)
+ unprivuser_manage_home_dirs($1)
+')
+
+########################################
+## <summary>
## Create, read, write, and delete
## subdirectories of generic user
## home directories.
next reply other threads:[~2008-07-28 15:58 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-28 16:00 Mike Edenfield [this message]
2008-07-29 14:47 ` [refpolicy patch, second try] samba policy updates Chris PeBenito
2008-07-29 17:38 ` Mike Edenfield
2008-07-29 19:54 ` Chris PeBenito
2008-07-29 21:22 ` Mike Edenfield
2008-07-31 12:56 ` Christopher J. PeBenito
2008-07-31 16:27 ` Mike Edenfield
2008-07-31 18:06 ` Christopher J. PeBenito
2008-07-31 18:24 ` Mike Edenfield
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=488DED3A.1030005@kutulu.org \
--to=kutulu@kutulu.org \
--cc=selinux@tycho.nsa.gov \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.