summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2003-09-26 21:03:32 +0000
committerJeremy Allison <jra@samba.org>2003-09-26 21:03:32 +0000
commit05b178ab82748872bf9dc49887239ddf66ab49b2 (patch)
tree258cd234e7df8cfa3b1ab796b97896e81130f4d5 /source3
parent26e4e6208ae5f0cd4eccbef4fa97446d4f750f00 (diff)
downloadsamba-05b178ab82748872bf9dc49887239ddf66ab49b2.tar.gz
samba-05b178ab82748872bf9dc49887239ddf66ab49b2.tar.bz2
samba-05b178ab82748872bf9dc49887239ddf66ab49b2.zip
Ensure %S gets expanded in read/write lists.
Jeremy. (This used to be commit 7d7096fc3a899349b46691dcc30b86b04964fe52)
Diffstat (limited to 'source3')
-rw-r--r--source3/smbd/service.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/source3/smbd/service.c b/source3/smbd/service.c
index 44d73b2ab2..e4c3890f86 100644
--- a/source3/smbd/service.c
+++ b/source3/smbd/service.c
@@ -259,23 +259,27 @@ static NTSTATUS share_sanity_checks(int snum, fstring dev)
return NT_STATUS_OK;
}
-
/****************************************************************************
readonly share?
****************************************************************************/
+
static void set_read_only(connection_struct *conn, gid_t *groups, size_t n_groups)
{
char **list;
- char *service = lp_servicename(conn->service);
+ const char *service = lp_servicename(conn->service);
conn->read_only = lp_readonly(conn->service);
- if (!service) return;
+ if (!service)
+ return;
str_list_copy(&list, lp_readlist(conn->service));
if (list) {
- if ( !str_list_sub_basic(list, current_user_info.smb_name) ) {
+ if (!str_list_sub_basic(list, current_user_info.smb_name) ) {
DEBUG(0, ("ERROR: read list substitution failed\n"));
}
+ if (!str_list_substitute(list, "%S", service)) {
+ DEBUG(0, ("ERROR: read list service substitution failed\n"));
+ }
if (user_in_list(conn->user, (const char **)list, groups, n_groups))
conn->read_only = True;
str_list_free(&list);
@@ -283,19 +287,22 @@ static void set_read_only(connection_struct *conn, gid_t *groups, size_t n_group
str_list_copy(&list, lp_writelist(conn->service));
if (list) {
- if ( !str_list_sub_basic(list, current_user_info.smb_name) ) {
+ if (!str_list_sub_basic(list, current_user_info.smb_name) ) {
DEBUG(0, ("ERROR: write list substitution failed\n"));
}
+ if (!str_list_substitute(list, "%S", service)) {
+ DEBUG(0, ("ERROR: write list service substitution failed\n"));
+ }
if (user_in_list(conn->user, (const char **)list, groups, n_groups))
conn->read_only = False;
str_list_free(&list);
}
}
-
/****************************************************************************
admin user check
****************************************************************************/
+
static void set_admin_user(connection_struct *conn, gid_t *groups, size_t n_groups)
{
/* admin user check */