From fcd2aa703e578b4ea3ebc9d3ee8fd4624f737b40 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 7 Jul 2009 13:33:05 -0700 Subject: [PATCH] s3:smbd: cancel all locks that are made before the first failure We never reached the cleanup code and directly returned the error. metze --- source/smbd/reply.c | 13 +++++++------ 1 files changed, 7 insertions(+), 6 deletions(-) diff --git a/source/smbd/reply.c b/source/smbd/reply.c index 46653cd..7c26c08 100644 --- a/source/smbd/reply.c +++ b/source/smbd/reply.c @@ -7027,18 +7027,19 @@ void reply_lockingX(struct smb_request *req) } if (NT_STATUS_V(status)) { - END_PROFILE(SMBlockingX); - reply_nterror(req, status); - return; + break; } } /* If any of the above locks failed, then we must unlock all of the previous locks (X/Open spec). */ - if (!(locktype & LOCKING_ANDX_CANCEL_LOCK) && - (i != num_locks) && - (num_locks != 0)) { + if (num_locks != 0 && !NT_STATUS_IS_OK(status)) { + + if (locktype & LOCKING_ANDX_CANCEL_LOCK) { + i = -1; /* we want to skip the for loop */ + } + /* * Ensure we don't do a remove on the lock that just failed, * as under POSIX rules, if we have a lock already there, we -- 1.5.4.3