summaryrefslogtreecommitdiffstats
path: root/source3/smbd/smb2_lock.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2014-09-16 08:05:31 +0200
committerMichael Adam <obnox@samba.org>2014-09-19 09:15:12 +0200
commit1d53557df59adc691d726aa2094e877409a7f92c (patch)
tree84202fe5f6dced34676206a93f0674fcf2c0f1c1 /source3/smbd/smb2_lock.c
parent04a9b0a7b23c2256b782bfc5800cf81f7c73c953 (diff)
downloadsamba-1d53557df59adc691d726aa2094e877409a7f92c.tar.gz
samba-1d53557df59adc691d726aa2094e877409a7f92c.tar.xz
samba-1d53557df59adc691d726aa2094e877409a7f92c.zip
s3:smb2_lock: always use tevent_req_defer_callback() if we go async
process_blocking_lock_queue_smb2() can call reprocess_blocked_smb2_lock() multiple times, which results in multiple tevent_req_done() calls. As we could disconnect the connection from there, process_blocking_lock_queue_smb2() could crash as the local state might be destroyed. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
Diffstat (limited to 'source3/smbd/smb2_lock.c')
-rw-r--r--source3/smbd/smb2_lock.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/source3/smbd/smb2_lock.c b/source3/smbd/smb2_lock.c
index 0713892473..29abbb2367 100644
--- a/source3/smbd/smb2_lock.c
+++ b/source3/smbd/smb2_lock.c
@@ -348,6 +348,7 @@ static struct tevent_req *smbd_smb2_lock_send(TALLOC_CTX *mem_ctx,
}
if (async) {
+ tevent_req_defer_callback(req, smb2req->sconn->ev_ctx);
return req;
}
@@ -388,7 +389,6 @@ static bool smbd_smb2_lock_cancel(struct tevent_req *req)
smb2req = state->smb2req;
remove_pending_lock(state, state->blr);
- tevent_req_defer_callback(req, smb2req->sconn->ev_ctx);
/*
* If the request is canceled because of logoff, tdis or close