r18063: When we get a successful connection using ADS,
authorJeremy Allison <jra@samba.org>
Tue, 5 Sep 2006 06:32:46 +0000 (06:32 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 16:43:24 +0000 (11:43 -0500)
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.
(This used to be commit 9d954d2deb46698b3834c7caf5ee0cfe628086b5)

source3/libads/ldap.c
source3/nsswitch/winbindd_cm.c

index 970311d5ca43d10d3a7fe0052b0cdfb308e186b0..6c3ab75340cae67631727afe5447a96ac5dfccad 100644 (file)
@@ -393,8 +393,9 @@ got_connection:
                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);
 
index ce4e3cae18c579fd6e756dd0ce2500387af633ac..efee477c0d4751f9055ad60634af7938de86e528 100644 (file)
@@ -363,6 +363,9 @@ static NTSTATUS cm_prepare_connection(const struct winbindd_domain *domain,
        /* 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)) {