summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>1998-12-29 19:24:07 +0000
committerJeremy Allison <jra@samba.org>1998-12-29 19:24:07 +0000
commitc31a8d10e9ea9b6f16c02cc2b5d7d2b5a737bccc (patch)
treed86edb063c18a8bd00f18d53cc1a4f8ed632b699
parent507f86b2baa702a0cd73f70d8da9227d47a9c019 (diff)
downloadsamba-c31a8d10e9ea9b6f16c02cc2b5d7d2b5a737bccc.tar.gz
samba-c31a8d10e9ea9b6f16c02cc2b5d7d2b5a737bccc.tar.xz
samba-c31a8d10e9ea9b6f16c02cc2b5d7d2b5a737bccc.zip
In reply_lockread.
Discovered by Menny Hamburger at Mainsoft. This is a core+ protocol request that predates the read/write lock concept. Thus instead of asking for a read lock here we need to ask for a write lock. Jeremy.
-rw-r--r--source/smbd/reply.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/source/smbd/reply.c b/source/smbd/reply.c
index 49982badedd..c6ebd70c423 100644
--- a/source/smbd/reply.c
+++ b/source/smbd/reply.c
@@ -2053,8 +2053,15 @@ int reply_lockread(connection_struct *conn, char *inbuf,char *outbuf, int length
outsize = set_message(outbuf,5,3,True);
numtoread = MIN(BUFFER_SIZE-outsize,numtoread);
data = smb_buf(outbuf) + 3;
-
- if(!do_lock( fsp, conn, numtoread, startpos, F_RDLCK, &eclass, &ecode)) {
+
+ /*
+ * NB. Discovered by Menny Hamburger at Mainsoft. This is a core+
+ * protocol request that predates the read/write lock concept.
+ * Thus instead of asking for a read lock here we need to ask
+ * for a write lock. JRA.
+ */
+
+ if(!do_lock( fsp, conn, numtoread, startpos, F_WRLCK, &eclass, &ecode)) {
if((ecode == ERRlock) && lp_blocking_locks(SNUM(conn))) {
/*
* A blocking lock was requested. Package up