From e9c294b926c0b831fd936194342ec0564f935798 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Thu, 18 Jan 2007 09:58:57 +0000 Subject: 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) --- source3/utils/net_lookup.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source3/utils') 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); -- cgit