lists.arthurdejong.org
RSS feed

nss-pam-ldapd branch master updated. 0.9.1-43-gef0edda

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

nss-pam-ldapd branch master updated. 0.9.1-43-gef0edda



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  ef0eddaad62f3b94689b7339ffc18d7873adbe6a (commit)
       via  f8af48faa18b6d9017ea64f4df2d6ee2b1743df3 (commit)
       via  88801f9e5a01e580adae4f386c0c755fb2a17b79 (commit)
       via  933bf8e2a5774e266297c29d88ecec451530aa5b (commit)
       via  6028226130e26addfacca04807b6fc078eba160e (commit)
       via  ed4cf4722c413675e63b4ca2c15046bb80244784 (commit)
      from  503644bdd089836230d2e52a14b23236d5926f41 (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=ef0eddaad62f3b94689b7339ffc18d7873adbe6a

commit ef0eddaad62f3b94689b7339ffc18d7873adbe6a
Author: Arthur de Jong <arthur@arthurdejong.org>
Date:   Tue Oct 29 23:26:58 2013 +0100

    Portability fixes to environment tests
    
    This mostly tries to reduce the influences of the test environment
    (local users and groups) on the tests. This uses another username
    (vsefcovic) in the PAM tests instead of the user arthur to avoid clashes
    with existing users.
    
    The PAM tests are skipped if passwd claims that it cannot modify LDAP
    passwords (for FreeBSD).

diff --git a/tests/test_myldap.sh b/tests/test_myldap.sh
index c5b71d0..4f48d19 100755
--- a/tests/test_myldap.sh
+++ b/tests/test_myldap.sh
@@ -26,7 +26,7 @@
 set -e
 
 # get LDAP config
-srcdir="${srcdir-"."}"
+srcdir="${srcdir-`dirname "$0"`}"
 cfgfile="$srcdir/nslcd-test.conf"
 uri=`sed -n 's/^uri *//p' "$cfgfile" | head -n 1`
 base="dc=test,dc=tld"
@@ -35,4 +35,5 @@ base="dc=test,dc=tld"
 "$srcdir/testenv.sh" check_ldap "$uri" "$base" || exit 77
 
 # just execute test_myldap
-exec ./test_myldap
+export srcdir
+exec "$srcdir/test_myldap"
diff --git a/tests/test_nsscmds.sh b/tests/test_nsscmds.sh
index cf997fc..2c5ffc6 100755
--- a/tests/test_nsscmds.sh
+++ b/tests/test_nsscmds.sh
@@ -139,8 +139,9 @@ echo "test_nsscmds.sh: testing group..."
 sortgroup() {
   while read line
   do
-    group="$(echo "$line" | sed 's/^\([^:]*:[^:]*:[^:]*\)\(:\(.*\)\)*$/\1:/')"
-    members="$(echo "$line" | sed -n 
's/^\([^:]*:[^:]*:[^:]*\)\(:\(.*\)\)*$/\3/p' | tr ',' '\n' | sort | tr '\n' ',' 
| sed 's/,$//')"
+    group="`echo "$line" | sed 's/^\([^:]*:[^:]*:[^:]*\).*$/\1:/'`"
+    members="`echo "$line" | sed -n 's/^[^:]*:[^:]*:[^:]*:\(.*\)$/\1/p' | tr 
',' '\n' | sort | tr '\n' ','`"
+    members="`echo "$members" | sed 's/,$//'`"
     echo "${group}${members}"
   done
 }
@@ -171,8 +172,8 @@ check "groups testuser4 | sed 's/^.* *: *//'" << EOM
 users testgroup testgroup2
 EOM
 
-check "getent group | egrep '^(testgroup|users):' | sortgroup" << EOM
-users:x:100:
+check "getent group | egrep '^(testgroup|users|root):' | sortgroup" << EOM
+$(egrep '^(testgroup|users|root):' /etc/group)
 testgroup:*:6100:arthur,test,testuser4
 users:*:100:arthur,test
 EOM
diff --git a/tests/test_pamcmds.expect b/tests/test_pamcmds.expect
index 7d5e3be..2379090 100644
--- a/tests/test_pamcmds.expect
+++ b/tests/test_pamcmds.expect
@@ -36,7 +36,7 @@ proc abort {} {
 proc reset_password {} {
   global expect_out
   send_user "test_pamcmds.expect: resetting passwd...\n"
-  spawn passwd arthur
+  spawn passwd vsefcovic
   expect {
     "LDAP administrator password" { send "test\r"; exp_continue }
     -regexp "(New|Retype new)( UNIX)? password:" { send "test\r"; exp_continue 
}
@@ -44,6 +44,10 @@ proc reset_password {} {
     "passwd: all authentication tokens updated successfully." {}
     "Invalid credentials" abort
     "Authentication token manipulation error" abort
+    "passwd: Sorry, `passwd' can only change passwords for local or NIS 
users." {
+      send_user "test_pamcmds.expect: passwd not using PAM\n"
+      exit 77
+    }
     default abort
   }
   #close
