From 39e14916e48a5290e7766aa4f845900365bb42c3 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 7 Mar 2002 18:53:37 +0000 Subject: get the right return code for batch vs exclusive oplocks (This used to be commit 91fc5b2de577019d7646f3c29173b27605d9ba12) --- source3/smbd/nttrans.c | 17 ++++++++++++----- 1 file 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); -- cgit