lists.arthurdejong.org
RSS feed

nss-pam-ldapd branch master updated. 0.9.4-23-g9f9a5c5

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

nss-pam-ldapd branch master updated. 0.9.4-23-g9f9a5c5



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  9f9a5c52616f443c79a265c16b292b6eb88af8dd (commit)
       via  52ea3f51e1f09d0ce6efd8b2c6275ad2b7284c89 (commit)
       via  4ec1c08378130627a04accb2af854d68faefcd9b (commit)
       via  b2563b0fd147253d7817acf2b79ee3249a871c38 (commit)
       via  4c5a3c9b8409ea20db6b923f86f52d74ec7ca9d9 (commit)
       via  0420232b7989c99ad7992f0f10a47f3f48a28fc7 (commit)
       via  788475f94b27e3583e4bb35d8a7643fe9ff6719d (commit)
       via  95d621ef8cb5d4969e58262eef34b0c0fde9ae6e (commit)
      from  fa6affc66e7829b56d728bb229e6c8fa628bde18 (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=9f9a5c52616f443c79a265c16b292b6eb88af8dd

commit 9f9a5c52616f443c79a265c16b292b6eb88af8dd
Author: Arthur de Jong <arthur@arthurdejong.org>
Date:   Sun Mar 22 13:48:26 2015 +0100

    Fix for networks lookup under Solaris
    
    This fixes a byte order issue when nscd is running.

diff --git a/nss/networks.c b/nss/networks.c
index e1cc84a..7f616e2 100644
--- a/nss/networks.c
+++ b/nss/networks.c
@@ -166,7 +166,7 @@ static char *netent2str(struct netent *result, char 
*buffer, size_t buflen)
 {
   int i, res;
   struct in_addr priv_in_addr;
-  priv_in_addr.s_addr = result->n_net;
+  priv_in_addr.s_addr = htonl(result->n_net);
   res = snprintf(buffer, buflen, "%s %s", result->n_name, 
inet_ntoa(priv_in_addr));
   if ((res < 0) || (res >= (int)buflen))
     return NULL;

http://arthurdejong.org/git/nss-pam-ldapd/commit/?id=52ea3f51e1f09d0ce6efd8b2c6275ad2b7284c89

commit 52ea3f51e1f09d0ce6efd8b2c6275ad2b7284c89
Author: Arthur de Jong <arthur@arthurdejong.org>
Date:   Sun Mar 22 13:11:53 2015 +0100

    Add checks to configure
    
    This adds tests for a function and type used in the code.

diff --git a/configure.ac b/configure.ac
index fed646e..a0b85c2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -377,6 +377,7 @@ AC_CHECK_SIZEOF(unsigned long long int)
 AC_CHECK_SIZEOF(uid_t)
 AC_CHECK_SIZEOF(gid_t)
 AX_TLS()
+AC_CHECK_TYPES(suseconds_t)
 
 # check for support for the struct ether_addr structure
 AC_CHECK_TYPES(struct ether_addr,,, [
@@ -702,6 +703,7 @@ then
   AC_CHECK_FUNCS(getenv putenv clearenv)
   AC_CHECK_FUNCS(dlopen dlsym dlerror)
   AC_CHECK_FUNCS(regcomp regexec regerror)
+  AC_CHECK_FUNCS(hstrerror)
 
   # replace some functions if they are not on the system
   AC_REPLACE_FUNCS(getopt_long)

http://arthurdejong.org/git/nss-pam-ldapd/commit/?id=4ec1c08378130627a04accb2af854d68faefcd9b

commit 4ec1c08378130627a04accb2af854d68faefcd9b
Author: Arthur de Jong <arthur@arthurdejong.org>
Date:   Sun Mar 22 13:10:00 2015 +0100

    ENODATA is missing on FreeBSD
    
    FreeBSD doesn't have ENODATA so we use ENOATTR instead.

diff --git a/nslcd/daemonize.c b/nslcd/daemonize.c
index 8edd81b..60f2d91 100644
--- a/nslcd/daemonize.c
+++ b/nslcd/daemonize.c
@@ -1,7 +1,7 @@
 /*
    daemoninze.c - functions for properly daemonising an application
 
-   Copyright (C) 2014 Arthur de Jong
+   Copyright (C) 2014-2015 Arthur de Jong
 
    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
@@ -103,7 +103,11 @@ static int wait_for_response(int fd)
     log_log(LOG_ERR, "wait_for_response(): read_response() returned %d 
(expected %d)",
             i, (int)sizeof(int));
     if (errno == 0)
+#ifdef ENODATA
       errno = ENODATA;
+#else
+      errno = ENOATTR;
+#endif
     return -1;
   }
   /* read string length */

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

commit b2563b0fd147253d7817acf2b79ee3249a871c38
Author: Arthur de Jong <arthur@arthurdejong.org>
Date:   Sun Mar 22 13:01:17 2015 +0100

    Remove use of irs-nss.h
    
    This was a compatibility leftover from the nss_ldap days.

diff --git a/compat/nss_compat.h b/compat/nss_compat.h
index bdc7d92..755ce91 100644
--- a/compat/nss_compat.h
+++ b/compat/nss_compat.h
@@ -49,9 +49,6 @@
 #ifdef HAVE_NSSWITCH_H
 #include <nsswitch.h>
 #endif /* HAVE_NSSWITCH_H */
-#ifdef HAVE_IRS_NSS_H
-#include "irs-nss.h"
-#endif /* HAVE_IRS_NSS_H */
 
 #include "compat/ether.h"
 
diff --git a/configure.ac b/configure.ac
index 8492867..fed646e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -485,9 +485,6 @@ then
       #endif
       #ifdef HAVE_NSSWITCH_H
       #include <nsswitch.h>
-      #endif
-      #ifdef HAVE_IRS_NSS_H
-      #include "irs-nss.h"
       #endif])
 
   # check if struct nss_XbyY_args has a returnlen attribute
@@ -503,9 +500,6 @@ then
       #endif
       #ifdef HAVE_NSSWITCH_H
       #include <nsswitch.h>
-      #endif
-      #ifdef HAVE_IRS_NSS_H
-      #include "irs-nss.h"
       #endif]])
 
   # check which NSS flavour to build

http://arthurdejong.org/git/nss-pam-ldapd/commit/?id=4c5a3c9b8409ea20db6b923f86f52d74ec7ca9d9

commit 4c5a3c9b8409ea20db6b923f86f52d74ec7ca9d9
Author: Arthur de Jong <arthur@arthurdejong.org>
Date:   Sat Mar 21 21:13:45 2015 +0100

    Prevent numer overflow in test_clock

diff --git a/tests/test_clock.c b/tests/test_clock.c
index 8d55f93..e1ed740 100644
--- a/tests/test_clock.c
+++ b/tests/test_clock.c
@@ -2,7 +2,7 @@
    test_clock.c - tests for finding usable system clocks
    This file is part of the nss-pam-ldapd library.
 
-   Copyright (C) 2013 Arthur de Jong
+   Copyright (C) 2013-2015 Arthur de Jong
 
    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
@@ -73,7 +73,7 @@ static int test_clock_gettime(clockid_t c, const char *cname)
   else
     printf("OK   clock %s time: %ld.%09ld\n", cname, (long)t4.tv_sec, 
(long)t4.tv_nsec);
   /* calculate difference */
-  diff = ((long)t4.tv_sec - (long)t2.tv_sec - (long)t3.tv_sec) * 
(long)1000000000 +
+  diff = ((long)t4.tv_sec - (long)t2.tv_sec - (long)t3.tv_sec) * 1000000000L +
          ((long)t4.tv_nsec - (long)t2.tv_nsec - (long)t3.tv_nsec);
   if ((diff < (-10 * 1000 * 1000)) || (diff > (20 * 1000 * 1000)))
   {
@@ -84,7 +84,7 @@ static int test_clock_gettime(clockid_t c, const char *cname)
     printf("OK   ");
   printf("clock %s time diff: %s%ld.%09ld %.1f%%\n", cname, (diff < 0) ? "-" : 
"",
          (labs(diff) / 1000000000L), (labs(diff) % 1000000000L),
-         labs(100L * diff) / (float)((long)t3.tv_sec * 1000000000L + 
(long)t3.tv_nsec));
+         (float)labs(diff) / (float)((long)t3.tv_sec * 10000000L + 
(long)t3.tv_nsec / 100));
   return result;
 }
 

http://arthurdejong.org/git/nss-pam-ldapd/commit/?id=0420232b7989c99ad7992f0f10a47f3f48a28fc7

commit 0420232b7989c99ad7992f0f10a47f3f48a28fc7
Author: Arthur de Jong <arthur@arthurdejong.org>
Date:   Sat Mar 21 18:54:32 2015 +0100

    Various small fixes when using --with-module-name
    
    This updates the test framework to support --with-module-name, ensures
    that exports.map is rebuilt when configure is re-ran, fixes parsing of
    nsswitch.conf (to determine what to return for passwd lookups) and fixes
    the check for _nss_ldap_version.

diff --git a/nslcd/nslcd.c b/nslcd/nslcd.c
index 36b151d..f765b9c 100644
--- a/nslcd/nslcd.c
+++ b/nslcd/nslcd.c
@@ -612,7 +612,7 @@ static void disable_nss_ldap(void)
   /* clear any existing errors */
   dlerror();
   /* lookup the NSS version if possible */
-  version_info = (char **)dlsym(handle, "_nss_ldap_version");
+  version_info = (char **)dlsym(handle, "_nss_" MODULE_NAME "_version");
   error = dlerror();
   if ((version_info != NULL) && (error == NULL))
     log_log(LOG_DEBUG, "NSS_LDAP %s %s", version_info[0], version_info[1]);
diff --git a/nslcd/nsswitch.c b/nslcd/nsswitch.c
index ff9d9d5..babf40e 100644
--- a/nslcd/nsswitch.c
+++ b/nslcd/nsswitch.c
@@ -1,7 +1,7 @@
 /*
    nsswitch.c - functions for parsing /etc/nsswitch.conf
 
-   Copyright (C) 2011, 2012 Arthur de Jong
+   Copyright (C) 2011-2015 Arthur de Jong
 
    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
@@ -151,7 +151,7 @@ static int shadow_uses_ldap(void)
     if (services != NULL)
     {
       shadow_found = 1;
-      if (has_service(services, "ldap", NSSWITCH_FILE, lnr))
+      if (has_service(services, MODULE_NAME, NSSWITCH_FILE, lnr))
       {
         fclose(fp);
         return 1;
@@ -160,7 +160,7 @@ static int shadow_uses_ldap(void)
     /* see if we have a passwd line */
     services = find_db(linebuf, "passwd");
     if (services != NULL)
-      passwd_has_ldap = has_service(services, "ldap", NSSWITCH_FILE, lnr);
+      passwd_has_ldap = has_service(services, MODULE_NAME, NSSWITCH_FILE, lnr);
   }
   fclose(fp);
   if (shadow_found)
diff --git a/nss/Makefile.am b/nss/Makefile.am
index cfa05e0..1a8f35a 100644
--- a/nss/Makefile.am
+++ b/nss/Makefile.am
@@ -44,7 +44,7 @@ nss_ldap_so_DEPENDENCIES = $(nss_ldap_so_LDADD) exports.map
 EXTRA_DIST = exports.glibc exports.solaris exports.freebsd
 CLEANFILES = exports.map
 
-exports.map: $(EXTRA_DIST)
+exports.map: $(EXTRA_DIST) Makefile
        sed 's/ldap/@MODULE_NAME@/' < $(srcdir)/exports.$(NSS_FLAVOUR) > 
exports.map
 
 install-exec-local: install-nss_ldap_so
diff --git a/tests/testenv.sh b/tests/testenv.sh
index 6b59873..4d807b8 100755
--- a/tests/testenv.sh
+++ b/tests/testenv.sh
@@ -2,7 +2,7 @@
 
 # testenv.sh - script to check test environment
 #
-# Copyright (C) 2011, 2013 Arthur de Jong
+# Copyright (C) 2011-2015 Arthur de Jong
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -24,16 +24,24 @@ set -e
 # get the script name
 script="`basename "$0"`"
 
-# find source directory (used for finding auxiliary files)
+# find source and build directory (used for finding auxiliary files)
 srcdir="${srcdir-`dirname "$0"`}"
+builddir="${builddir-`dirname "$0"`}"
 
 # location of nslcd configuration file
 nslcd_cfg="${nslcd_cfg-/etc/nslcd.conf}"
 
+# the configured module name (usually ldap)
+if [ -f "$builddir"/../config.h ]
+then
+  module_name=`sed -n 's/^#define MODULE_NAME "\(.*\)"$/\1/p' 
"$builddir"/../config.h`
+fi
+module_name="${module_name-ldap}"
+
 # find the names of services that are configured to use LDAP
 nss_list_configured()
 {
-  sed -n 's/^[ \t]*\([a-z]*\)[ \t]*:.*[ \t]ldap.*$/\1/p' /etc/nsswitch.conf \
+  sed -n 's/^[ \t]*\([a-z]*\)[ \t]*:.*[ \t]'$module_name'.*$/\1/p' 
/etc/nsswitch.conf \
     | xargs
 }
 
@@ -41,7 +49,7 @@ nss_list_configured()
 nss_is_enabled()
 {
   name="$1"
-  grep '^[ \t]*'$name'[ \t]*:.*ldap.*' /etc/nsswitch.conf > /dev/null
+  grep '^[ \t]*'$name'[ \t]*:.*'$module_name'.*' /etc/nsswitch.conf > /dev/null
 }
 
 # check to see if name is configured to do lookups through
@@ -57,10 +65,10 @@ nss_enable()
     if grep -q '^[ \t]*'$name'[ \t]*:' /etc/nsswitch.conf
     then
       # modify an existing entry by just adding ldap to the end
-      sed -i 's/^\([ \t]*'$name'[ \t]*:.*[^ \t]\)[ \t]*$/\1 ldap/' 
/etc/nsswitch.conf
+      sed -i 's/^\([ \t]*'$name'[ \t]*:.*[^ \t]\)[ \t]*$/\1 '$module_name'/' 
/etc/nsswitch.conf
     else
       # append a new line
-      printf '%-15s ldap\n' $name':' >> /etc/nsswitch.conf
+      printf '%-15s '$module_name'\n' $name':' >> /etc/nsswitch.conf
     fi
     # invalidate nscd cache
     nscd -i "$name" > /dev/null 2>&1 || true

http://arthurdejong.org/git/nss-pam-ldapd/commit/?id=788475f94b27e3583e4bb35d8a7643fe9ff6719d

commit 788475f94b27e3583e4bb35d8a7643fe9ff6719d
Author: Arthur de Jong <arthur@arthurdejong.org>
Date:   Sat Mar 21 14:13:53 2015 +0100

    Also support platforms without TLS
    
    This disables the use of thread-local storage in the NSS module when it
    is not available in libc. This results in the get*ent() functions not
    being thread-safe. However, on most platforms they are not expected to
    be thread-safe anyway.

diff --git a/nss/common.h b/nss/common.h
index 0bc4440..82b3d49 100644
--- a/nss/common.h
+++ b/nss/common.h
@@ -35,6 +35,13 @@
 #include "solnss.h"
 #endif /* NSS_FLAVOUR_SOLARIS */
 
+/* If not TLS (thread local storage) is available on the platform
+   don't use it. This should not be a problem on most platforms because
+   get*ent() is not expected to be thread-safe (at least not on Glibc). */
+#ifndef TLS
+#define TLS
+#endif /* not TLS */
+
 /* skip timeout determines the maximum time to wait when closing the
    connection and reading whatever data that is available */
 #define SKIP_TIMEOUT 500

http://arthurdejong.org/git/nss-pam-ldapd/commit/?id=95d621ef8cb5d4969e58262eef34b0c0fde9ae6e

commit 95d621ef8cb5d4969e58262eef34b0c0fde9ae6e
Author: Dalibor Pospíšil <dapospis@redhat.com>
Date:   Fri Mar 20 10:58:40 2015 -0400

    Document that multiple URIs can be specified
    
    Update nslcd.conf man page that multiple URIs can be set by using more
    uri lines or more URIs defined on one uri line.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1204195

diff --git a/man/nslcd.conf.5.xml b/man/nslcd.conf.5.xml
index 5f866f7..dbf4d8b 100644
--- a/man/nslcd.conf.5.xml
+++ b/man/nslcd.conf.5.xml
@@ -140,7 +140,7 @@
    <variablelist>
 
     <varlistentry id="uri"> <!-- since 0.1 -->
-     <term><option>uri</option> <replaceable>URI</replaceable></term>
+     <term><option>uri</option> <replaceable>URI</replaceable> ...</term>
      <listitem>
       <para>
        Specifies the <acronym>LDAP</acronym> <acronym>URI</acronym> of the
@@ -166,7 +166,8 @@
        time this should not be needed.
       </para>
       <para>
-       This option may be specified multiple times. Normally, only the first
+       This option may be specified multiple times and/or with more
+       URIs on the line, separated by space. Normally, only the first
        server will be used with the following servers as fall-back (see
        <option>bind_timelimit</option> below).
       </para>

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

Summary of changes:
 compat/nss_compat.h  |    3 ---
 configure.ac         |    8 ++------
 man/nslcd.conf.5.xml |    5 +++--
 nslcd/daemonize.c    |    6 +++++-
 nslcd/nslcd.c        |    2 +-
 nslcd/nsswitch.c     |    6 +++---
 nss/Makefile.am      |    2 +-
 nss/common.h         |    7 +++++++
 nss/networks.c       |    2 +-
 tests/test_clock.c   |    6 +++---
 tests/testenv.sh     |   20 ++++++++++++++------
 11 files changed, 40 insertions(+), 27 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/