summaryrefslogtreecommitdiff
path: root/source3/utils/net_lookup.c
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2007-01-18 09:58:57 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:17:16 -0500
commite9c294b926c0b831fd936194342ec0564f935798 (patch)
tree3a418a506576d1dbfc12438608293a1e7b708989 /source3/utils/net_lookup.c
parentfd37f98158161406229b728a7c767121a30e254f (diff)
downloadsamba-e9c294b926c0b831fd936194342ec0564f935798.tar.gz
samba-e9c294b926c0b831fd936194342ec0564f935798.tar.bz2
samba-e9c294b926c0b831fd936194342ec0564f935798.zip
r20874: We need to distinguish client sitenames per realm. We were overwriting
the stored client sitename with the sitename from each sucessfull CLDAP connection. Guenther (This used to be commit 6a13e878b5d299cb3b3d7cb33ee0d51089d9228d)
Diffstat (limited to 'source3/utils/net_lookup.c')
-rw-r--r--source3/utils/net_lookup.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source3/utils/net_lookup.c b/source3/utils/net_lookup.c
index 8e223e67f3..19ba5ae7f4 100644
--- a/source3/utils/net_lookup.c
+++ b/source3/utils/net_lookup.c
@@ -84,7 +84,7 @@ static int net_lookup_ldap(int argc, const char **argv)
struct hostent *hostent;
struct dns_rr_srv *dcs = NULL;
int numdcs = 0;
- char *sitename = sitename_fetch();
+ char *sitename;
TALLOC_CTX *ctx;
NTSTATUS status;
@@ -93,6 +93,8 @@ static int net_lookup_ldap(int argc, const char **argv)
else
domain = opt_target_workgroup;
+ sitename = sitename_fetch(domain);
+
if ( (ctx = talloc_init("net_lookup_ldap")) == NULL ) {
d_fprintf(stderr, "net_lookup_ldap: talloc_inti() failed!\n");
SAFE_FREE(sitename);
@@ -171,7 +173,7 @@ static int net_lookup_dc(int argc, const char **argv)
asprintf(&pdc_str, "%s", inet_ntoa(addr));
d_printf("%s\n", pdc_str);
- sitename = sitename_fetch();
+ sitename = sitename_fetch(domain);
if (!NT_STATUS_IS_OK(get_sorted_dc_list(domain, sitename, &ip_list, &count, False))) {
SAFE_FREE(pdc_str);
SAFE_FREE(sitename);