From: Stefan Metzmacher Date: Thu, 25 Jun 2020 20:43:47 +0000 (+0200) Subject: s3:smbd: handle NETWORK_ACCESS_DENIED in smbXsrv_client_connection_pass_loop() X-Git-Tag: samba-4.13.0rc1~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=dbe27672131593390218423acbf20d6a2ea45410;p=thirdparty%2Fsamba.git s3:smbd: handle NETWORK_ACCESS_DENIED in smbXsrv_client_connection_pass_loop() 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 --- 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;