From 0deae6c407faa86ea871a219ad52fdd285166274 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 19 Sep 2001 04:11:23 +0000 Subject: got rid of bogus write list substitution error messages --- source/smbd/service.c | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) (limited to 'source/smbd/service.c') diff --git a/source/smbd/service.c b/source/smbd/service.c index 4765844460f..beb2d76b44c 100644 --- a/source/smbd/service.c +++ b/source/smbd/service.c @@ -259,27 +259,30 @@ static NTSTATUS share_sanity_checks(int snum, char* service, char *dev) ****************************************************************************/ static void set_read_only(connection_struct *conn) { + char **list; char *service = lp_servicename(conn->service); conn->read_only = lp_readonly(conn->service); - { - char **list; + if (!service) return; - lp_list_copy(&list, lp_readlist(conn->service)); - if(list && lp_list_substitute(list, "%S", service)) { - if (user_in_list(conn->user, list)) - conn->read_only = True; + lp_list_copy(&list, lp_readlist(conn->service)); + if (list) { + if (!lp_list_substitute(list, "%S", service)) { + DEBUG(0, ("ERROR: read list substitution failed\n")); } - else DEBUG(0, ("ERROR: read list substitution failed\n")); - if (list) lp_list_free(&list); - - lp_list_copy(&list, lp_writelist(conn->service)); - if(list && lp_list_substitute(list, "%S", service)) { - if (user_in_list(conn->user, list)) - conn->read_only = False; + if (user_in_list(conn->user, list)) + conn->read_only = True; + lp_list_free(&list); + } + + lp_list_copy(&list, lp_writelist(conn->service)); + if (list) { + if (!lp_list_substitute(list, "%S", service)) { + DEBUG(0, ("ERROR: write list substitution failed\n")); } - else DEBUG(0, ("ERROR: write list substitution failed\n")); - if (list) lp_list_free(&list); + if (user_in_list(conn->user, list)) + conn->read_only = False; + lp_list_free(&list); } } -- cgit