s3:libads/ldap.c: store the dc name in the saf cache as in all other places
authorStefan Metzmacher <metze@samba.org>
Mon, 27 Oct 2008 18:39:30 +0000 (19:39 +0100)
committerStefan Metzmacher <metze@samba.org>
Sat, 13 Dec 2008 10:42:36 +0000 (11:42 +0100)
metze

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: G√ľnther Deschner <gd@samba.org>
(cherry picked from commit 543fa85a711337e979c7b631bda5db95d109ef59)

source3/libads/ldap.c

index c0bb9c7e2df85346b4bbe80eb3e2062cc3d36da9..cf8a7ebb1b3750f844df59faa6294d7c2ed38a47 100644 (file)
@@ -651,9 +651,8 @@ got_connection:
 
        /* cache the successful connection for workgroup and realm */
        if (ads_closest_dc(ads)) {
 
        /* cache the successful connection for workgroup and realm */
        if (ads_closest_dc(ads)) {
-               print_sockaddr(addr, sizeof(addr), &ads->ldap.ss);
-               saf_store( ads->server.workgroup, addr);
-               saf_store( ads->server.realm, addr);
+               saf_store( ads->server.workgroup, ads->config.ldap_server_name);
+               saf_store( ads->server.realm, ads->config.ldap_server_name);
        }
 
        ldap_set_option(ads->ldap.ld, LDAP_OPT_PROTOCOL_VERSION, &version);
        }
 
        ldap_set_option(ads->ldap.ld, LDAP_OPT_PROTOCOL_VERSION, &version);