summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2001-09-19 04:11:23 +0000
committerAndrew Tridgell <tridge@samba.org>2001-09-19 04:11:23 +0000
commit56aa0a274d7bbe7b3a3b28a6043ec69cc97d85f3 (patch)
tree183a159e6b64f8a6cf7f5bd8a7bf599876235d49 /source3
parentaf0d86a9fc2b8a6094bdf79d071f71a8532a1dc9 (diff)
downloadsamba-56aa0a274d7bbe7b3a3b28a6043ec69cc97d85f3.tar.gz
samba-56aa0a274d7bbe7b3a3b28a6043ec69cc97d85f3.tar.bz2
samba-56aa0a274d7bbe7b3a3b28a6043ec69cc97d85f3.zip
got rid of bogus write list substitution error messages
(This used to be commit 0deae6c407faa86ea871a219ad52fdd285166274)
Diffstat (limited to 'source3')
-rw-r--r--source3/smbd/service.c33
1 files changed, 18 insertions, 15 deletions
diff --git a/source3/smbd/service.c b/source3/smbd/service.c
index 4765844460..beb2d76b44 100644
--- a/source3/smbd/service.c
+++ b/source3/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);
}
}