[PATCH] Fix for reopened bug 9175

Ralph Böhme slow at samba.org
Mon Nov 12 11:17:59 UTC 2018


Hi metze,

shall we apply the attached patch?

I guess these days we have better error checking in winbindd so reconnecting is 
mostly handled nicely from the upper layers. Not sure if we now want to enable 
the lower level band aid given that it seems to be working ok without.

Otoh, seeing that reset_cm_connection_on_error() doesn't handle 
NT_STATUS_NETWORK_SESSION_EXPIRED makes me a wonder how this is handled.

Thanks!
-slow

-- 
Ralph Boehme, Samba Team       https://samba.org/
Samba Developer, SerNet GmbH   https://sernet.de/en/samba/
GPG Key Fingerprint:           FAE2 C608 8A24 2520 51C5
                               59E4 AA1E 9B71 2639 9E46
-------------- next part --------------
From f09ce546c51702c78c667fd3a10b9b79eaf418a4 Mon Sep 17 00:00:00 2001
From: Ralph Boehme <slow at samba.org>
Date: Wed, 7 Nov 2018 14:00:25 +0100
Subject: [PATCH] libcli/smb: don't overwrite status code

The original commit c5cd22b5bbce724dcd68fe94320382b3f772cabf from bug
9175 never worked, as the preceeding signing check overwrote the status
variable.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=9175

Signed-off-by: Ralph Boehme <slow at samba.org>
---
 libcli/smb/smbXcli_base.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/libcli/smb/smbXcli_base.c b/libcli/smb/smbXcli_base.c
index 9edb6292777..93b4c18e407 100644
--- a/libcli/smb/smbXcli_base.c
+++ b/libcli/smb/smbXcli_base.c
@@ -3889,15 +3889,17 @@ static NTSTATUS smb2cli_conn_dispatch_incoming(struct smbXcli_conn *conn,
 		}
 
 		if (signing_key) {
-			status = smb2_signing_check_pdu(*signing_key,
-							state->conn->protocol,
-							&cur[1], 3);
-			if (!NT_STATUS_IS_OK(status)) {
+			NTSTATUS signing_status;
+
+			signing_status = smb2_signing_check_pdu(*signing_key,
+								state->conn->protocol,
+								&cur[1], 3);
+			if (!NT_STATUS_IS_OK(signing_status)) {
 				/*
 				 * If the signing check fails, we disconnect
 				 * the connection.
 				 */
-				return status;
+				return signing_status;
 			}
 		}
 
-- 
2.17.2



More information about the samba-technical mailing list