summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2007-04-27 14:31:26 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:51:39 -0500
commitaad487ac94dc242a183de8c6bf0b568088d0c018 (patch)
tree99b1711c99460f938649ddc07af8b5bc2cbd9dd8 /source4
parent383fc70970fe9e4108a13733d8809261cdde1a63 (diff)
downloadsamba-aad487ac94dc242a183de8c6bf0b568088d0c018.tar.gz
samba-aad487ac94dc242a183de8c6bf0b568088d0c018.tar.bz2
samba-aad487ac94dc242a183de8c6bf0b568088d0c018.zip
r22536: resolve name before passing to cldap
metze (This used to be commit 2d282584065e668befea120b2baa2988cfe8998d)
Diffstat (limited to 'source4')
-rw-r--r--source4/libnet/libnet_site.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/source4/libnet/libnet_site.c b/source4/libnet/libnet_site.c
index 51b13f9838..eb2e1ebe21 100644
--- a/source4/libnet/libnet_site.c
+++ b/source4/libnet/libnet_site.c
@@ -24,6 +24,7 @@
#include "lib/ldb/include/ldb.h"
#include "lib/ldb/include/ldb_errors.h"
#include "librpc/rpc/dcerpc.h"
+#include "libcli/resolve/resolve.h"
/*
* 1. Setup a CLDAP socket.
@@ -128,6 +129,8 @@ NTSTATUS libnet_JoinSite(struct ldb_context *remote_ldb,
const char *server_dn_str;
const char *config_dn_str;
+ struct nbt_name name;
+ const char *dest_addr = NULL;
tmp_ctx = talloc_named(libnet_r, 0, "libnet_JoinSite temp context");
if (!tmp_ctx) {
@@ -142,8 +145,16 @@ NTSTATUS libnet_JoinSite(struct ldb_context *remote_ldb,
return NT_STATUS_NO_MEMORY;
}
+ make_nbt_name_client(&name, libnet_r->out.samr_binding->host);
+ status = resolve_name(&name, r, &dest_addr, NULL);
+ if (!NT_STATUS_IS_OK(status)) {
+ libnet_r->out.error_string = NULL;
+ talloc_free(tmp_ctx);
+ return status;
+ }
+
/* Resolve the site name and AD DN's. */
- r->in.dest_address = libnet_r->out.samr_binding->host;
+ r->in.dest_address = dest_addr;
r->in.netbios_name = libnet_r->in.netbios_name;
r->in.domain_dn_str = libnet_r->out.domain_dn_str;
@@ -152,7 +163,7 @@ NTSTATUS libnet_JoinSite(struct ldb_context *remote_ldb,
libnet_r->out.error_string =
talloc_steal(libnet_r, r->out.error_string);
talloc_free(tmp_ctx);
- return NT_STATUS_NO_MEMORY;
+ return status;
}
config_dn_str = r->out.config_dn_str;