1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

libcli/smb: Ensure we call tevent_req_nterror() on failure

Commit 3594c3ae20 added a NULL check for
'inhdr', but it meant we didn't always call tevent_req_nterror() when we
should.

Now we handle connection errors. We now also set an error status if the
NULL check fails.

I noticed this when an ECONNRESET error from a server refusing SMB1
wasn't handled, and the client subsequently hung in epoll_wait().

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15152

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 40d4912d84)
This commit is contained in:
Joseph Sutton 2022-08-22 15:50:02 +12:00 committed by Jule Anger
parent b75b5f60ba
commit f33ad1c172

View File

@ -4469,7 +4469,11 @@ static void smbXcli_negprot_smb1_done(struct tevent_req *subreq)
NULL, /* pinbuf */
expected, ARRAY_SIZE(expected));
TALLOC_FREE(subreq);
if (inhdr == NULL || tevent_req_nterror(req, status)) {
if (tevent_req_nterror(req, status)) {
return;
}
if (inhdr == NULL) {
tevent_req_nterror(req, NT_STATUS_INTERNAL_ERROR);
return;
}