summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2010-02-25 18:10:56 +0100
committerAndrew Tridgell <tridge@samba.org>2010-02-26 13:22:12 +1100
commit525a1fe7751d4ba470e9185009fc455e57470c76 (patch)
treeb591c81b11d431242a0da212f45176c53725eeba /source4
parent3751485c8432c0f6d3955f2b03a81cf4002d7a1b (diff)
downloadsamba-525a1fe7751d4ba470e9185009fc455e57470c76.tar.gz
samba-525a1fe7751d4ba470e9185009fc455e57470c76.tar.bz2
samba-525a1fe7751d4ba470e9185009fc455e57470c76.zip
s4:RPC-DSSYNC: pass the ip address to the cldap code instead of a name
metze
Diffstat (limited to 'source4')
-rw-r--r--source4/torture/rpc/dssync.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/source4/torture/rpc/dssync.c b/source4/torture/rpc/dssync.c
index 1d94faaad6..3f100f91a7 100644
--- a/source4/torture/rpc/dssync.c
+++ b/source4/torture/rpc/dssync.c
@@ -34,6 +34,7 @@
#include "torture/rpc/rpc.h"
#include "torture/drs/proto.h"
#include "lib/tsocket/tsocket.h"
+#include "libcli/resolve/resolve.h"
struct DsSyncBindInfo {
struct dcerpc_pipe *drs_pipe;
@@ -54,7 +55,7 @@ struct DsSyncTest {
const char *ldap_url;
const char *site_name;
-
+ const char *dest_address;
const char *domain_dn;
/* what we need to do as 'Administrator' */
@@ -86,6 +87,8 @@ static struct DsSyncTest *test_create_context(struct torture_context *tctx)
struct drsuapi_DsBindInfo28 *our_bind_info28;
struct drsuapi_DsBindInfoCtr *our_bind_info_ctr;
const char *binding = torture_setting_string(tctx, "binding", NULL);
+ struct nbt_name name;
+
ctx = talloc_zero(tctx, struct DsSyncTest);
if (!ctx) return NULL;
@@ -98,6 +101,17 @@ static struct DsSyncTest *test_create_context(struct torture_context *tctx)
ctx->ldap_url = talloc_asprintf(ctx, "ldap://%s", ctx->drsuapi_binding->host);
+ make_nbt_name_server(&name, ctx->drsuapi_binding->host);
+
+ /* do an initial name resolution to find its IP */
+ status = resolve_name(lp_resolve_context(tctx->lp_ctx), &name, tctx,
+ &ctx->dest_address, tctx->ev);
+ if (!NT_STATUS_IS_OK(status)) {
+ printf("Failed to resolve %s - %s\n",
+ name.name, nt_errstr(status));
+ return NULL;
+ }
+
/* ctx->admin ...*/
ctx->admin.credentials = cmdline_credentials;
@@ -298,7 +312,7 @@ static bool test_GetInfo(struct torture_context *tctx, struct DsSyncTest *ctx)
int ret2;
ret2 = tsocket_address_inet_from_strings(tctx, "ip",
- ctx->drsuapi_binding->host,
+ ctx->dest_address,
lp_cldap_port(tctx->lp_ctx),
&dest_addr);
if (ret2 != 0) {