@@ -126,11 +130,11 @@ proc test_login_unknown {uid passwd} {
 
 # test incorrect password
 send_user "test_pamcmds.expect: testing incorrect password...\n"
-test_login_authfail arthur wrongpassword
+test_login_authfail vsefcovic wrongpassword
 
 # test correct password
 send_user "test_pamcmds.expect: testing correct password...\n"
-test_login_ok arthur test
+test_login_ok vsefcovic test
 
 # change password using incorrect old password
 send_user "test_pamcmds.expect: testing password change with incorrect 
password...\n"
@@ -174,11 +178,11 @@ expect "\$ "
 
 # logging in with the old password should fail now
 send_user "test_pamcmds.expect: testing old password...\n"
-test_login_authfail arthur test
+test_login_authfail vsefcovic test
 
 # test correct password
 send_user "test_pamcmds.expect: testing new password...\n"
-test_login_ok arthur DuhevOlNoz5
+test_login_ok vsefcovic DuhevOlNoz5
 
 # test invalid username
 send_user "test_pamcmds.expect: testing with unknown username...\n"
@@ -192,7 +196,7 @@ test_login_authfail root anypassword
 send_user "test_pamcmds.expect: testing with nobody...\n"
 test_login_authfail nobody anypassword
 
-# close the shell (first log of arthur)
+# close the shell (first log off vsefcovic)
 send "exit\r"
 expect "\$ "
 send "exit\r"

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

commit f8af48faa18b6d9017ea64f4df2d6ee2b1743df3
Author: Arthur de Jong <arthur@arthurdejong.org>
Date:   Tue Oct 29 20:01:30 2013 +0100

    Fix a number of compiler warnings
    
    This includes a number of small fixes for issues that were formerly
    masked by the incorrect AC_LANG_PROGRAM check.

diff --git a/compat/ldap_parse_passwordpolicy_control.c 
b/compat/ldap_parse_passwordpolicy_control.c
index 3517085..de8dd8d 100644
--- a/compat/ldap_parse_passwordpolicy_control.c
+++ b/compat/ldap_parse_passwordpolicy_control.c
@@ -46,7 +46,7 @@
 
 int ldap_parse_passwordpolicy_control(LDAP UNUSED(*ld), LDAPControl *ctrl,
                                       ber_int_t *expirep, ber_int_t *gracep,
-                                      LDAPPasswordPolicyError *errorp)
+                                      LDAPPasswordPolicyError UNUSED(*errorp))
 {
   BerElement *ber;
   ber_tag_t tag;
diff --git a/nslcd/common.c b/nslcd/common.c
index 211be1b..ade9ca6 100644
--- a/nslcd/common.c
+++ b/nslcd/common.c
@@ -238,8 +238,8 @@ int write_address(TFILE *fp, MYLDAP_ENTRY *entry, const 
char *attr,
     /* failure, log but write simple invalid address
        (otherwise the address list is messed up) */
     /* TODO: have error message in correct format */
-    log_log(LOG_WARNING, "%s: %s: \"%s\" unparseble",
-            myldap_get_dn(entry), attmap_ether_cn, addr);
+    log_log(LOG_WARNING, "%s: %s: \"%s\" unparsable",
+            myldap_get_dn(entry), attr, addr);
     /* write an illegal address type */
     WRITE_INT32(fp, -1);
     /* write an emtpy address */
diff --git a/nslcd/config.c b/nslcd/config.c
index 36efede..75c9ec1 100644
--- a/nslcd/config.c
+++ b/nslcd/config.c
@@ -1,7 +1,7 @@
 /*
    config.c - routines for getting configuration information
 
-   Copyright (C) 2012 Arthur de Jong
+   Copyright (C) 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
@@ -33,7 +33,7 @@
 #include "log.h"
 #include "cfg.h"
 
-int nslcd_config_get(TFILE *fp, MYLDAP_SESSION *session)
+int nslcd_config_get(TFILE *fp, MYLDAP_SESSION UNUSED(*session))
 {
   int32_t tmpint32;
   int32_t cfgopt;
diff --git a/nslcd/group.c b/nslcd/group.c
index e4ff55a..4fd40bf 100644
--- a/nslcd/group.c
+++ b/nslcd/group.c
@@ -136,8 +136,7 @@ static int mkfilter_group_bymember(MYLDAP_SESSION *session,
                     attmap_group_member, safedn);
 }
 
-static int mkfilter_group_bymemberdn(MYLDAP_SESSION *session,
-                                     const char *dn,
+static int mkfilter_group_bymemberdn(const char *dn,
                                      char *buffer, size_t buflen)
 {
   char safedn[300];
@@ -481,7 +480,7 @@ int nslcd_group_bymember(TFILE *fp, MYLDAP_SESSION *session)
     while ((dn = set_pop(tocheck)) != NULL)
     {
       /* make filter for finding groups with our group as member */
-      if (mkfilter_group_bymemberdn(session, dn, filter, sizeof(filter)))
+      if (mkfilter_group_bymemberdn(dn, filter, sizeof(filter)))
       {
         log_log(LOG_WARNING, "nslcd_group_bymember(): filter buffer too 
small");
         set_free(seen);
diff --git a/nslcd/nslcd.c b/nslcd/nslcd.c
index ffa6bea..b5881c4 100644
--- a/nslcd/nslcd.c
+++ b/nslcd/nslcd.c
@@ -250,7 +250,7 @@ static int create_socket(const char *filename)
     log_log(LOG_ERR, "cannot create socket: %s", strerror(errno));
     exit(EXIT_FAILURE);
   }
-  if (sock >= FD_SETSIZE)
+  if (sock >= (int)FD_SETSIZE)
   {
     log_log(LOG_ERR, "socket file descriptor number too high (%d)", sock);
     exit(EXIT_FAILURE);
diff --git a/nslcd/pam.c b/nslcd/pam.c
index bdd8729..2593c7c 100644
--- a/nslcd/pam.c
+++ b/nslcd/pam.c
@@ -546,7 +546,7 @@ int nslcd_pam_authz(TFILE *fp, MYLDAP_SESSION *session)
   return 0;
 }
 
-int nslcd_pam_sess_o(TFILE *fp, MYLDAP_SESSION *session)
+int nslcd_pam_sess_o(TFILE *fp, MYLDAP_SESSION UNUSED(*session))
 {
   int32_t tmpint32;
   char username[256], service[64], ruser[256], rhost[HOST_NAME_MAX + 1], 
tty[64];
@@ -554,7 +554,7 @@ int nslcd_pam_sess_o(TFILE *fp, MYLDAP_SESSION *session)
   static const char alphabet[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
                                  "abcdefghijklmnopqrstuvwxyz"
                                  "01234567890";
-  int i;
+  unsigned int i;
   /* read request parameters */
   READ_STRING(fp, username);
   READ_STRING(fp, service);
@@ -579,7 +579,7 @@ int nslcd_pam_sess_o(TFILE *fp, MYLDAP_SESSION *session)
   return 0;
 }
 
-int nslcd_pam_sess_c(TFILE *fp, MYLDAP_SESSION *session)
+int nslcd_pam_sess_c(TFILE *fp, MYLDAP_SESSION UNUSED(*session))
 {
   int32_t tmpint32;
   char username[256], service[64], ruser[256], rhost[HOST_NAME_MAX + 1], 
tty[64];
diff --git a/nslcd/protocol.c b/nslcd/protocol.c
index a2a31da..d37c903 100644
--- a/nslcd/protocol.c
+++ b/nslcd/protocol.c
@@ -5,7 +5,7 @@
 
    Copyright (C) 1997-2005 Luke Howard
    Copyright (C) 2006 West Consulting
-   Copyright (C) 2006, 2007, 2009, 2010, 2011, 2012 Arthur de Jong
+   Copyright (C) 2006, 2007, 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
@@ -150,7 +150,7 @@ static int write_protocol(TFILE *fp, MYLDAP_ENTRY *entry, 
const char *reqname)
             myldap_get_dn(entry), attmap_protocol_ipProtocolNumber);
     return 0;
   }
-  else if ((errno != 0) || (proto < 0) || (proto > UINT8_MAX))
+  else if ((errno != 0) || (proto < 0) || (proto > (long)UINT8_MAX))
   {
     log_log(LOG_WARNING, "%s: %s: out of range",
             myldap_get_dn(entry), attmap_protocol_ipProtocolNumber);
diff --git a/nslcd/rpc.c b/nslcd/rpc.c
index e022154..ba88f4e 100644
--- a/nslcd/rpc.c
+++ b/nslcd/rpc.c
@@ -5,7 +5,7 @@
 
    Copyright (C) 1997-2005 Luke Howard
    Copyright (C) 2006 West Consulting
-   Copyright (C) 2006, 2007, 2009, 2010, 2011, 2012 Arthur de Jong
+   Copyright (C) 2006, 2007, 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
@@ -105,7 +105,7 @@ static int write_rpc(TFILE *fp, MYLDAP_ENTRY *entry, const 
char *reqname)
   const char **aliases;
   const char **numbers;
   char *tmp;
-  long number;
+  unsigned long number;
   int i;
   /* get the most canonical name */
   name = myldap_get_rdn_value(entry, attmap_rpc_cn);
diff --git a/nslcd/service.c b/nslcd/service.c
index 187bce0..673aac4 100644
--- a/nslcd/service.c
+++ b/nslcd/service.c
@@ -173,7 +173,7 @@ static int write_service(TFILE *fp, MYLDAP_ENTRY *entry,
             myldap_get_dn(entry), attmap_service_ipServicePort);
     return 0;
   }
-  else if ((errno != 0) || (port <= 0) || (port > UINT16_MAX))
+  else if ((errno != 0) || (port <= 0) || (port > (long)UINT16_MAX))
   {
     log_log(LOG_WARNING, "%s: %s: out of range",
             myldap_get_dn(entry), attmap_service_ipServicePort);
diff --git a/nss/bsdnss.c b/nss/bsdnss.c
index e2037ba..85c62b8 100644
--- a/nss/bsdnss.c
+++ b/nss/bsdnss.c
@@ -6,7 +6,7 @@
    Copyright (C) 2003 Jacques Vidrine
    Copyright (C) 2006 Artem Kazakov
    Copyright (C) 2009 Alexander V. Chernikov
-   Copyright (C) 2011, 2012 Arthur de Jong
+   Copyright (C) 2011, 2012, 2013 Arthur de Jong
    Copyright (C) 2011 Tom Judge
 
    This library is free software; you can redistribute it and/or
@@ -85,7 +85,7 @@ static ns_mtab methods[] = {
   { NSDB_PASSWD_COMPAT, "endpwent",   __nss_compat_endpwent,   
_nss_ldap_endpwent },
 };
 
-int __nss_compat_gethostbyname(void *retval, void *mdata, va_list ap)
+int __nss_compat_gethostbyname(void UNUSED(*retval), void *mdata, va_list ap)
 {
   nss_status_t (*fn)(const char *, struct hostent *, char *, size_t, int *, 
int *);
   const char *name;
@@ -105,7 +105,7 @@ int __nss_compat_gethostbyname(void *retval, void *mdata, 
va_list ap)
   return status;
 }
 
-int __nss_compat_gethostbyname2(void *retval, void *mdata, va_list ap)
+int __nss_compat_gethostbyname2(void UNUSED(*retval), void *mdata, va_list ap)
 {
   nss_status_t (*fn)(const char *, struct hostent *, char *, size_t, int *, 
int *);
   const char *name;
@@ -125,7 +125,7 @@ int __nss_compat_gethostbyname2(void *retval, void *mdata, 
va_list ap)
   return status;
 }
 
-int __nss_compat_gethostbyaddr(void *retval, void *mdata, va_list ap)
+int __nss_compat_gethostbyaddr(void UNUSED(*retval), void *mdata, va_list ap)
 {
   struct in_addr *addr;
   int len;
@@ -165,7 +165,8 @@ static int __gr_addgid(gid_t gid, gid_t *groups, int 
maxgrp, int *groupc)
   return ret;
 }
 
-int __freebsd_getgroupmembership(void *retval, void *mdata, va_list ap)
+int __freebsd_getgroupmembership(void UNUSED(*retval), void UNUSED(*mdata_),
+                                 va_list ap)
 {
   int err;
   nss_status_t s;
@@ -199,7 +200,7 @@ int __freebsd_getgroupmembership(void *retval, void *mdata, 
va_list ap)
   return __nss_compat_result(s, 0);
 }
 
-ns_mtab *nss_module_register(const char *source, unsigned int *mtabsize,
+ns_mtab *nss_module_register(const char UNUSED(*source), unsigned int 
*mtabsize,
                              nss_module_unregister_fn *unreg)
 {
   *mtabsize = sizeof(methods) / sizeof(methods[0]);
diff --git a/nss/ethers.c b/nss/ethers.c
index 9273fc4..b094a66 100644
--- a/nss/ethers.c
+++ b/nss/ethers.c
@@ -107,7 +107,7 @@ static char *etherent2str(struct etherent *result, char 
*buffer,
   int res;
   res = snprintf(buffer, buflen, "%s %s", ether_ntoa(&result->e_addr),
                  result->e_name);
-  if ((res < 0) || (res >= buflen))
+  if ((res < 0) || (res >= (int)buflen))
     return NULL;
   return buffer;
 }
diff --git a/nss/group.c b/nss/group.c
index c00b086..5945718 100644
--- a/nss/group.c
+++ b/nss/group.c
@@ -194,7 +194,7 @@ static char *group2str(struct group *result, char *buffer, 
size_t buflen)
   int res, i;
   res = snprintf(buffer, buflen, "%s:%s:%d:", result->gr_name,
                  result->gr_passwd, (int)result->gr_gid);
-  if ((res < 0) || (res >= buflen))
+  if ((res < 0) || (res >= (int)buflen))
     return NULL;
   if (result->gr_mem)
     for (i = 0; result->gr_mem[i]; i++)
diff --git a/nss/netgroup.c b/nss/netgroup.c
index 3777c4c..bd70768 100644
--- a/nss/netgroup.c
+++ b/nss/netgroup.c
@@ -321,7 +321,8 @@ static nss_backend_op_t netgroup_setnetgrent_ops[] = {
   netgroup_setnetgrent_getnetgrent,
 };
 
-static nss_status_t netgroup_setnetgrent_constructor(nss_backend_t *be, void 
*args)
+static nss_status_t netgroup_setnetgrent_constructor(nss_backend_t UNUSED(*be),
+                                                     void *args)
 {
   struct setnetgrent_backend *ngbe;
   nss_status_t retv;
diff --git a/nss/networks.c b/nss/networks.c
index 4130205..6d12ca6 100644
--- a/nss/networks.c
+++ b/nss/networks.c
@@ -170,7 +170,7 @@ static char *netent2str(struct netent *result, char 
*buffer, size_t buflen)
   struct in_addr priv_in_addr;
   priv_in_addr.s_addr = result->n_net;
   res = snprintf(buffer, buflen, "%s %s", result->n_name, 
inet_ntoa(priv_in_addr));
-  if ((res < 0) || (res >= buflen))
+  if ((res < 0) || (res >= (int)buflen))
     return NULL;
   if (result->n_aliases)
     for (i = 0; result->n_aliases[i]; i++)
diff --git a/nss/passwd.c b/nss/passwd.c
index 8e69692..c17d8cc 100644
--- a/nss/passwd.c
+++ b/nss/passwd.c
@@ -106,7 +106,7 @@ static char *passwd2str(struct passwd *result, char 
*buffer, size_t buflen)
                  result->pw_name, result->pw_passwd, (int)result->pw_uid,
                  (int)result->pw_gid, result->pw_gecos, result->pw_dir,
                  result->pw_shell);
-  if ((res < 0) || (res >= buflen))
+  if ((res < 0) || (res >= (int)buflen))
     return NULL;
   return buffer;
 }
diff --git a/nss/protocols.c b/nss/protocols.c
index 7787161..4944dff 100644
--- a/nss/protocols.c
+++ b/nss/protocols.c
@@ -98,7 +98,7 @@ static char *protoent2str(struct protoent *result, char 
*buffer, size_t buflen)
 {
   int res, i;
   res = snprintf(buffer, buflen, "%s\t\t%d", result->p_name, result->p_proto);
-  if ((res < 0) || (res >= buflen))
+  if ((res < 0) || (res >= (int)buflen))
     return NULL;
   if (result->p_aliases)
     for (i = 0; result->p_aliases[i]; i++)
diff --git a/nss/rpc.c b/nss/rpc.c
index d116a9b..6b0bcc8 100644
--- a/nss/rpc.c
+++ b/nss/rpc.c
@@ -97,7 +97,7 @@ static char *rpcent2str(struct rpcent *result, char *buffer, 
size_t buflen)
 {
   int res, i;
   res = snprintf(buffer, buflen, "%s %d", result->r_name, result->r_number);
-  if ((res < 0) || (res >= buflen))
+  if ((res < 0) || (res >= (int)buflen))
     return NULL;
   if (result->r_aliases)
     for (i = 0; result->r_aliases[i]; i++)
diff --git a/nss/services.c b/nss/services.c
index a83a6ec..a2df9cb 100644
--- a/nss/services.c
+++ b/nss/services.c
@@ -106,7 +106,7 @@ static char *servent2str(struct servent *result, char 
*buffer, size_t buflen)
   int res, i;
   res = snprintf(buffer, buflen, "%s %d/%s", result->s_name, result->s_port,
                  result->s_proto);
-  if ((res < 0) || (res >= buflen))
+  if ((res < 0) || (res >= (int)buflen))
     return NULL;
   if (result->s_aliases)
     for (i = 0; result->s_aliases[i]; i++)
diff --git a/pam/pam.c b/pam/pam.c
index 2b67c73..36caf11 100644
--- a/pam/pam.c
+++ b/pam/pam.c
@@ -270,8 +270,8 @@ static int nslcd2pam_rc(pam_handle_t *pamh, int rc)
 }
 
 /* check whether the specified user is handled by nslcd */
-static int nslcd_request_exists(pam_handle_t *pamh, struct pld_ctx *ctx,
-                                struct pld_cfg *cfg, const char *username)
+static int nslcd_request_exists(pam_handle_t *pamh, struct pld_cfg *cfg,
+                                const char *username)
 {
   PAM_REQUEST(
     NSLCD_ACTION_PASSWD_BYNAME,
@@ -675,7 +675,7 @@ int pam_sm_chauthtok(pam_handle_t *pamh, int flags,
     return remap_pam_rc(PAM_PERM_DENIED, &cfg);
   }
   /* see if we are dealing with an LDAP user first */
-  rc = nslcd_request_exists(pamh, ctx, &cfg, username);
+  rc = nslcd_request_exists(pamh, &cfg, username);
   if (rc != PAM_SUCCESS)
     return remap_pam_rc(rc, &cfg);
   /* preliminary check, just see if we can authenticate with the current 
password */

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

commit 88801f9e5a01e580adae4f386c0c755fb2a17b79
Author: Arthur de Jong <arthur@arthurdejong.org>
Date:   Tue Oct 29 19:24:15 2013 +0100

    Add -Werror=implicit if compiler supports it

diff --git a/configure.ac b/configure.ac
index 1645729..d811802 100644
--- a/configure.ac
+++ b/configure.ac
@@ -115,7 +115,7 @@ AC_ARG_ENABLE(warnings,
               [if test "x$enableval" != "no"
                then
                  CFLAGS="$CFLAGS -pedantic -Wall -Wshadow -Wpointer-arith 
-Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs 
-Waggregate-return -Wmissing-declarations -Wunused -Wformat=2 -Wswitch-default 
-Wswitch-enum -Wfloat-equal -Wbad-function-cast -Wredundant-decls"
-                 DESIRED_CFLAGS="$DESIRED_CFLAGS -Wextra 
-Wdeclaration-after-statement -Werror-implicit-function-declaration"
+                 DESIRED_CFLAGS="$DESIRED_CFLAGS -Wextra 
-Wdeclaration-after-statement -Werror-implicit-function-declaration 
-Werror=implicit"
                fi])
 test_gcc_flag() {
   AC_LANG_CONFTEST([AC_LANG_PROGRAM()])

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

commit 933bf8e2a5774e266297c29d88ecec451530aa5b
Author: Arthur de Jong <arthur@arthurdejong.org>
Date:   Tue Oct 29 19:23:53 2013 +0100

    Fix usage of AC_LANG_PROGRAM
    
    Apparently the macro got changed a long time ago to provide a main()
    definition. This bug caused the extra warning flags to not be added.

diff --git a/configure.ac b/configure.ac
index 6a70fc0..1645729 100644
--- a/configure.ac
+++ b/configure.ac
@@ -118,7 +118,7 @@ AC_ARG_ENABLE(warnings,
                  DESIRED_CFLAGS="$DESIRED_CFLAGS -Wextra 
-Wdeclaration-after-statement -Werror-implicit-function-declaration"
                fi])
 test_gcc_flag() {
-  AC_LANG_CONFTEST([AC_LANG_PROGRAM([int main() {}])])
+  AC_LANG_CONFTEST([AC_LANG_PROGRAM()])
   $CC -c conftest.c $CFLAGS $@ > /dev/null 2> /dev/null
   ret=$?
   rm -f conftest.o

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

commit 6028226130e26addfacca04807b6fc078eba160e
Author: Arthur de Jong <arthur@arthurdejong.org>
Date:   Tue Oct 29 19:20:16 2013 +0100

    Compatibility definitions for {set,get,end}usershell()
    
    This provides compatibility definitions for systems that don't have
    these functions (some Solaris flavours).

diff --git a/compat/Makefile.am b/compat/Makefile.am
index 7391fee..66703c5 100644
--- a/compat/Makefile.am
+++ b/compat/Makefile.am
@@ -25,6 +25,7 @@ AM_CFLAGS = -fPIC
 EXTRA_DIST = getopt_long.c getopt_long.h \
              daemon.c daemon.h \
              ether.c ether.h \
+             shell.h \
              strndup.c strndup.h \
              nss_compat.h socket.h \
              ldap_compat.h pagectrl.c ldap_passwd_s.c ldap_initialize.c \
diff --git a/compat/shell.h b/compat/shell.h
new file mode 100644
index 0000000..09c480e
--- /dev/null
+++ b/compat/shell.h
@@ -0,0 +1,49 @@
+/*
+   shell.h - ethernet definitions for systems lacking those
+
+   Copyright (C) 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
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   This library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with this library; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+   02110-1301 USA
+*/
+
+#ifndef COMPAT__SHELL_H
+#define COMPAT__SHELL_H 1
+
+#ifdef HAVE_GETUSERSHELL
+#if !HAVE_DECL_GETUSERSHELL
+/* we define getusershell() here because on some platforms the function is
+   undefined */
+extern char *getusershell(void);
+#endif /* not HAVE_DECL_GETUSERSHELL */
+#endif /* HAVE_GETUSERSHELL */
+
+#ifdef HAVE_SETUSERSHELL
+#if !HAVE_DECL_SETUSERSHELL
+/* we define setusershell() here because on some platforms the function is
+   undefined */
+extern char *setusershell(void);
+#endif /* not HAVE_DECL_SETUSERSHELL */
+#endif /* HAVE_SETUSERSHELL */
+
+#ifdef HAVE_ENDUSERSHELL
+#if !HAVE_DECL_ENDUSERSHELL
+/* we define getusershell() here because on some platforms the function is
+   undefined */
+extern char *endusershell(void);
+#endif /* not HAVE_DECL_ENDUSERSHELL */
+#endif /* HAVE_ENDUSERSHELL */
+
+#endif /* not COMPAT__SHELL_H */
diff --git a/configure.ac b/configure.ac
index f9a501c..6a70fc0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -346,6 +346,7 @@ AC_FUNC_FORK
 AC_CHECK_FUNCS(__assert_fail)
 AC_SEARCH_LIBS(clock_gettime, rt)
 AC_CHECK_FUNCS([setusershell getusershell endusershell])
+AC_CHECK_DECLS([setusershell, getusershell, endusershell])
 
 # checks for types
 AC_TYPE_MODE_T
diff --git a/nslcd/usermod.c b/nslcd/usermod.c
index 61f6bbe..968985a 100644
--- a/nslcd/usermod.c
+++ b/nslcd/usermod.c
@@ -36,6 +36,7 @@
 #include "myldap.h"
 #include "cfg.h"
 #include "attmap.h"
+#include "compat/shell.h"
 
 /* ensure that both userdn and username are filled in from the entry,
    returns an LDAP result code */

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

commit ed4cf4722c413675e63b4ca2c15046bb80244784
Author: Arthur de Jong <arthur@arthurdejong.org>
Date:   Mon Oct 28 23:46:11 2013 +0100

    Start invalidator after locking pidfile
    
    This causes the pidfile to be written as the first thing after
    daemonising nslcd to minimise the race between service script completion
    and pidfile being locked.

diff --git a/nslcd/nslcd.c b/nslcd/nslcd.c
index afd54cf..ffa6bea 100644
--- a/nslcd/nslcd.c
+++ b/nslcd/nslcd.c
@@ -711,15 +711,10 @@ int main(int argc, char *argv[])
   /* intilialize logging */
   if (!nslcd_debugging)
     log_startlogging();
-  log_log(LOG_INFO, "version %s starting", VERSION);
-  /* start subprocess to do invalidating if reconnect_invalidate is set */
-  for (i = 0; i < LM_NONE; i++)
-    if (nslcd_cfg->reconnect_invalidate[i])
-      break;
-  if (i < LM_NONE)
-    invalidator_start();
   /* write pidfile */
   create_pidfile(NSLCD_PIDFILE);
+  /* log start */
+  log_log(LOG_INFO, "version %s starting", VERSION);
   /* install handler to close stuff off on exit and log notice */
   if (atexit(exithandler))
   {
@@ -728,6 +723,13 @@ int main(int argc, char *argv[])
   }
   /* create socket */
   nslcd_serversocket = create_socket(NSLCD_SOCKET);
+  /* start subprocess to do invalidating if reconnect_invalidate is set */
+  for (i = 0; i < LM_NONE; i++)
+    if (nslcd_cfg->reconnect_invalidate[i])
+      break;
+  if (i < LM_NONE)
+    invalidator_start();
+  /* change nslcd group and supplemental groups */
   if ((nslcd_cfg->gid != NOGID) && (nslcd_cfg->uidname != NULL))
   {
 #ifdef HAVE_INITGROUPS

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

Summary of changes:
 compat/Makefile.am                         |    1 +
 compat/ldap_parse_passwordpolicy_control.c |    2 +-
 compat/shell.h                             |   49 ++++++++++++++++++++++++++++
 configure.ac                               |    5 +--
 nslcd/common.c                             |    4 +--
 nslcd/config.c                             |    4 +--
 nslcd/group.c                              |    5 ++-
 nslcd/nslcd.c                              |   18 +++++-----
 nslcd/pam.c                                |    6 ++--
 nslcd/protocol.c                           |    4 +--
 nslcd/rpc.c                                |    4 +--
 nslcd/service.c                            |    2 +-
 nslcd/usermod.c                            |    1 +
 nss/bsdnss.c                               |   13 ++++----
 nss/ethers.c                               |    2 +-
 nss/group.c                                |    2 +-
 nss/netgroup.c                             |    3 +-
 nss/networks.c                             |    2 +-
 nss/passwd.c                               |    2 +-
 nss/protocols.c                            |    2 +-
 nss/rpc.c                                  |    2 +-
 nss/services.c                             |    2 +-
 pam/pam.c                                  |    6 ++--
 tests/test_myldap.sh                       |    5 +--
 tests/test_nsscmds.sh                      |    9 ++---
 tests/test_pamcmds.expect                  |   16 +++++----
 26 files changed, 116 insertions(+), 55 deletions(-)
 create mode 100644 compat/shell.h


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/