summaryrefslogtreecommitdiff
path: root/source3/include
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1997-10-27 12:02:34 +0000
committerAndrew Tridgell <tridge@samba.org>1997-10-27 12:02:34 +0000
commit8047228db4d3545da13d87d7b370a38ed0b4c4bb (patch)
treee8b80aa7edc21c240544de78746995e86c3c3942 /source3/include
parentd80700156ea74e46969ebdd29d2d3001b7b1423e (diff)
downloadsamba-8047228db4d3545da13d87d7b370a38ed0b4c4bb.tar.gz
samba-8047228db4d3545da13d87d7b370a38ed0b4c4bb.tar.bz2
samba-8047228db4d3545da13d87d7b370a38ed0b4c4bb.zip
Fixed 2 oplock bugs:
1) the oplock macros in smb.h used | where they should have used &. This means that smbd thought that all clients were always requesting oplocks. This would have _really_ confused smbclient and smbfs when they started receiving async oplock break requests when they don't even know what an oplock is! 2) an oplock break request from a client can be embedded in a normal lockingX request, and will be if the client has batched any lock requests internally. The smbd code assumed that all oplock break requests had num_locks==num_ulocks==0 which is not true. The only thing special about a oplock break request with num_locks==num_ulocks==0 is that no reply is sent. Otherwise it is processed as a normal locking request in addition to the oplock break processing. These two fixes get the MS mail system in Win98 working on a Samba 1.9.18 network drive. Andrew (This used to be commit ed71534df56d0296280dbde1859597fb42002088)
Diffstat (limited to 'source3/include')
-rw-r--r--source3/include/smb.h6
1 files changed, 2 insertions, 4 deletions
diff --git a/source3/include/smb.h b/source3/include/smb.h
index 1869020c0d..7019d41de0 100644
--- a/source3/include/smb.h
+++ b/source3/include/smb.h
@@ -1804,14 +1804,12 @@ extern int unix_ERR_code;
/*
* Core protocol.
*/
-#define CORE_OPLOCK_REQUEST(inbuf) (((CVAL(inbuf,smb_flg)|(1<<5))>>5) | \
- ((CVAL(inbuf,smb_flg)|(1<<6))>>5))
+#define CORE_OPLOCK_REQUEST(inbuf) ((CVAL(inbuf,smb_flg)&((1<<5)|(1<<6)))>>5)
/*
* Extended protocol.
*/
-#define EXTENDED_OPLOCK_REQUEST(inbuf) (((SVAL(inbuf,smb_vwv2)|(1<<1))>>1) | \
- ((SVAL(inbuf,smb_vwv2)|(1<<2))>>1))
+#define EXTENDED_OPLOCK_REQUEST(inbuf) ((SVAL(inbuf,smb_vwv2)&((1<<1)|(1<<2)))>>1)
/* Lock types. */
#define LOCKING_ANDX_SHARED_LOCK 0x1