From 4a73adf6e53fb810056a80a87c72b1370323c583 Mon Sep 17 00:00:00 2001 From: =?utf8?q?G=C3=BCnther=20Deschner?= Date: Thu, 29 Nov 2012 14:31:19 +0100 Subject: [PATCH] s3-winbind: use new reconnect logic in rpc_lookup_sids() also. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Volker, please check. Guenther Signed-off-by: Günther Deschner Reviewed-by: Andreas Schneider --- source3/winbindd/winbindd_rpc.c | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/source3/winbindd/winbindd_rpc.c b/source3/winbindd/winbindd_rpc.c index a3faf422fce..a96dbb15db2 100644 --- a/source3/winbindd/winbindd_rpc.c +++ b/source3/winbindd/winbindd_rpc.c @@ -1057,6 +1057,7 @@ NTSTATUS rpc_trusted_domains(TALLOC_CTX *mem_ctx, static NTSTATUS rpc_try_lookup_sids3(TALLOC_CTX *mem_ctx, struct winbindd_domain *domain, + struct rpc_pipe_client *cli, struct lsa_SidArray *sids, struct lsa_RefDomainList **pdomains, struct lsa_TransNameArray **pnames) @@ -1064,15 +1065,8 @@ static NTSTATUS rpc_try_lookup_sids3(TALLOC_CTX *mem_ctx, struct lsa_TransNameArray2 lsa_names2; struct lsa_TransNameArray *names; uint32_t i, count; - struct rpc_pipe_client *cli; NTSTATUS status, result; - status = cm_connect_lsa_tcp(domain, talloc_tos(), &cli); - if (!NT_STATUS_IS_OK(status)) { - domain->can_do_ncacn_ip_tcp = false; - return status; - } - ZERO_STRUCT(lsa_names2); status = dcerpc_lsa_LookupSids3(cli->binding_handle, mem_ctx, @@ -1122,19 +1116,16 @@ NTSTATUS rpc_lookup_sids(TALLOC_CTX *mem_ctx, uint32_t count; NTSTATUS status, result; - if (domain->can_do_ncacn_ip_tcp) { - status = rpc_try_lookup_sids3(mem_ctx, domain, sids, - pdomains, pnames); - if (!NT_STATUS_IS_ERR(status)) { - return status; - } - } - - status = cm_connect_lsa(domain, mem_ctx, &cli, &lsa_policy); + status = cm_connect_lsat(domain, mem_ctx, &cli, &lsa_policy); if (!NT_STATUS_IS_OK(status)) { return status; } + if (cli->transport->transport == NCACN_IP_TCP) { + return rpc_try_lookup_sids3(mem_ctx, domain, cli, sids, + pdomains, pnames); + } + names = talloc_zero(mem_ctx, struct lsa_TransNameArray); if (names == NULL) { return NT_STATUS_NO_MEMORY; -- 2.34.1