summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2005-10-27 11:01:29 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:05:11 -0500
commit5872c9e60b1cbca82bb3f6251a59361b18751a83 (patch)
tree417016d30c0eadc3b2ac6148a1dfb3ff82b33395 /source3
parent3321531e74bc122b9bfa11a072497e8d738ef841 (diff)
downloadsamba-5872c9e60b1cbca82bb3f6251a59361b18751a83.tar.gz
samba-5872c9e60b1cbca82bb3f6251a59361b18751a83.tar.bz2
samba-5872c9e60b1cbca82bb3f6251a59361b18751a83.zip
r11323: Fix usage of rpccli_netlogon_getdcname. Add some debug messages.
Volker (This used to be commit 770ad2a8a72ae7bfcdc1b86b72142e11f662d975)
Diffstat (limited to 'source3')
-rw-r--r--source3/nsswitch/winbindd_cm.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/source3/nsswitch/winbindd_cm.c b/source3/nsswitch/winbindd_cm.c
index bd78f7687f..e02e219c24 100644
--- a/source3/nsswitch/winbindd_cm.c
+++ b/source3/nsswitch/winbindd_cm.c
@@ -116,6 +116,7 @@ static BOOL get_dc_name_via_netlogon(const struct winbindd_domain *domain,
struct rpc_pipe_client *netlogon_pipe;
NTSTATUS result;
TALLOC_CTX *mem_ctx;
+ const char *server_name;
fstring tmp;
char *p;
@@ -142,13 +143,21 @@ static BOOL get_dc_name_via_netlogon(const struct winbindd_domain *domain,
return False;
}
- result = rpccli_netlogon_getdcname(netlogon_pipe, mem_ctx, domain->dcname,
+ server_name = talloc_asprintf(mem_ctx, "\\\\%s", our_domain->dcname);
+ if (server_name == NULL) {
+ return False;
+ }
+
+ result = rpccli_netlogon_getdcname(netlogon_pipe, mem_ctx, server_name,
domain->name, tmp);
talloc_destroy(mem_ctx);
- if (!NT_STATUS_IS_OK(result))
+ if (!NT_STATUS_IS_OK(result)) {
+ DEBUG(10, ("rpccli_netlogon_getdcname failed: %s\n",
+ nt_errstr(result)));
return False;
+ }
/* cli_netlogon_getdcname gives us a name with \\ */
p = tmp;
@@ -161,6 +170,8 @@ static BOOL get_dc_name_via_netlogon(const struct winbindd_domain *domain,
fstrcpy(dcname, p);
+ DEBUG(10, ("rpccli_netlogon_getdcname returned %s\n", dcname));
+
if (!resolve_name(dcname, dc_ip, 0x20)) {
return False;
}
@@ -417,8 +428,10 @@ static BOOL add_one_dc_unique(TALLOC_CTX *mem_ctx, const char *domain_name,
const char *dcname, struct in_addr ip,
struct dc_name_ip **dcs, int *num)
{
- if (!NT_STATUS_IS_OK(check_negative_conn_cache(domain_name, dcname)))
+ if (!NT_STATUS_IS_OK(check_negative_conn_cache(domain_name, dcname))) {
+ DEBUG(10, ("DC %s was in the negative conn cache\n", dcname));
return False;
+ }
*dcs = TALLOC_REALLOC_ARRAY(mem_ctx, *dcs, struct dc_name_ip, (*num)+1);
@@ -657,6 +670,8 @@ static BOOL get_dcs(TALLOC_CTX *mem_ctx, const struct winbindd_domain *domain,
&& get_dc_name_via_netlogon(domain, dcname, &ip)
&& add_one_dc_unique(mem_ctx, domain->name, dcname, ip, dcs, num_dcs) )
{
+ DEBUG(10, ("Retrieved DC %s at %s via netlogon\n",
+ dcname, inet_ntoa(ip)));
return True;
}