summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2012-09-20 16:16:03 +0200
committerMichael Adam <obnox@samba.org>2012-09-22 10:18:59 +0200
commit1f8e4732c5870043fbbc22c772404b5380f808f0 (patch)
tree6ad90e558d25a16a2ac38b1cebb3b86f573c5b36 /source3
parent9249871f40aab021d62d3154f8ca286b52f5ef76 (diff)
downloadsamba-1f8e4732c5870043fbbc22c772404b5380f808f0.tar.gz
samba-1f8e4732c5870043fbbc22c772404b5380f808f0.tar.bz2
samba-1f8e4732c5870043fbbc22c772404b5380f808f0.zip
s3:smb2_lock: let smbd_smb2_lock_cancel() trigger NT_STATUS_CANCELED
Instead of violating the tevent_req layers. metze
Diffstat (limited to 'source3')
-rw-r--r--source3/smbd/smb2_lock.c29
1 files changed, 3 insertions, 26 deletions
diff --git a/source3/smbd/smb2_lock.c b/source3/smbd/smb2_lock.c
index 19e1ef07b3..d29ecec867 100644
--- a/source3/smbd/smb2_lock.c
+++ b/source3/smbd/smb2_lock.c
@@ -134,31 +134,6 @@ static void smbd_smb2_request_lock_done(struct tevent_req *subreq)
NTSTATUS status;
NTSTATUS error; /* transport error */
- if (smb2req->cancelled) {
- const uint8_t *inhdr = SMBD_SMB2_IN_HDR_PTR(smb2req);
- uint64_t mid = BVAL(inhdr, SMB2_HDR_MESSAGE_ID);
- struct smbd_smb2_lock_state *state;
-
- DEBUG(10,("smbd_smb2_request_lock_done: cancelled mid %llu\n",
- (unsigned long long)mid ));
-
- state = tevent_req_data(smb2req->subreq,
- struct smbd_smb2_lock_state);
-
- SMB_ASSERT(state);
- SMB_ASSERT(state->blr);
-
- remove_pending_lock(state, state->blr);
-
- error = smbd_smb2_request_error(smb2req, NT_STATUS_CANCELLED);
- if (!NT_STATUS_IS_OK(error)) {
- smbd_server_connection_terminate(smb2req->sconn,
- nt_errstr(error));
- return;
- }
- return;
- }
-
status = smbd_smb2_lock_recv(subreq);
TALLOC_FREE(subreq);
if (!NT_STATUS_IS_OK(status)) {
@@ -407,7 +382,9 @@ static bool smbd_smb2_lock_cancel(struct tevent_req *req)
smb2req = state->smb2req;
smb2req->cancelled = true;
- tevent_req_done(req);
+ remove_pending_lock(state, state->blr);
+ tevent_req_defer_callback(req, smb2req->sconn->ev_ctx);
+ tevent_req_nterror(req, NT_STATUS_CANCELLED);
return true;
}