summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2006-03-28 13:34:13 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:15:45 -0500
commitfe05699b00fd9889d8e6af6d64e12261fbc9a52a (patch)
treedca745d27e7c8767c4179700ce46474fe152c08f
parent1d3fd5201c98417ba40bb367d92c3a924f947799 (diff)
downloadsamba-fe05699b00fd9889d8e6af6d64e12261fbc9a52a.tar.gz
samba-fe05699b00fd9889d8e6af6d64e12261fbc9a52a.tar.bz2
samba-fe05699b00fd9889d8e6af6d64e12261fbc9a52a.zip
r14748: store the name/ip address combination when we doa reverse look up in case future forward lookups would fail
(This used to be commit d56ed46faec46dad74b469d25ff99c9002792c78)
-rw-r--r--source3/nsswitch/winbindd_cm.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/source3/nsswitch/winbindd_cm.c b/source3/nsswitch/winbindd_cm.c
index 579c20b7d2..3c5062df59 100644
--- a/source3/nsswitch/winbindd_cm.c
+++ b/source3/nsswitch/winbindd_cm.c
@@ -581,6 +581,10 @@ static BOOL receive_getdc_response(struct in_addr dc_ip,
static void dcip_to_name( const char *domainname, const char *realm,
const DOM_SID *sid, struct in_addr ip, fstring name )
{
+ struct ip_service ip_list;
+
+ ip_list.ip = ip;
+ ip_list.port = 0;
/* try GETDC requests first */
@@ -588,16 +592,20 @@ static void dcip_to_name( const char *domainname, const char *realm,
int i;
smb_msleep(100);
for (i=0; i<5; i++) {
- if (receive_getdc_response(ip, domainname, name))
+ if (receive_getdc_response(ip, domainname, name)) {
+ namecache_store(name, 0x20, 1, &ip_list);
return;
+ }
smb_msleep(500);
}
}
/* try node status request */
- if ( name_status_find(domainname, 0x1c, 0x20, ip, name) )
+ if ( name_status_find(domainname, 0x1c, 0x20, ip, name) ) {
+ namecache_store(name, 0x20, 1, &ip_list);
return;
+ }
/* backup in case the netbios stuff fails */
@@ -627,6 +635,7 @@ static void dcip_to_name( const char *domainname, const char *realm,
}
fstrcpy(name, ads->config.ldap_server_name);
+ namecache_store(name, 0x20, 1, &ip_list);
ads_destroy( &ads );
}