Failing autobuilds with a segfault in winbindd

Stefan Metzmacher metze at samba.org
Thu Oct 19 12:23:52 UTC 2017


Hi,

here's the updated patchset...

Please review and push:-)

Thanks!
metze
-------------- next part --------------
From 2a2e9cf008b446feef188400099a3104572d6138 Mon Sep 17 00:00:00 2001
From: Stefan Metzmacher <metze at samba.org>
Date: Wed, 18 Oct 2017 13:36:59 +0200
Subject: [PATCH 1/2] s3:cli_netlogon: make sure rpccli_connect_netlogon only
 returns NT_STATUS_OK on success

Signed-off-by: Stefan Metzmacher <metze at samba.org>
---
 source3/rpc_client/cli_netlogon.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/source3/rpc_client/cli_netlogon.c b/source3/rpc_client/cli_netlogon.c
index 19b81a5..f2454ef 100644
--- a/source3/rpc_client/cli_netlogon.c
+++ b/source3/rpc_client/cli_netlogon.c
@@ -354,15 +354,16 @@ again:
 		status = cli_rpc_pipe_open_bind_schannel(
 			cli, &ndr_table_netlogon, transport, creds_ctx,
 			&rpccli);
-		if (!NT_STATUS_IS_OK(status)) {
-			DBG_DEBUG("cli_rpc_pipe_open_bind_schannel "
-				  "failed: %s\n", nt_errstr(status));
-		}
 		if (NT_STATUS_EQUAL(status, NT_STATUS_NETWORK_ACCESS_DENIED)) {
 			DBG_DEBUG("Retrying with serverauthenticate\n");
 			TALLOC_FREE(lck);
 			goto again;
 		}
+		if (!NT_STATUS_IS_OK(status)) {
+			DBG_DEBUG("cli_rpc_pipe_open_bind_schannel "
+				  "failed: %s\n", nt_errstr(status));
+			goto fail;
+		}
 		goto done;
 	}
 
@@ -399,6 +400,7 @@ again:
 		if (!NT_STATUS_IS_OK(status)) {
 			DBG_DEBUG("cli_rpc_pipe_open_noauth_transport "
 				  "failed: %s\n", nt_errstr(status));
+			goto fail;
 		}
 		goto done;
 	}
@@ -434,6 +436,7 @@ again:
 		if (!NT_STATUS_IS_OK(status)) {
 			DBG_DEBUG("cli_rpc_pipe_open_noauth_transport "
 				  "failed: %s\n", nt_errstr(status));
+			goto fail;
 		}
 		goto done;
 	}
-- 
1.9.1


From 54bd223b7c6f133b7fc37c1bb7483f1c14e758c1 Mon Sep 17 00:00:00 2001
From: Stefan Metzmacher <metze at samba.org>
Date: Wed, 18 Oct 2017 13:36:59 +0200
Subject: [PATCH 2/2] s3:cli_netlogon: let rpccli_connect_netlogon() retry once
 after NT_STATUS_NETWORK_ACCESS_DENIED

Otherwise we could easily endup with an endless loop.

Signed-off-by: Stefan Metzmacher <metze at samba.org>
---
 source3/rpc_client/cli_netlogon.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/source3/rpc_client/cli_netlogon.c b/source3/rpc_client/cli_netlogon.c
index f2454ef..bae1ce4 100644
--- a/source3/rpc_client/cli_netlogon.c
+++ b/source3/rpc_client/cli_netlogon.c
@@ -292,6 +292,7 @@ NTSTATUS rpccli_connect_netlogon(
 	bool do_serverauth;
 	struct rpc_pipe_client *rpccli;
 	NTSTATUS status;
+	bool retry = false;
 
 again:
 
@@ -354,9 +355,10 @@ again:
 		status = cli_rpc_pipe_open_bind_schannel(
 			cli, &ndr_table_netlogon, transport, creds_ctx,
 			&rpccli);
-		if (NT_STATUS_EQUAL(status, NT_STATUS_NETWORK_ACCESS_DENIED)) {
+		if (!retry && NT_STATUS_EQUAL(status, NT_STATUS_NETWORK_ACCESS_DENIED)) {
 			DBG_DEBUG("Retrying with serverauthenticate\n");
 			TALLOC_FREE(lck);
+			retry = true;
 			goto again;
 		}
 		if (!NT_STATUS_IS_OK(status)) {
-- 
1.9.1

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20171019/69ade55f/signature.sig>


More information about the samba-technical mailing list