summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2003-09-29 06:18:42 +0000
committerTim Potter <tpot@samba.org>2003-09-29 06:18:42 +0000
commita21e1f781f0bbf783cda6237fa4103deb8a43474 (patch)
tree1c87116742b3d29fe048851ded423ab8aa72a12e
parent3f5f051d0086507280f820d9423009619357612e (diff)
downloadsamba-a21e1f781f0bbf783cda6237fa4103deb8a43474.tar.gz
samba-a21e1f781f0bbf783cda6237fa4103deb8a43474.tar.bz2
samba-a21e1f781f0bbf783cda6237fa4103deb8a43474.zip
Merge from 3.0:
>Ensure %S gets expanded in read/write lists. >Jeremy. (This used to be commit 424acd6ee92c46c565886c3305c3492737538d3d)
-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 */