lists.arthurdejong.org
RSS feed

nss-pam-ldapd commit: r1094 - in nss-pam-ldapd: debian man nslcd tests

[Date Prev][Date Next] [Thread Prev][Thread Next]

nss-pam-ldapd commit: r1094 - in nss-pam-ldapd: debian man nslcd tests



Author: arthur
Date: Sun May  9 12:39:45 2010
New Revision: 1094
URL: http://arthurdejong.org/viewvc/nss-pam-ldapd?view=rev&revision=1094

Log:
rename reconnect_maxsleeptime option to reconnect_retrytime

Modified:
   nss-pam-ldapd/debian/nslcd.postinst
   nss-pam-ldapd/man/nslcd.conf.5.xml
   nss-pam-ldapd/nslcd/cfg.c
   nss-pam-ldapd/nslcd/cfg.h
   nss-pam-ldapd/nslcd/myldap.c
   nss-pam-ldapd/tests/README
   nss-pam-ldapd/tests/nslcd-test.conf

Modified: nss-pam-ldapd/debian/nslcd.postinst
==============================================================================
--- nss-pam-ldapd/debian/nslcd.postinst Sun May  9 12:20:23 2010        (r1093)
+++ nss-pam-ldapd/debian/nslcd.postinst Sun May  9 12:39:45 2010        (r1094)
@@ -223,6 +223,12 @@
   fi
   # we're done
   db_stop
+  # rename reconnect_maxsleeptime to reconnect_retrytime
+  if grep -qi '^reconnect_maxsleeptime[[:space:]]' $CONFFILE
+  then
+    echo "Renaming reconnect_maxsleeptime to reconnect_retrytime in 
$CONFFILE..." >&2
+    sed -i 's/^reconnect_maxsleeptime[[:space:]]/reconnect_retrytime /' 
"$CONFFILE"
+  fi
   # fix permissions of configfile if upgrading from an old version
   if dpkg --compare-versions "$2" lt-nl "0.6.7.1"
   then

Modified: nss-pam-ldapd/man/nslcd.conf.5.xml
==============================================================================
--- nss-pam-ldapd/man/nslcd.conf.5.xml  Sun May  9 12:20:23 2010        (r1093)
+++ nss-pam-ldapd/man/nslcd.conf.5.xml  Sun May  9 12:39:45 2010        (r1094)
@@ -467,7 +467,7 @@
     </varlistentry>
 
     <varlistentry>
-     <term><option>reconnect_maxsleeptime</option> 
<replaceable>SECONDS</replaceable></term>
+     <term><option>reconnect_retrytime</option> 
<replaceable>SECONDS</replaceable></term>
      <listitem>
       <para>
        Specifies the time after which the <acronym>LDAP</acronym> server is

Modified: nss-pam-ldapd/nslcd/cfg.c
==============================================================================
--- nss-pam-ldapd/nslcd/cfg.c   Sun May  9 12:20:23 2010        (r1093)
+++ nss-pam-ldapd/nslcd/cfg.c   Sun May  9 12:39:45 2010        (r1094)
@@ -112,7 +112,7 @@
   cfg->ldc_timelimit=LDAP_NO_LIMIT;
   cfg->ldc_idle_timelimit=0;
   cfg->ldc_reconnect_sleeptime=1;
-  cfg->ldc_reconnect_maxsleeptime=10;
+  cfg->ldc_reconnect_retrytime=10;
 #ifdef LDAP_OPT_X_TLS
   cfg->ldc_ssl_on=SSL_OFF;
 #endif /* LDAP_OPT_X_TLS */
@@ -924,9 +924,12 @@
       get_int(filename,lnr,keyword,&line,&cfg->ldc_reconnect_sleeptime);
       get_eol(filename,lnr,keyword,&line);
     }
