diff options
author | Jeremy Allison <jra@samba.org> | 2009-12-04 14:04:08 -0800 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2009-12-04 14:04:08 -0800 |
commit | 32915ceefc718621e2e9b17fee97da82744ab67a (patch) | |
tree | 1cc86482f9a9e0210e060b8c6343e3706e59fa67 /source3/smbd | |
parent | 1d3942c534791e7767b64be383e6e035b164c506 (diff) | |
download | samba-32915ceefc718621e2e9b17fee97da82744ab67a.tar.gz samba-32915ceefc718621e2e9b17fee97da82744ab67a.tar.bz2 samba-32915ceefc718621e2e9b17fee97da82744ab67a.zip |
Make Samba3 pass the RAW-LOCK test as Windows.
Implement the win7 NT_STATUS_INVALID_LOCK_RANGE.
Make smbd behave as Windows does in canceling locks.
Jeremy.
Diffstat (limited to 'source3/smbd')
-rw-r--r-- | source3/smbd/reply.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index 030939f524..185f6014d1 100644 --- a/source3/smbd/reply.c +++ b/source3/smbd/reply.c @@ -7038,6 +7038,30 @@ NTSTATUS smbd_do_locking(struct smb_request *req, if (type & LOCKING_ANDX_CANCEL_LOCK) { struct blocking_lock_record *blr = NULL; + if (num_locks > 1) { + /* + * MS-CIFS (2.2.4.32.1) states that a cancel is honored if and only + * if the lock vector contains one entry. When given mutliple cancel + * requests in a single PDU we expect the server to return an + * error. Windows servers seem to accept the request but only + * cancel the first lock. + * JRA - Do what Windows does (tm) :-). + */ + +#if 0 + /* MS-CIFS (2.2.4.32.1) behavior. */ + return NT_STATUS_DOS(ERRDOS, + ERRcancelviolation); +#else + /* Windows behavior. */ + if (i != 0) { + DEBUG(10,("smbd_do_locking: ignoring subsequent " + "cancel request\n")); + continue; + } +#endif + } + if (lp_blocking_locks(SNUM(conn))) { /* Schedule a message to ourselves to |