summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArthur de Jong <arthur@arthurdejong.org>2012-05-11 12:27:04 +0000
committerArthur de Jong <arthur@arthurdejong.org>2012-05-11 12:27:04 +0000
commit4bb884423460d712041c87f353843512300a1c66 (patch)
treedad026e7066fa05d6eef0e3621fdd11166b717a8
parent0f7318260f5355c777861f3639afe1b4692692a4 (diff)
provide a compatibility version of struct spwd for systems without it
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1690 ef36b2f9-881f-0410-afb5-c4e39611909c
-rw-r--r--compat/nss_compat.h17
-rw-r--r--configure.ac13
2 files changed, 29 insertions, 1 deletions
diff --git a/compat/nss_compat.h b/compat/nss_compat.h
index 74bb979..2588034 100644
--- a/compat/nss_compat.h
+++ b/compat/nss_compat.h
@@ -1,7 +1,7 @@
/*
nss_compat.h - compatibility definitions for NSS functions
- Copyright (C) 2010 Arthur de Jong
+ Copyright (C) 2010, 2012 Arthur de Jong
Copyright (C) 2010 Symas Corporation
This library is free software; you can redistribute it and/or
@@ -148,4 +148,19 @@ struct __netgrent
void *nip; /* changed from `service_user *nip' */
};
+/* Define struct spwd if it was not found on the system. */
+#ifndef HAVE_STRUCT_SPWD
+struct spwd {
+ char *sp_namp;
+ char *sp_pwdp;
+ long sp_lstchg;
+ long sp_min;
+ long sp_max;
+ long sp_warn;
+ long sp_inact;
+ long sp_expire;
+ unsigned long sp_flag;
+};
+#endif /* not HAVE_STRUCT_SPWD */
+
#endif /* not COMPAT__NSS_H */
diff --git a/configure.ac b/configure.ac
index 96d9799..a021741 100644
--- a/configure.ac
+++ b/configure.ac
@@ -378,6 +378,19 @@ then
#include <rpc/rpcent.h>
#endif])
+ # check for a definition of struct spwd
+ AC_CHECK_TYPES(struct spwd,,,[
+ #ifdef HAVE_NSS_H
+ #include <nss.h>
+ #endif
+ #ifdef HAVE_NSS_COMMON_H
+ #include <nss_common.h>
+ #endif
+ #include <pwd.h>
+ #ifdef HAVE_SHADOW_H
+ #include <shadow.h>
+ #endif])
+
# check for a definition of enum nss_status and nss_backend_t
AC_CHECK_TYPES([enum nss_status,nss_backend_t],,,[
#ifdef HAVE_NSS_H