diff options
author | Andrew Tridgell <tridge@samba.org> | 2005-01-15 10:30:58 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:08:50 -0500 |
commit | da19be9a76447461857aa3bd6189a5a1bd7d78c2 (patch) | |
tree | c3763998eb11c3f8d7f45be61540abc9c7f98d43 /source4/libcli/namequery.c | |
parent | 4e4afdb94685388f56061a5cc188a5f5b8e1ae52 (diff) | |
download | samba-da19be9a76447461857aa3bd6189a5a1bd7d78c2.tar.gz samba-da19be9a76447461857aa3bd6189a5a1bd7d78c2.tar.bz2 samba-da19be9a76447461857aa3bd6189a5a1bd7d78c2.zip |
r4755: the recent change in the definition of lp_passwordserver() breaks this
old code, so I'm just removing it, as it needs replacing anyway
(This used to be commit cae7748d675e35bfb89b81349624258bc76fac1a)
Diffstat (limited to 'source4/libcli/namequery.c')
-rw-r--r-- | source4/libcli/namequery.c | 127 |
1 files changed, 0 insertions, 127 deletions
diff --git a/source4/libcli/namequery.c b/source4/libcli/namequery.c index 76fffe0d92..c440a604c7 100644 --- a/source4/libcli/namequery.c +++ b/source4/libcli/namequery.c @@ -1102,130 +1102,3 @@ BOOL get_pdc_ip(TALLOC_CTX *mem_ctx, const char *domain, struct ipv4_addr *ip) return True; } -/******************************************************** - Get the IP address list of the domain controllers for - a domain. -*********************************************************/ - -BOOL get_dc_list(TALLOC_CTX *mem_ctx, const char *domain, struct ipv4_addr **ip_list, int *count, int *ordered) -{ - - *ordered = False; - - /* If it's our domain then use the 'password server' parameter. */ - - if (strequal(domain, lp_workgroup())) { - const char *p; - const char *pserver = lp_passwordserver(); /* UNIX charset. */ - fstring name; - int num_addresses = 0; - int local_count, i, j; - struct ipv4_addr *return_iplist = NULL; - struct ipv4_addr *auto_ip_list = NULL; - BOOL done_auto_lookup = False; - int auto_count = 0; - - - if (!*pserver) - return internal_resolve_name(mem_ctx, - domain, 0x1C, ip_list, count); - - p = pserver; - - /* - * if '*' appears in the "password server" list then add - * an auto lookup to the list of manually configured - * DC's. If any DC is listed by name, then the list should be - * considered to be ordered - */ - - while (next_token(&p,name,LIST_SEP,sizeof(name))) { - if (strequal(name, "*")) { - if ( internal_resolve_name(mem_ctx, domain, 0x1C, &auto_ip_list, &auto_count) ) - num_addresses += auto_count; - done_auto_lookup = True; - DEBUG(8,("Adding %d DC's from auto lookup\n", auto_count)); - } - else - num_addresses++; - } - - /* if we have no addresses and haven't done the auto lookup, then - just return the list of DC's */ - - if ( (num_addresses == 0) && !done_auto_lookup ) - return internal_resolve_name(mem_ctx, domain, 0x1C, ip_list, count); - - return_iplist = malloc_array_p(struct ipv4_addr, num_addresses); - - if (return_iplist == NULL) { - DEBUG(3,("get_dc_list: malloc fail !\n")); - return False; - } - - p = pserver; - local_count = 0; - - /* fill in the return list now with real IP's */ - - while ( (local_count<num_addresses) && next_token(&p,name,LIST_SEP,sizeof(name)) ) { - struct ipv4_addr name_ip; - - /* copy any addersses from the auto lookup */ - - if ( strequal(name, "*") ) { - for ( j=0; j<auto_count; j++ ) - return_iplist[local_count++] = auto_ip_list[j]; - continue; - } - - /* explicit lookup; resolve_name() will handle names & IP addresses */ - - if ( resolve_name( mem_ctx, name, &name_ip, 0x20) ) { - return_iplist[local_count++] = name_ip; - *ordered = True; - } - - } - - SAFE_FREE(auto_ip_list); - - /* need to remove duplicates in the list if we have - any explicit password servers */ - - if ( *ordered ) { - /* one loop to remove duplicates */ - for ( i=0; i<local_count; i++ ) { - if ( is_zero_ip(return_iplist[i]) ) - continue; - - for ( j=i+1; j<local_count; j++ ) { - if ( ipv4_equal( return_iplist[i], return_iplist[j]) ) - zero_ip(&return_iplist[j]); - } - } - - /* one loop to clean up any holes we left */ - /* first ip should never be a zero_ip() */ - for (i = 0; i<local_count; ) { - if ( is_zero_ip(return_iplist[i]) ) { - if (i != local_count-1 ) - memmove(&return_iplist[i], &return_iplist[i+1], - (local_count - i - 1)*sizeof(return_iplist[i])); - local_count--; - continue; - } - i++; - } - } - - *ip_list = return_iplist; - *count = local_count; - - DEBUG(8,("get_dc_list: return %d ip addresses\n", *count)); - - return (*count != 0); - } - - return internal_resolve_name(mem_ctx, domain, 0x1C, ip_list, count); -} |