diff options
author | Arthur de Jong <arthur@arthurdejong.org> | 2012-11-18 21:13:11 +0100 |
---|---|---|
committer | Arthur de Jong <arthur@arthurdejong.org> | 2012-11-18 21:13:11 +0100 |
commit | 18219a2f997a06997117d20741d052fc1212cd25 (patch) | |
tree | ffbb59c17c53da039b149dfbd8e01652d9012e30 | |
parent | d6c1d928a6acbab6de9b219bab9c524a41af955d (diff) |
properly initialise passwd.pw_class on FreeBSD to empty string (was set to NULL due to the memset which was introduced in r1767)
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1833 ef36b2f9-881f-0410-afb5-c4e39611909c
-rw-r--r-- | configure.ac | 4 | ||||
-rw-r--r-- | nss/passwd.c | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index 5a4fac5..b3b25bf 100644 --- a/configure.ac +++ b/configure.ac @@ -364,6 +364,10 @@ then #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> diff --git a/nss/passwd.c b/nss/passwd.c index 43694ef..a5cc3f0 100644 --- a/nss/passwd.c +++ b/nss/passwd.c @@ -45,6 +45,10 @@ static nss_status_t read_passwd( 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; } |