lists.arthurdejong.org
RSS feed

nss-pam-ldapd commit: r1833 - in nss-pam-ldapd: . nss

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

nss-pam-ldapd commit: r1833 - in nss-pam-ldapd: . nss



Author: arthur
Date: Sun Nov 18 21:13:11 2012
New Revision: 1833
URL: http://arthurdejong.org/viewvc/nss-pam-ldapd?revision=1833&view=revision

Log:
properly initialise passwd.pw_class on FreeBSD to empty string (was set to NULL 
due to the memset which was introduced in r1767)

Modified:
   nss-pam-ldapd/configure.ac
   nss-pam-ldapd/nss/passwd.c

Modified: nss-pam-ldapd/configure.ac
==============================================================================
--- nss-pam-ldapd/configure.ac  Sat Nov 17 17:40:08 2012        (r1832)
+++ nss-pam-ldapd/configure.ac  Sun Nov 18 21:13:11 2012        (r1833)
@@ -364,6 +364,10 @@
     #include <netinet/ether.h>
     #endif])
 
+  # check if struct passwd has a pw_class member
+  AC_CHECK_MEMBERS([struct passwd.pw_class],,,[
+      #include <pwd.h>])
+
   # check for a definition of struct rpcent
   AC_CHECK_TYPES(struct rpcent,,,[
       #include <netdb.h>

Modified: nss-pam-ldapd/nss/passwd.c
==============================================================================
--- nss-pam-ldapd/nss/passwd.c  Sat Nov 17 17:40:08 2012        (r1832)
+++ nss-pam-ldapd/nss/passwd.c  Sun Nov 18 21:13:11 2012        (r1833)
@@ -45,6 +45,10 @@
   READ_BUF_STRING(fp,result->pw_gecos);
   READ_BUF_STRING(fp,result->pw_dir);
   READ_BUF_STRING(fp,result->pw_shell);
+#ifdef HAVE_STRUCT_PASSWD_PW_CLASS
+  /* set the user access class to an empty string */
+  result->pw_class=result->pw_name+strlen(result->pw_name);
+#endif /* HAVE_STRUCT_PASSWD_PW_CLASS */
   return NSS_STATUS_SUCCESS;
 }
 
-- 
To unsubscribe send an email to
nss-pam-ldapd-commits-unsubscribe@lists.arthurdejong.org or see
http://lists.arthurdejong.org/nss-pam-ldapd-commits/