lists.arthurdejong.org
RSS feed

nss-pam-ldapd branch master updated. 0.9.4-4-g82e4423

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

nss-pam-ldapd branch master updated. 0.9.4-4-g82e4423



This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "nss-pam-ldapd".

The branch, master has been updated
       via  82e4423d4d17d2d09f82855bbae4bee62cc9c22a (commit)
       via  29507979da85db4628993fedfea1c7d174714461 (commit)
       via  1765e344b88199e36e79a241b1f0d09aecb9b92a (commit)
      from  9516479505bcc750b1e52ff40a96720496d48f61 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://arthurdejong.org/git/nss-pam-ldapd/commit/?id=82e4423d4d17d2d09f82855bbae4bee62cc9c22a

commit 82e4423d4d17d2d09f82855bbae4bee62cc9c22a
Author: Tim Harder <radhermit@gmail.com>
Date:   Mon Jun 30 15:29:06 2014 -0700

    Minor comment spelling fix

diff --git a/nslcd/myldap.c b/nslcd/myldap.c
index 34d23be..cf16dd6 100644
--- a/nslcd/myldap.c
+++ b/nslcd/myldap.c
@@ -1402,7 +1402,7 @@ MYLDAP_SEARCH *myldap_search(MYLDAP_SESSION *session,
       *rcp = LDAP_OPERATIONS_ERROR;
     return NULL;
   }
-  /* regsiter search with the session so we can free it later on */
+  /* register search with the session so we can free it later on */
   session->searches[i] = search;
   /* do the search with retries to all configured servers */
   rc = do_retry_search(search);

http://arthurdejong.org/git/nss-pam-ldapd/commit/?id=29507979da85db4628993fedfea1c7d174714461

commit 29507979da85db4628993fedfea1c7d174714461
Author: Tim Harder <radhermit@gmail.com>
Date:   Mon Jun 30 15:29:05 2014 -0700

    Check a socket's connectivity before trying to use it
    
    This alleviates some cases where multi-second lag occurs before a query
    returns due to some or all connections having been closed by the peer,
    e.g. a load balancer timing out old connections, but they are all tried
    before opening new connections.
    
    Tested and working on Linux.

diff --git a/AUTHORS b/AUTHORS
index 8426b1a..4320dc9 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -129,3 +129,4 @@ Francois Tigeot <ftigeot@wolfpond.org>
 Davy Defaud <davy.defaud@free.fr>
 Lukas Slebodnik <lslebodn@redhat.com>
 ushi <ushi@honkgong.info>
+Tim Harder <radhermit@gmail.com>
diff --git a/nslcd/myldap.c b/nslcd/myldap.c
index 7babe0e..34d23be 100644
--- a/nslcd/myldap.c
+++ b/nslcd/myldap.c
@@ -952,6 +952,10 @@ void myldap_session_check(MYLDAP_SESSION *session)
 {
   int i;
   time_t current_time;
+  int sd;
+  int rc;
+  struct sockaddr sa;
+  socklen_t salen = sizeof(sa);
   /* check parameters */
   if (session == NULL)
   {
@@ -959,19 +963,41 @@ void myldap_session_check(MYLDAP_SESSION *session)
     errno = EINVAL;
     return;
   }
-  /* check if we should time out the connection */
-  if ((session->ld != NULL) && (nslcd_cfg->idle_timelimit > 0))
+  if (session->ld != NULL)
   {
-    /* if we have any running searches, don't time out */
-    for (i = 0; i < MAX_SEARCHES_IN_SESSION; i++)
-      if ((session->searches[i] != NULL) && (session->searches[i]->valid))
-        return;
-    /* consider timeout (there are no running searches) */
-    time(&current_time);
-    if ((session->lastactivity + nslcd_cfg->idle_timelimit) < current_time)
+    rc = ldap_get_option(session->ld, LDAP_OPT_DESC, &sd);
+    if (rc != LDAP_SUCCESS)
     {
-      log_log(LOG_DEBUG, "myldap_session_check(): idle_timelimit reached");
-      do_close(session);
+      myldap_err(LOG_WARNING, session->ld, rc,
+                 "ldap_get_option(LDAP_OPT_DESC) failed (ignored)");
+    }
+    else
+    {
+      /* check if the connection was closed by the peer */
+      if (getpeername(sd, &sa, &salen) == -1)
+      {
+        if (errno == ENOTCONN)
+        {
+          log_log(LOG_DEBUG, "myldap_session_check(): connection reset by 
peer");
+          do_close(session);
+          return;
+        }
+      }
+    }
+    /* check if we should time out the connection */
+    if (nslcd_cfg->idle_timelimit > 0)
+    {
+      /* if we have any running searches, don't time out */
+      for (i = 0; i < MAX_SEARCHES_IN_SESSION; i++)
+        if ((session->searches[i] != NULL) && (session->searches[i]->valid))
+          return;
+      /* consider timeout (there are no running searches) */
+      time(&current_time);
+      if ((session->lastactivity + nslcd_cfg->idle_timelimit) < current_time)
+      {
+        log_log(LOG_DEBUG, "myldap_session_check(): idle_timelimit reached");
+        do_close(session);
+      }
     }
   }
 }

http://arthurdejong.org/git/nss-pam-ldapd/commit/?id=1765e344b88199e36e79a241b1f0d09aecb9b92a

commit 1765e344b88199e36e79a241b1f0d09aecb9b92a
Author: Arthur de Jong <arthur@arthurdejong.org>
Date:   Fri Jun 20 16:17:29 2014 +0200

    Fix copy-pasto

diff --git a/nslcd/common.h b/nslcd/common.h
index be54ddc..5ca06c1 100644
--- a/nslcd/common.h
+++ b/nslcd/common.h
@@ -182,7 +182,7 @@ void invalidator_do(enum ldap_map_selector map);
 #error unable to find implementation for strtouid()
 #endif
 
-/* provide strtouid() function alias */
+/* provide strtogid() function alias */
 #if SIZEOF_GID_T == SIZEOF_UNSIGNED_LONG_INT
 #define strtogid (gid_t)strtoul
 #elif SIZEOF_GID_T == SIZEOF_UNSIGNED_LONG_LONG_INT
@@ -191,7 +191,7 @@ void invalidator_do(enum ldap_map_selector map);
 #ifndef WANT_STRTOUI
 #define WANT_STRTOUI 1
 #endif
-#define strtogid (uid_t)strtoui
+#define strtogid (gid_t)strtoui
 #else
 #error unable to find implementation for strtogid()
 #endif

-----------------------------------------------------------------------

Summary of changes:
 AUTHORS        |    1 +
 nslcd/common.h |    4 ++--
 nslcd/myldap.c |   50 ++++++++++++++++++++++++++++++++++++++------------
 3 files changed, 41 insertions(+), 14 deletions(-)


hooks/post-receive
-- 
nss-pam-ldapd
-- 
To unsubscribe send an email to
nss-pam-ldapd-commits-unsubscribe@lists.arthurdejong.org or see
http://lists.arthurdejong.org/nss-pam-ldapd-commits/