summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Steves <stevesk@pobox.com>2001-06-22 21:14:18 +0000
committerKevin Steves <stevesk@pobox.com>2001-06-22 21:14:18 +0000
commit824569537f874d754041f2c1b0898feda0c12f31 (patch)
tree4970f290470e0bf75a37133e35b82a9ff5dc9894
parent601e43638e9e7889127634c3ba0949ba9fb917aa (diff)
- (stevesk) handle systems without pw_expire and pw_change.
-rw-r--r--ChangeLog5
-rw-r--r--acconfig.h8
-rw-r--r--configure.in31
-rw-r--r--misc.c4
4 files changed, 45 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 2360bbe7..6c289efa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+20010622
+ - (stevesk) handle systems without pw_expire and pw_change.
+
20010621
- OpenBSD CVS Sync
- markus@cvs.openbsd.org 2001/06/16 08:49:38
@@ -5678,4 +5681,4 @@
- Wrote replacements for strlcpy and mkdtemp
- Released 1.0pre1
-$Id: ChangeLog,v 1.1296 2001/06/21 03:19:23 mouring Exp $
+$Id: ChangeLog,v 1.1297 2001/06/22 21:14:18 stevesk Exp $
diff --git a/acconfig.h b/acconfig.h
index e909f479..8faae40e 100644
--- a/acconfig.h
+++ b/acconfig.h
@@ -1,4 +1,4 @@
-/* $Id: acconfig.h,v 1.111 2001/05/08 20:33:06 mouring Exp $ */
+/* $Id: acconfig.h,v 1.112 2001/06/22 21:14:19 stevesk Exp $ */
#ifndef _CONFIG_H
#define _CONFIG_H
@@ -26,6 +26,12 @@
/* Define if your password has a pw_class field */
#undef HAVE_PW_CLASS_IN_PASSWD
+/* Define if your password has a pw_expire field */
+#undef HAVE_PW_EXPIRE_IN_PASSWD
+
+/* Define if your password has a pw_change field */
+#undef HAVE_PW_CHANGE_IN_PASSWD
+
/* Define if your system's struct sockaddr_un has a sun_len member */
#undef HAVE_SUN_LEN_IN_SOCKADDR_UN
diff --git a/configure.in b/configure.in
index 104f7e57..69d15bb8 100644
--- a/configure.in
+++ b/configure.in
@@ -1,4 +1,4 @@
-# $Id: configure.in,v 1.290 2001/06/10 17:24:52 mouring Exp $
+# $Id: configure.in,v 1.291 2001/06/22 21:14:19 stevesk Exp $
AC_INIT(ssh.c)
@@ -1144,6 +1144,35 @@ if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
fi
+AC_CACHE_CHECK([for pw_expire field in struct passwd],
+ ac_cv_have_pw_expire_in_struct_passwd, [
+ AC_TRY_COMPILE(
+ [
+#include <pwd.h>
+ ],
+ [ struct passwd p; p.pw_expire = 0; ],
+ [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
+ [ ac_cv_have_pw_expire_in_struct_passwd="no" ]
+ )
+])
+if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
+ AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD)
+fi
+
+AC_CACHE_CHECK([for pw_change field in struct passwd],
+ ac_cv_have_pw_change_in_struct_passwd, [
+ AC_TRY_COMPILE(
+ [
+#include <pwd.h>
+ ],
+ [ struct passwd p; p.pw_change = 0; ],
+ [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
+ [ ac_cv_have_pw_change_in_struct_passwd="no" ]
+ )
+])
+if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
+ AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD)
+fi
AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
AC_TRY_LINK([],
diff --git a/misc.c b/misc.c
index 283e17ec..db9c2e48 100644
--- a/misc.c
+++ b/misc.c
@@ -131,8 +131,12 @@ pwcopy(struct passwd *pw)
copy->pw_gecos = xstrdup(pw->pw_gecos);
copy->pw_uid = pw->pw_uid;
copy->pw_gid = pw->pw_gid;
+#ifdef HAVE_PW_EXPIRE_IN_PASSWD
copy->pw_expire = pw->pw_expire;
+#endif
+#ifdef HAVE_PW_CHANGE_IN_PASSWD
copy->pw_change = pw->pw_change;
+#endif
#ifdef HAVE_PW_CLASS_IN_PASSWD
copy->pw_class = xstrdup(pw->pw_class);
#endif