Author: jra
Date: 2006-09-05 06:32:46 +0000 (Tue, 05 Sep 2006)
New Revision: 18063

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=18063

Log:
When we get a successful connection using ADS,
cache the SAF name under both the domain name
and the realm name, as we could be looking up
under both. Jerry please check.
Jeremy.

Modified:
   branches/SAMBA_3_0/source/libads/ldap.c
   branches/SAMBA_3_0/source/nsswitch/winbindd_cm.c


Changeset:
Modified: branches/SAMBA_3_0/source/libads/ldap.c
===================================================================
--- branches/SAMBA_3_0/source/libads/ldap.c     2006-09-05 05:28:31 UTC (rev 
18062)
+++ branches/SAMBA_3_0/source/libads/ldap.c     2006-09-05 06:32:46 UTC (rev 
18063)
@@ -393,8 +393,9 @@
                return ADS_ERROR(LDAP_OPERATIONS_ERROR);
        }
 
-       /* cache the successful connection */
+       /* cache the successful connection for workgroup and realm */
        saf_store( ads->server.workgroup, inet_ntoa(ads->ldap_ip));
+       saf_store( ads->server.realm, inet_ntoa(ads->ldap_ip));
 
        ldap_set_option(ads->ld, LDAP_OPT_PROTOCOL_VERSION, &version);
 

Modified: branches/SAMBA_3_0/source/nsswitch/winbindd_cm.c
===================================================================
--- branches/SAMBA_3_0/source/nsswitch/winbindd_cm.c    2006-09-05 05:28:31 UTC 
(rev 18062)
+++ branches/SAMBA_3_0/source/nsswitch/winbindd_cm.c    2006-09-05 06:32:46 UTC 
(rev 18063)
@@ -363,6 +363,9 @@
        /* cache the server name for later connections */
 
        saf_store( domain->name, (*cli)->desthost );
+       if (domain->alt_name) {
+               saf_store( domain->alt_name, (*cli)->desthost );
+       }
 
        if (!cli_send_tconX(*cli, "IPC$", "IPC", "", 0)) {
 

Reply via email to