summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2008-02-08 23:28:02 +0100
committerGünther Deschner <gd@samba.org>2008-02-08 23:38:13 +0100
commite88eb3ed16ce5ddcf795322cfd2bd6ac555ce5d5 (patch)
tree16a00247f0803bb8e545c7390d0bee909283b0e2
parent559d6587a1d98246883f14bca633c3e660d2a4e8 (diff)
downloadsamba-e88eb3ed16ce5ddcf795322cfd2bd6ac555ce5d5.tar.gz
samba-e88eb3ed16ce5ddcf795322cfd2bd6ac555ce5d5.tar.bz2
samba-e88eb3ed16ce5ddcf795322cfd2bd6ac555ce5d5.zip
Use rpccli_netr_DsRGetDCName() in rpcclient and winbindd.
Guenther (This used to be commit 4f3e97cbae3df8e12db37b8a8a0eaee947fa723a)
-rw-r--r--source3/rpcclient/cmd_netlogon.c26
-rw-r--r--source3/winbindd/winbindd_cm.c25
2 files changed, 29 insertions, 22 deletions
diff --git a/source3/rpcclient/cmd_netlogon.c b/source3/rpcclient/cmd_netlogon.c
index ecd033f39d..a752003e8d 100644
--- a/source3/rpcclient/cmd_netlogon.c
+++ b/source3/rpcclient/cmd_netlogon.c
@@ -126,13 +126,14 @@ static WERROR cmd_netlogon_dsr_getdcname(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx, int argc,
const char **argv)
{
- WERROR result;
+ NTSTATUS result;
+ WERROR werr = WERR_OK;
uint32 flags = DS_RETURN_DNS_NAME;
const char *server_name = cli->cli->desthost;
const char *domain_name;
struct GUID domain_guid = GUID_zero();
struct GUID site_guid = GUID_zero();
- struct DS_DOMAIN_CONTROLLER_INFO *info = NULL;
+ struct netr_DsRGetDCNameInfo *info = NULL;
if (argc < 2) {
fprintf(stderr, "Usage: %s [domain_name] [domain_guid] "
@@ -160,20 +161,25 @@ static WERROR cmd_netlogon_dsr_getdcname(struct rpc_pipe_client *cli,
debug_dsdcinfo_flags(1,flags);
- result = rpccli_netlogon_dsr_getdcname(cli, mem_ctx, server_name, domain_name,
- &domain_guid, &site_guid, flags,
- &info);
+ result = rpccli_netr_DsRGetDCName(cli, mem_ctx,
+ server_name,
+ domain_name,
+ &domain_guid,
+ &site_guid,
+ flags,
+ &info,
+ &werr);
- if (W_ERROR_IS_OK(result)) {
- d_printf("DsGetDcName gave\n");
- display_ds_domain_controller_info(mem_ctx, info);
+ if (W_ERROR_IS_OK(werr)) {
+ d_printf("DsGetDcName gave: %s\n",
+ NDR_PRINT_STRUCT_STRING(mem_ctx, netr_DsRGetDCNameInfo, info));
return WERR_OK;
}
printf("rpccli_netlogon_dsr_getdcname returned %s\n",
- dos_errstr(result));
+ dos_errstr(werr));
- return result;
+ return werr;
}
static WERROR cmd_netlogon_dsr_getdcnameex(struct rpc_pipe_client *cli,
diff --git a/source3/winbindd/winbindd_cm.c b/source3/winbindd/winbindd_cm.c
index dbdab65f70..0f536cdfb8 100644
--- a/source3/winbindd/winbindd_cm.c
+++ b/source3/winbindd/winbindd_cm.c
@@ -602,19 +602,20 @@ static bool get_dc_name_via_netlogon(struct winbindd_domain *domain,
orig_timeout = cli_set_timeout(netlogon_pipe->cli, 35000);
if (our_domain->active_directory) {
- struct DS_DOMAIN_CONTROLLER_INFO *domain_info = NULL;
-
- werr = rpccli_netlogon_dsr_getdcname(netlogon_pipe,
- mem_ctx,
- our_domain->dcname,
- domain->name,
- NULL,
- NULL,
- DS_RETURN_DNS_NAME,
- &domain_info);
+ struct netr_DsRGetDCNameInfo *domain_info = NULL;
+
+ result = rpccli_netr_DsRGetDCName(netlogon_pipe,
+ mem_ctx,
+ our_domain->dcname,
+ domain->name,
+ NULL,
+ NULL,
+ DS_RETURN_DNS_NAME,
+ &domain_info,
+ &werr);
if (W_ERROR_IS_OK(werr)) {
tmp = talloc_strdup(
- mem_ctx, domain_info->domain_controller_name);
+ mem_ctx, domain_info->dc_unc);
if (tmp == NULL) {
DEBUG(0, ("talloc_strdup failed\n"));
talloc_destroy(mem_ctx);
@@ -626,7 +627,7 @@ static bool get_dc_name_via_netlogon(struct winbindd_domain *domain,
}
if (strlen(domain->forest_name) == 0) {
fstrcpy(domain->forest_name,
- domain_info->dns_forest_name);
+ domain_info->forest_name);
}
}
} else {