diff options
author | Günther Deschner <gd@samba.org> | 2008-02-07 10:24:18 +0100 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2008-02-07 10:29:26 +0100 |
commit | bca0ef0ed769bfbee6e7041aae8256be872813c7 (patch) | |
tree | a77de5cf619b05e9d1cb0d0eceb040269dea9951 /source3/winbindd/winbindd_cm.c | |
parent | 3e731a49366df8a1fda6cc6b7fb14fc68dbb5d36 (diff) | |
download | samba-bca0ef0ed769bfbee6e7041aae8256be872813c7.tar.gz samba-bca0ef0ed769bfbee6e7041aae8256be872813c7.tar.bz2 samba-bca0ef0ed769bfbee6e7041aae8256be872813c7.zip |
Use rpccli_netr_GetAnyDCName and rpccli_netr_GetDCName everywhere.
Guenther
(This used to be commit 8abeea9922ac09e7307730ee7695453718356873)
Diffstat (limited to 'source3/winbindd/winbindd_cm.c')
-rw-r--r-- | source3/winbindd/winbindd_cm.c | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/source3/winbindd/winbindd_cm.c b/source3/winbindd/winbindd_cm.c index 7bc449c90d..17afd1e3eb 100644 --- a/source3/winbindd/winbindd_cm.c +++ b/source3/winbindd/winbindd_cm.c @@ -570,8 +570,8 @@ static bool get_dc_name_via_netlogon(struct winbindd_domain *domain, WERROR werr; TALLOC_CTX *mem_ctx; unsigned int orig_timeout; - char *tmp = NULL; - char *p; + const char *tmp = NULL; + const char *p; /* Hmmmm. We can only open one connection to the NETLOGON pipe at the * moment.... */ @@ -630,25 +630,31 @@ static bool get_dc_name_via_netlogon(struct winbindd_domain *domain, } } } else { - - werr = rpccli_netlogon_getanydcname(netlogon_pipe, - mem_ctx, - our_domain->dcname, - domain->name, - &tmp); + result = rpccli_netr_GetAnyDCName(netlogon_pipe, mem_ctx, + our_domain->dcname, + domain->name, + &tmp, + &werr); } /* And restore our original timeout. */ cli_set_timeout(netlogon_pipe->cli, orig_timeout); + if (!NT_STATUS_IS_OK(result)) { + DEBUG(10,("rpccli_netr_GetAnyDCName failed: %s\n", + nt_errstr(result))); + talloc_destroy(mem_ctx); + return false; + } + if (!W_ERROR_IS_OK(werr)) { - DEBUG(10, ("rpccli_netlogon_getanydcname failed: %s\n", + DEBUG(10,("rpccli_netr_GetAnyDCName failed: %s\n", dos_errstr(werr))); talloc_destroy(mem_ctx); - return False; + return false; } - /* cli_netlogon_getanydcname gives us a name with \\ */ + /* rpccli_netr_GetAnyDCName gives us a name with \\ */ p = tmp; if (*p == '\\') { p+=1; @@ -661,7 +667,7 @@ static bool get_dc_name_via_netlogon(struct winbindd_domain *domain, talloc_destroy(mem_ctx); - DEBUG(10, ("rpccli_netlogon_getanydcname returned %s\n", dcname)); + DEBUG(10,("rpccli_netr_GetAnyDCName returned %s\n", dcname)); if (!resolve_name(dcname, dc_ss, 0x20)) { return False; |