diff options
author | Volker Lendecke <vl@samba.org> | 2020-08-11 17:44:42 +0200 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2020-08-21 19:14:33 +0000 |
commit | 2a2a6b27cccb2409d321c7e03feb8baa047d1bf4 (patch) | |
tree | b160955bb7d7623f98c7db7c3b86e8fec96db423 /source3 | |
parent | f745f5b12560dbcb7be6f3ffb3bc10704c87149c (diff) | |
download | samba-2a2a6b27cccb2409d321c7e03feb8baa047d1bf4.tar.gz |
tldap: Make sure all requests are cancelled on rundown
Put messages into the ld->pending array before sending them out, not
after they have been sent.
Bug: https://bugzilla.samba.org/show_bug.cgi?id=14465
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'source3')
-rw-r--r-- | source3/lib/tldap.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/source3/lib/tldap.c b/source3/lib/tldap.c index de9f0c70ff1..52012ab9a55 100644 --- a/source3/lib/tldap.c +++ b/source3/lib/tldap.c @@ -29,6 +29,7 @@ #include "../lib/util/tevent_unix.h" static TLDAPRC tldap_simple_recv(struct tevent_req *req); +static bool tldap_msg_set_pending(struct tevent_req *req); #define TEVENT_TLDAP_RC_MAGIC (0x87bcd26e) @@ -521,6 +522,11 @@ static struct tevent_req *tldap_msg_send(TALLOC_CTX *mem_ctx, return tevent_req_post(req, ev); } + if (!tldap_msg_set_pending(req)) { + tevent_req_oom(req); + return tevent_req_post(req, ev);; + } + state->iov.iov_base = (void *)blob.data; state->iov.iov_len = blob.length; @@ -633,12 +639,6 @@ static void tldap_msg_sent(struct tevent_req *subreq) TALLOC_FREE(subreq); if (nwritten == -1) { tldap_context_disconnect(state->ld, TLDAP_SERVER_DOWN); - tevent_req_ldap_error(req, TLDAP_SERVER_DOWN); - return; - } - - if (!tldap_msg_set_pending(req)) { - tevent_req_oom(req); return; } } |