diff options
author | Arthur de Jong <arthur@arthurdejong.org> | 2007-12-22 21:02:55 +0000 |
---|---|---|
committer | Arthur de Jong <arthur@arthurdejong.org> | 2007-12-22 21:02:55 +0000 |
commit | cb63d4e962577afa4a7475d0ec225a8427e974e5 (patch) | |
tree | eeb8b49089bf9b0611a3515d635b235f5b3fd007 | |
parent | af6a845e433350b0669f2c1656b158e9605cdee9 (diff) |
remove bind_policy option because the same effect is achieved by setting reconnect_tries to 1
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@522 ef36b2f9-881f-0410-afb5-c4e39611909c
-rw-r--r-- | nslcd/cfg.c | 13 | ||||
-rw-r--r-- | nslcd/cfg.h | 9 | ||||
-rw-r--r-- | nslcd/myldap.c | 13 |
3 files changed, 4 insertions, 31 deletions
diff --git a/nslcd/cfg.c b/nslcd/cfg.c index b7b77ed..7f99b1b 100644 --- a/nslcd/cfg.c +++ b/nslcd/cfg.c @@ -82,7 +82,6 @@ static void cfg_defaults(struct ldap_config *cfg) cfg->ldc_deref=LDAP_DEREF_NEVER; cfg->ldc_referrals=1; cfg->ldc_bind_timelimit=30; - cfg->ldc_reconnect_pol=LP_RECONNECT_HARD_OPEN; cfg->ldc_timelimit=LDAP_NO_LIMIT; cfg->ldc_idle_timelimit=0; cfg->ldc_reconnect_tries=4; @@ -654,18 +653,6 @@ static void cfg_read(const char *filename,struct ldap_config *cfg) check_argumentcount(filename,lnr,opts[0],nopts==2); cfg->ldc_bind_timelimit=atoi(opts[1]); } - else if (strcasecmp(opts[0],"bind_policy")==0) - { - log_log(LOG_WARNING,"%s:%d: option %s is currently untested (and may be removed in an upcoming release)",filename,lnr,opts[0]); - check_argumentcount(filename,lnr,opts[0],nopts==2); - if ( (strcasecmp(opts[1],"hard")==0) || - (strcasecmp(opts[1],"hard_open")==0) ) - cfg->ldc_reconnect_pol=LP_RECONNECT_HARD_OPEN; - else if (strcasecmp(opts[1],"hard_init")==0) - cfg->ldc_reconnect_pol=LP_RECONNECT_HARD_INIT; - else if (strcasecmp(opts[1],"soft")==0) - cfg->ldc_reconnect_pol=LP_RECONNECT_SOFT; - } else if (strcasecmp(opts[0],"timelimit")==0) { check_argumentcount(filename,lnr,opts[0],nopts==2); diff --git a/nslcd/cfg.h b/nslcd/cfg.h index f3e72d7..54974f6 100644 --- a/nslcd/cfg.h +++ b/nslcd/cfg.h @@ -38,13 +38,6 @@ enum ldap_ssl_options SSL_START_TLS }; -enum ldap_reconnect_policy -{ - LP_RECONNECT_HARD_INIT, - LP_RECONNECT_HARD_OPEN, - LP_RECONNECT_SOFT -}; - /* selectors for different maps */ enum ldap_map_selector { @@ -96,8 +89,6 @@ struct ldap_config int ldc_referrals; /* bind timelimit */ int ldc_bind_timelimit; - /* reconnect policy */ - enum ldap_reconnect_policy ldc_reconnect_pol; /* search timelimit */ int ldc_timelimit; /* idle timeout */ diff --git a/nslcd/myldap.c b/nslcd/myldap.c index 4547295..0454945 100644 --- a/nslcd/myldap.c +++ b/nslcd/myldap.c @@ -589,7 +589,7 @@ static enum nss_status do_map_error(int rc) static int do_with_reconnect(MYLDAP_SEARCH *search) { int rc=LDAP_UNAVAILABLE, tries=0, backoff=0; - int hard=1, start_uri=0, log=0; + int start_uri=0, log=0; enum nss_status stat=NSS_STATUS_UNAVAIL; int msgid; int maxtries; @@ -598,7 +598,7 @@ static int do_with_reconnect(MYLDAP_SEARCH *search) /* get the maximum number of tries */ maxtries=nslcd_cfg->ldc_reconnect_tries; /* keep trying until we have success or a hard failure */ - while ((stat==NSS_STATUS_UNAVAIL)&&(hard)&&(tries<maxtries)) + while ((stat==NSS_STATUS_UNAVAIL)&&(tries<maxtries)) { /* sleep between tries */ if (tries>0) @@ -666,10 +666,6 @@ static int do_with_reconnect(MYLDAP_SEARCH *search) ldap_unbind(search->session->ld); search->session->ld=NULL; } - /* If a soft reconnect policy is specified, then do not - try to reconnect to the LDAP server if it is down. */ - if (nslcd_cfg->ldc_reconnect_pol == LP_RECONNECT_SOFT) - hard = 0; ++tries; } } @@ -679,9 +675,8 @@ static int do_with_reconnect(MYLDAP_SEARCH *search) log_log(LOG_ERR,"could not search LDAP server - %s",ldap_err2string(rc)); return rc; case NSS_STATUS_TRYAGAIN: - log_log(LOG_ERR,"could not %s %sconnect to LDAP server - %s", - hard?"hard":"soft", tries?"re":"", - ldap_err2string(rc)); + log_log(LOG_ERR,"could not %sconnect to LDAP server - %s", + tries?"re":"",ldap_err2string(rc)); return rc; case NSS_STATUS_SUCCESS: if (log) |