handle ldap server down better
authorAndrew Tridgell <tridge@samba.org>
Wed, 5 Dec 2001 10:14:22 +0000 (10:14 +0000)
committerAndrew Tridgell <tridge@samba.org>
Wed, 5 Dec 2001 10:14:22 +0000 (10:14 +0000)
(This used to be commit 0d85815c992c6ca77ba64dfb2d7538be4684654d)

source3/libads/ldap.c

index 287ea225a18d5d343af73b1fd1e1fa0bd1f7c23d..bfa5bbd9df2e47469ffa65f7cc453324013e88ec 100644 (file)
@@ -66,11 +66,13 @@ int ads_connect(ADS_STRUCT *ads)
 
        ads->ld = ldap_open(ads->ldap_server, ads->ldap_port);
        if (!ads->ld) {
-               return errno;
+               return LDAP_SERVER_DOWN;
        }
        ldap_set_option(ads->ld, LDAP_OPT_PROTOCOL_VERSION, &version);
 
        if (ads->password) {
+               /* the machine acct password might have changed */
+               ads->password = secrets_fetch_machine_password();
                kerberos_kinit_password(ads);
        }