From dbe27672131593390218423acbf20d6a2ea45410 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 25 Jun 2020 22:43:47 +0200 Subject: [PATCH] s3:smbd: handle NETWORK_ACCESS_DENIED in smbXsrv_client_connection_pass_loop() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit smbd_add_connection() may return a valid connection together with NT_STATUS_NETWORK_ACCESS_DENIED. We need additional cleanup for that case. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11898 Signed-off-by: Stefan Metzmacher Reviewed-by: Günther Deschner --- source3/smbd/smbXsrv_client.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source3/smbd/smbXsrv_client.c b/source3/smbd/smbXsrv_client.c index f61ab3da35b..ece88598672 100644 --- a/source3/smbd/smbXsrv_client.c +++ b/source3/smbd/smbXsrv_client.c @@ -680,6 +680,10 @@ static void smbXsrv_client_connection_pass_loop(struct tevent_req *subreq) sock_fd, pass_info0->initial_connect_time, &xconn); + if (NT_STATUS_EQUAL(status, NT_STATUS_NETWORK_ACCESS_DENIED)) { + DLIST_REMOVE(client->connections, xconn); + TALLOC_FREE(xconn); + } if (!NT_STATUS_IS_OK(status)) { close(sock_fd); sock_fd = -1; -- 2.47.3