summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2009-07-07 15:16:21 +0200
committerJeremy Allison <jra@samba.org>2009-07-07 11:14:27 -0700
commita830a3f9e292931acd90b5cf5cdffc6e83ea00c7 (patch)
treebb88465f9776360e1c3cfba0a24d8365c1c7b668
parent6dd6ccbdc9451678180e0346780b0a5bf9cda229 (diff)
downloadsamba-a830a3f9e292931acd90b5cf5cdffc6e83ea00c7.tar.gz
samba-a830a3f9e292931acd90b5cf5cdffc6e83ea00c7.tar.bz2
samba-a830a3f9e292931acd90b5cf5cdffc6e83ea00c7.zip
s3:smbd: cancel all locks that are made before the first failure
s3:smbd: cancel all locks that are made before the first failure We never reached the cleanup code and directly returned the error. metze
-rw-r--r--source3/smbd/reply.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index 8700146859..c07ac33679 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -7491,18 +7491,18 @@ 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 (num_locks != 0 && !NT_STATUS_IS_OK(status)) {
+
+ if (locktype & LOCKING_ANDX_CANCEL_LOCK) {
+ i = -1; /* we want to skip the for loop */
+ }
- if (!(locktype & LOCKING_ANDX_CANCEL_LOCK) &&
- (i != num_locks) &&
- (num_locks != 0)) {
/*
* 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