summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2002-03-07 18:53:37 +0000
committerAndrew Tridgell <tridge@samba.org>2002-03-07 18:53:37 +0000
commit39e14916e48a5290e7766aa4f845900365bb42c3 (patch)
treeac68a8d0638ab13149a9ae1083497676f5af061f
parentfd7cdf6da437a054ff6d84c89e33e6aca85d6345 (diff)
downloadsamba-39e14916e48a5290e7766aa4f845900365bb42c3.tar.gz
samba-39e14916e48a5290e7766aa4f845900365bb42c3.tar.bz2
samba-39e14916e48a5290e7766aa4f845900365bb42c3.zip
get the right return code for batch vs exclusive oplocks
(This used to be commit 91fc5b2de577019d7646f3c29173b27605d9ba12)
-rw-r--r--source3/smbd/nttrans.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c
index 062047b6bd..d9b90c14cb 100644
--- a/source3/smbd/nttrans.c
+++ b/source3/smbd/nttrans.c
@@ -663,7 +663,9 @@ int reply_ntcreate_and_X(connection_struct *conn,
}
oplock_request = (flags & REQUEST_OPLOCK) ? EXCLUSIVE_OPLOCK : 0;
- oplock_request |= (flags & REQUEST_BATCH_OPLOCK) ? BATCH_OPLOCK : 0;
+ if (oplock_request) {
+ oplock_request |= (flags & REQUEST_BATCH_OPLOCK) ? BATCH_OPLOCK : 0;
+ }
/*
* Ordinary file or directory.
@@ -841,12 +843,17 @@ int reply_ntcreate_and_X(connection_struct *conn,
* exclusive & batch here.
*/
- if (smb_action & EXTENDED_OPLOCK_GRANTED)
- SCVAL(p,0, BATCH_OPLOCK_RETURN);
- else if (LEVEL_II_OPLOCK_TYPE(fsp->oplock_type))
+ if (smb_action & EXTENDED_OPLOCK_GRANTED) {
+ if (flags & REQUEST_BATCH_OPLOCK) {
+ SCVAL(p,0, BATCH_OPLOCK_RETURN);
+ } else {
+ SCVAL(p,0, EXCLUSIVE_OPLOCK_RETURN);
+ }
+ } else if (LEVEL_II_OPLOCK_TYPE(fsp->oplock_type)) {
SCVAL(p,0, LEVEL_II_OPLOCK_RETURN);
- else
+ } else {
SCVAL(p,0,NO_OPLOCK_RETURN);
+ }
p++;
SSVAL(p,0,fsp->fnum);