diff options
author | Gerald Carter <jerry@samba.org> | 2003-06-25 17:41:05 +0000 |
---|---|---|
committer | Gerald Carter <jerry@samba.org> | 2003-06-25 17:41:05 +0000 |
commit | f51d769dd303027a3dbf46fc89a482933988e866 (patch) | |
tree | 5bb400a9df1f6fb27f2b045a6521e2995de8c686 /source3/nsswitch/wins.c | |
parent | eb61c8238298e97644202139e6d7f55e46eb9c26 (diff) | |
download | samba-f51d769dd303027a3dbf46fc89a482933988e866.tar.gz samba-f51d769dd303027a3dbf46fc89a482933988e866.tar.xz samba-f51d769dd303027a3dbf46fc89a482933988e866.zip |
large change:
*) consolidates the dc location routines again (dns
and netbios) get_dc_list() or get_sorted_dc_list()
is the authoritative means of locating DC's again.
(also inludes a flag to get_dc_list() to define
if this should be a DNS only lookup or not)
(however, if you set "name resolve order = hosts wins"
you could still get DNS queries for domain name IFF
ldap_domain2hostlist() fails. The answer? Fix your DNS
setup)
*) enabled DOMAIN<0x1c> lookups to be funneled through
resolve_hosts resulting in a call to ldap_domain2hostlist()
if lp_security() == SEC_ADS
*) enables name cache for winbind ADS backend
*) enable the negative connection cache for winbind
ADS backend
*) removes some old dead code
*) consolidates some duplicate code
*) moves the internal_name_resolve() to use an IP/port pair
to deal with SRV RR dns replies. The namecache code
also supports the IP:port syntax now as well.
*) removes 'ads server' and moves the functionality back
into 'password server' (which can support "hostname:port"
syntax now but works fine with defaults depending on
the value of lp_security())
(This used to be commit d7f7fcda425bef380441509734eca33da943c091)
Diffstat (limited to 'source3/nsswitch/wins.c')
-rw-r--r-- | source3/nsswitch/wins.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/source3/nsswitch/wins.c b/source3/nsswitch/wins.c index 61edb1323b0..62493ef0a9e 100644 --- a/source3/nsswitch/wins.c +++ b/source3/nsswitch/wins.c @@ -112,7 +112,8 @@ static struct node_status *lookup_byaddr_backend(char *addr, int *count) static struct in_addr *lookup_byname_backend(const char *name, int *count) { int fd = -1; - struct in_addr *ret = NULL; + struct ip_service *address = NULL; + struct in_addr *ret; int j, flags = 0; if (!initialised) { @@ -122,7 +123,13 @@ static struct in_addr *lookup_byname_backend(const char *name, int *count) *count = 0; /* always try with wins first */ - if (resolve_wins(name,0x20,&ret,count)) { + if (resolve_wins(name,0x20,&address,count)) { + if ( (ret = (struct in_addr *)malloc(sizeof(struct in_addr))) == NULL ) { + free( address ); + return NULL; + } + *ret = address[0].ip; + free( address ); return ret; } |