1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

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>
This commit is contained in:
Stefan Metzmacher 2014-09-16 08:05:31 +02:00 committed by Michael Adam
parent 04a9b0a7b2
commit 1d53557df5

View File

@ -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