lists.arthurdejong.org
RSS feed

nss-pam-ldapd branch master updated. 0.8.12-137-g302c2fa

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

nss-pam-ldapd branch master updated. 0.8.12-137-g302c2fa



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  302c2fab5dd647aa5f4d3afd58e99fa274a7f08e (commit)
       via  8790b4070a62f391aa189e6450b6b597b86ec1cd (commit)
      from  932c641bb17c7e19a11ad9f4c771c01cd0592bef (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=302c2fab5dd647aa5f4d3afd58e99fa274a7f08e

commit 302c2fab5dd647aa5f4d3afd58e99fa274a7f08e
Author: Arthur de Jong <arthur@arthurdejong.org>
Date:   Thu Mar 28 23:43:49 2013 +0100

    Make the NSS tests dependant on the configuration of nsswitch.conf

diff --git a/tests/test_nsscmds.sh b/tests/test_nsscmds.sh
index 676c4a6..2afa14c 100755
--- a/tests/test_nsscmds.sh
+++ b/tests/test_nsscmds.sh
@@ -2,7 +2,7 @@
 
 # test_nsscmds.sh - simple test script to check output of name lookup commands
 #
-# Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 Arthur de Jong
+# Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 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
@@ -57,6 +57,8 @@ check() {
 
 ###########################################################################
 
+if grep '^aliases.*ldap' /etc/nsswitch.conf > /dev/null 2>&1
+then
 echo "test_nsscmds.sh: testing aliases..."
 
 # note that this doesn't work if /etc/aliases contains anything
@@ -83,8 +85,12 @@ check "getent aliases FOO" << EOM
 foo:            bar@example.com
 EOM
 
+fi  # end of aliases tests
+
 ###########################################################################
 
+if grep '^ethers.*ldap' /etc/nsswitch.conf > /dev/null 2>&1
+then
 echo "test_nsscmds.sh: testing ether..."
 
 # get an entry by hostname
@@ -118,8 +124,12 @@ check "getent ethers" << EOM
 Enumeration not supported on ethers
 EOM
 
+fi  # end of ethers tests
+
 ###########################################################################
 
+if grep '^group.*ldap' /etc/nsswitch.conf > /dev/null 2>&1
+then
 echo "test_nsscmds.sh: testing group..."
 
 # function to sort group members of a group
@@ -204,8 +214,12 @@ check "groups testusr3 | sed 's/^.* *: *//'" << EOM
 users largegroup nstgrp2 nstgrp3
 EOM
 
+fi  # end of group tests
+
 ###########################################################################
 
+if grep '^hosts.*ldap' /etc/nsswitch.conf > /dev/null 2>&1
+then
 echo "test_nsscmds.sh: testing hosts..."
 
 check "getent hosts testhost" << EOM
@@ -231,8 +245,12 @@ EOM
 
 # TODO: add more tests for IPv6 support
 
+fi  # end of hosts tests
+
 ###########################################################################
 
+if grep '^netgroup.*ldap' /etc/nsswitch.conf > /dev/null 2>&1
+then
 echo "test_nsscmds.sh: testing netgroup..."
 
 # check netgroup lookup of test netgroup
@@ -244,8 +262,12 @@ EOM
 check "getent netgroup TSTNETGROUP" << EOM
 EOM
 
+fi  # end of netgroup tests
+
 ###########################################################################
 
+if grep '^networks.*ldap' /etc/nsswitch.conf > /dev/null 2>&1
+then
 echo "test_nsscmds.sh: testing networks..."
 
 check "getent networks testnet" << EOM
@@ -265,8 +287,12 @@ check "getent networks | grep testnet" << EOM
 testnet               10.0.0.0
 EOM
 
+fi  # end of networks tests
+
 ###########################################################################
 
+if grep '^passwd.*ldap' /etc/nsswitch.conf > /dev/null 2>&1
+then
 echo "test_nsscmds.sh: testing passwd..."
 
 check "getent passwd ecolden" << EOM
@@ -290,8 +316,12 @@ check "getent passwd | grep -c ':x:[45][0-9][0-9][0-9]:'" 
<< EOM
 2000
 EOM
 
+fi  # end of passwd tests
+
 ###########################################################################
 
+if grep '^protocols.*ldap' /etc/nsswitch.conf > /dev/null 2>&1
+then
 echo "test_nsscmds.sh: testing protocols..."
 
 check "getent protocols protfoo" << EOM
@@ -322,8 +352,12 @@ check "getent protocols | grep protfoo" << EOM
 protfoo               253 protfooalias
 EOM
 
+fi  # end of protocols tests
+
 ###########################################################################
 
+if grep '^rpc.*ldap' /etc/nsswitch.conf > /dev/null 2>&1
+then
 echo "test_nsscmds.sh: testing rpc..."
 
 check "getent rpc rpcfoo" << EOM
@@ -346,8 +380,12 @@ check "getent rpc | grep rpcfoo" << EOM
 rpcfoo          160002  rpcfooalias
 EOM
 
+fi  # end of rpc tests
+
 ###########################################################################
 
+if grep '^services.*ldap' /etc/nsswitch.conf > /dev/null 2>&1
+then
 echo "test_nsscmds.sh: testing services..."
 
 check "getent services foosrv" << EOM
@@ -406,8 +444,12 @@ check "getent services | wc -l" << EOM
 `grep -c '^[^#].' /etc/services | awk '{print $1 + 4}'`
 EOM
 
+fi  # end of services tests
+
 ###########################################################################
 
+if grep '^shadow.*ldap' /etc/nsswitch.conf > /dev/null 2>&1
+then
 echo "test_nsscmds.sh: testing shadow..."
 
 # NOTE: the output of this should depend on whether we are root or not
@@ -433,6 +475,8 @@ EOM
 getent passwd | sed 's/:.*//' | sort | \
   check "getent shadow | sed 's/:.*//' | sort"
 
+fi  # end of shadow tests
+
 ###########################################################################
 # determine the result
 

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

commit 8790b4070a62f391aa189e6450b6b597b86ec1cd
Author: Arthur de Jong <arthur@arthurdejong.org>
Date:   Thu Mar 28 22:46:15 2013 +0100

    Do not rely on printf() being able to print NULL strings

diff --git a/tests/test_myldap.c b/tests/test_myldap.c
index 4239082..d95157f 100644
--- a/tests/test_myldap.c
+++ b/tests/test_myldap.c
@@ -208,6 +208,7 @@ static void test_get_rdnvalues(void)
   const char *attrs[] = { "cn", "uid", NULL };
   int rc;
   char buf[80];
+  const char *rdnval;
   /* initialize session */
   printf("test_myldap: test_get_rdnvalues(): getting session...\n");
   session = myldap_create_session();
@@ -223,24 +224,30 @@ static void test_get_rdnvalues(void)
   printf("test_myldap: test_get_rdnvalues(): got DN %s\n",
          myldap_get_dn(entry));
   /* get some values from DN */
+  rdnval = myldap_get_rdn_value(entry, "uid");
   printf("test_myldap: test_get_rdnvalues(): DN.uid=%s\n",
-         myldap_get_rdn_value(entry, "uid"));
+           rdnval == NULL ? "NULL" : rdnval);
+  rdnval = myldap_get_rdn_value(entry, "cn");
   printf("test_myldap: test_get_rdnvalues(): DN.cn=%s\n",
-         myldap_get_rdn_value(entry, "cn"));
+           rdnval == NULL ? "NULL" : rdnval);
+  rdnval = myldap_get_rdn_value(entry, "uidNumber");
   printf("test_myldap: test_get_rdnvalues(): DN.uidNumber=%s\n",
-         myldap_get_rdn_value(entry, "uidNumber"));
+           rdnval == NULL ? "NULL" : rdnval);
   /* clean up */
   myldap_session_close(session);
   /* some tests */
