Patch: Bug 15852, avoid a crash in winbindd

Richard Sharpe realrichardsharpe at gmail.com
Tue Jun 20 19:47:04 UTC 2017


Hi folks,

Here is a possible patch for Bug 15852. Thanks to Metze for the better
approach to fixing the problem.

For master. Possibly needs backports for other releases.

-- 
Regards,
Richard Sharpe
(何以解憂?唯有杜康。--曹操)
-------------- next part --------------
From c27928b57a11a77f6d3d2306a9cc0055fec03b51 Mon Sep 17 00:00:00 2001
From: Richard Sharpe <richard.sharpe at primarydata.com>
Date: Tue, 20 Jun 2017 12:40:39 -0700
Subject: [PATCH] Bug 15852. There are valid paths where
 conn->lsa_pipt_tcp->transport is NULL. Protect against this.

Based on a suggestion from Metze.

Signed-off-by: Richard Sharpe <realrichardsharpe at gmail.com>
---
 source3/winbindd/winbindd_cm.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/source3/winbindd/winbindd_cm.c b/source3/winbindd/winbindd_cm.c
index 7566a30..d874f3e 100644
--- a/source3/winbindd/winbindd_cm.c
+++ b/source3/winbindd/winbindd_cm.c
@@ -2927,10 +2927,12 @@ static NTSTATUS cm_connect_lsa_tcp(struct winbindd_domain *domain,
 
 	conn = &domain->conn;
 
-	if (conn->lsa_pipe_tcp &&
+	/*
+	 * rpccli_is_connected handles more error cases
+	 */
+	if (rpccli_is_connected(conn->lsa_pipe_tcp) &&
 	    conn->lsa_pipe_tcp->transport->transport == NCACN_IP_TCP &&
-	    conn->lsa_pipe_tcp->auth->auth_level >= DCERPC_AUTH_LEVEL_INTEGRITY &&
-	    rpccli_is_connected(conn->lsa_pipe_tcp)) {
+	    conn->lsa_pipe_tcp->auth->auth_level >= DCERPC_AUTH_LEVEL_INTEGRITY) {
 		goto done;
 	}
 
-- 
2.3.6



More information about the samba-technical mailing list