-    else if (strcasecmp(keyword,"reconnect_maxsleeptime")==0)
+    else if ( (strcasecmp(keyword,"reconnect_retrytime")==0) ||
+              (strcasecmp(keyword,"reconnect_maxsleeptime")==0) )
     {
-      get_int(filename,lnr,keyword,&line,&cfg->ldc_reconnect_maxsleeptime);
+      if (strcasecmp(keyword,"reconnect_maxsleeptime")==0)
+        log_log(LOG_WARNING,"%s:%d: option %s has been renamed to 
reconnect_retrytime",filename,lnr,keyword);
+      get_int(filename,lnr,keyword,&line,&cfg->ldc_reconnect_retrytime);
       get_eol(filename,lnr,keyword,&line);
     }
 #ifdef LDAP_OPT_X_TLS

Modified: nss-pam-ldapd/nslcd/cfg.h
==============================================================================
--- nss-pam-ldapd/nslcd/cfg.h   Sun May  9 12:20:23 2010        (r1093)
+++ nss-pam-ldapd/nslcd/cfg.h   Sun May  9 12:39:45 2010        (r1094)
@@ -124,7 +124,7 @@
   /* seconds to sleep; doubled until max */
   int ldc_reconnect_sleeptime;
   /* maximum seconds to sleep */
-  int ldc_reconnect_maxsleeptime;
+  int ldc_reconnect_retrytime;
 #ifdef LDAP_OPT_X_TLS
   /* SSL enabled */
   enum ldap_ssl_options ldc_ssl_on;

Modified: nss-pam-ldapd/nslcd/myldap.c
==============================================================================
--- nss-pam-ldapd/nslcd/myldap.c        Sun May  9 12:20:23 2010        (r1093)
+++ nss-pam-ldapd/nslcd/myldap.c        Sun May  9 12:39:45 2010        (r1094)
@@ -805,7 +805,7 @@
   for (start_uri=0;start_uri<NSS_LDAP_CONFIG_URI_MAX;start_uri++)
     dotry[start_uri]=1;
   /* keep trying until we time out */
-  endtime=time(NULL)+nslcd_cfg->ldc_reconnect_maxsleeptime;
+  endtime=time(NULL)+nslcd_cfg->ldc_reconnect_retrytime;
   while (1)
   {
     nexttry=endtime;
@@ -818,8 +818,8 @@
       /* only try this URI if we should */
       if (!dotry[search->session->current_uri])
       { /* skip this URI */ }
-      else if ( (current_uri->lastfail > 
(current_uri->firstfail+nslcd_cfg->ldc_reconnect_maxsleeptime)) &&
-                ((t=time(NULL)) < 
(current_uri->lastfail+nslcd_cfg->ldc_reconnect_maxsleeptime)) )
+      else if ( (current_uri->lastfail > 
(current_uri->firstfail+nslcd_cfg->ldc_reconnect_retrytime)) &&
+                ((t=time(NULL)) < 
(current_uri->lastfail+nslcd_cfg->ldc_reconnect_retrytime)) )
       {
         /* we are in a hard fail state and have retried not long ago */
         log_log(LOG_DEBUG,"not retrying server %s which failed just %d 
second(s) ago and has been failing for %d seconds",
@@ -860,7 +860,7 @@
             (rc==LDAP_AUTH_METHOD_NOT_SUPPORTED))
           dotry[search->session->current_uri]=0;
         /* check whether we should try this URI again */
-        else if (t <= 
(current_uri->firstfail+nslcd_cfg->ldc_reconnect_maxsleeptime))
+        else if (t <= 
(current_uri->firstfail+nslcd_cfg->ldc_reconnect_retrytime))
         {
           t+=nslcd_cfg->ldc_reconnect_sleeptime;
           if (t<nexttry)

Modified: nss-pam-ldapd/tests/README
==============================================================================
--- nss-pam-ldapd/tests/README  Sun May  9 12:20:23 2010        (r1093)
+++ nss-pam-ldapd/tests/README  Sun May  9 12:39:45 2010        (r1094)
@@ -68,7 +68,7 @@
 timelimit 2
 bind_timelimit 4
 reconnect_sleeptime 4
-reconnect_maxsleeptime 10
+reconnect_retrytime 10
 filter group (|(objectClass=posixGroup)(objectClass=groupOfUniqueNames))
 
 

Modified: nss-pam-ldapd/tests/nslcd-test.conf
==============================================================================
--- nss-pam-ldapd/tests/nslcd-test.conf Sun May  9 12:20:23 2010        (r1093)
+++ nss-pam-ldapd/tests/nslcd-test.conf Sun May  9 12:39:45 2010        (r1094)
@@ -25,4 +25,4 @@
 timelimit 2
 bind_timelimit 4
 reconnect_sleeptime 4
-reconnect_maxsleeptime 10
+reconnect_retrytime 10
--
To unsubscribe send an email to
nss-pam-ldapd-commits-unsubscribe@lists.arthurdejong.org or see
http://lists.arthurdejong.org/nss-pam-ldapd-commits