+  rdnval = myldap_cpy_rdn_value("cn=Aka 
Ashbach+uid=aashbach,ou=lotsofpeople,dc=test,dc=tld",
+                                "uid", buf, sizeof(buf));
   printf("test_myldap: test_get_rdnvalues(): DN.uid=%s\n",
-         myldap_cpy_rdn_value("cn=Aka 
Ashbach+uid=aashbach,ou=lotsofpeople,dc=test,dc=tld",
-                               "uid", buf, sizeof(buf)));
+           rdnval == NULL ? "NULL" : rdnval);
+  rdnval = myldap_cpy_rdn_value("cn=Aka 
Ashbach+uid=aashbach,ou=lotsofpeople,dc=test,dc=tld",
+                                "cn", buf, sizeof(buf));
   printf("test_myldap: test_get_rdnvalues(): DN.cn=%s\n",
-         myldap_cpy_rdn_value("cn=Aka 
Ashbach+uid=aashbach,ou=lotsofpeople,dc=test,dc=tld",
-                              "cn", buf, sizeof(buf)));
+           rdnval == NULL ? "NULL" : rdnval);
+  rdnval = myldap_cpy_rdn_value("cn=Aka 
Ashbach+uid=aashbach,ou=lotsofpeople,dc=test,dc=tld",
+                                "uidNumber", buf, sizeof(buf));
   printf("test_myldap: test_get_rdnvalues(): DN.uidNumber=%s\n",
-         myldap_cpy_rdn_value("cn=Aka 
Ashbach+uid=aashbach,ou=lotsofpeople,dc=test,dc=tld",
-                              "uidNumber", buf, sizeof(buf)));
+           rdnval == NULL ? "NULL" : rdnval);
 }
 
 /* this method tests to see if we can perform two searches within

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

Summary of changes:
 tests/test_myldap.c   |   25 ++++++++++++++++---------
 tests/test_nsscmds.sh |   46 +++++++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 61 insertions(+), 10 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/