From fe05699b00fd9889d8e6af6d64e12261fbc9a52a Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Tue, 28 Mar 2006 13:34:13 +0000 Subject: 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) --- source3/nsswitch/winbindd_cm.c | 13 +++++++++++-- 1 file 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 ); } -- cgit