1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00

get the right return code for batch vs exclusive oplocks

This commit is contained in:
Andrew Tridgell 0001-01-01 00:00:00 +00:00
parent bb0ef8bc30
commit 91fc5b2de5

View File

@ -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);