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 2360bbe74..6c289efaf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
120010622
2 - (stevesk) handle systems without pw_expire and pw_change.
3
120010621 420010621
2 - OpenBSD CVS Sync 5 - OpenBSD CVS Sync
3 - markus@cvs.openbsd.org 2001/06/16 08:49:38 6 - markus@cvs.openbsd.org 2001/06/16 08:49:38
@@ -5678,4 +5681,4 @@
5678 - Wrote replacements for strlcpy and mkdtemp 5681 - Wrote replacements for strlcpy and mkdtemp
5679 - Released 1.0pre1 5682 - Released 1.0pre1
5680 5683
5681$Id: ChangeLog,v 1.1296 2001/06/21 03:19:23 mouring Exp $ 5684$Id: ChangeLog,v 1.1297 2001/06/22 21:14:18 stevesk Exp $
diff --git a/acconfig.h b/acconfig.h
index e909f4797..8faae40e2 100644
--- a/acconfig.h
+++ b/acconfig.h
@@ -1,4 +1,4 @@
1/* $Id: acconfig.h,v 1.111 2001/05/08 20:33:06 mouring Exp $ */ 1/* $Id: acconfig.h,v 1.112 2001/06/22 21:14:19 stevesk Exp $ */
2 2
3#ifndef _CONFIG_H 3#ifndef _CONFIG_H
4#define _CONFIG_H 4#define _CONFIG_H
@@ -26,6 +26,12 @@
26/* Define if your password has a pw_class field */ 26/* Define if your password has a pw_class field */
27#undef HAVE_PW_CLASS_IN_PASSWD 27#undef HAVE_PW_CLASS_IN_PASSWD
28 28
29/* Define if your password has a pw_expire field */
30#undef HAVE_PW_EXPIRE_IN_PASSWD
31
32/* Define if your password has a pw_change field */
33#undef HAVE_PW_CHANGE_IN_PASSWD
34
29/* Define if your system's struct sockaddr_un has a sun_len member */ 35/* Define if your system's struct sockaddr_un has a sun_len member */
30#undef HAVE_SUN_LEN_IN_SOCKADDR_UN 36#undef HAVE_SUN_LEN_IN_SOCKADDR_UN
31 37
diff --git a/configure.in b/configure.in
index 104f7e577..69d15bb8a 100644
--- a/configure.in
+++ b/configure.in
@@ -1,4 +1,4 @@
1# $Id: configure.in,v 1.290 2001/06/10 17:24:52 mouring Exp $ 1# $Id: configure.in,v 1.291 2001/06/22 21:14:19 stevesk Exp $
2 2
3AC_INIT(ssh.c) 3AC_INIT(ssh.c)
4 4
@@ -1144,6 +1144,35 @@ if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1144 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD) 1144 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1145fi 1145fi
1146 1146
1147AC_CACHE_CHECK([for pw_expire field in struct passwd],
1148 ac_cv_have_pw_expire_in_struct_passwd, [
1149 AC_TRY_COMPILE(
1150 [
1151#include <pwd.h>
1152 ],
1153 [ struct passwd p; p.pw_expire = 0; ],
1154 [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
1155 [ ac_cv_have_pw_expire_in_struct_passwd="no" ]
1156 )
1157])
1158if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
1159 AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD)
1160fi
1161
1162AC_CACHE_CHECK([for pw_change field in struct passwd],
1163 ac_cv_have_pw_change_in_struct_passwd, [
1164 AC_TRY_COMPILE(
1165 [
1166#include <pwd.h>
1167 ],
1168 [ struct passwd p; p.pw_change = 0; ],
1169 [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
1170 [ ac_cv_have_pw_change_in_struct_passwd="no" ]
1171 )
1172])
1173if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
1174 AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD)
1175fi
1147 1176
1148AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [ 1177AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
1149 AC_TRY_LINK([], 1178 AC_TRY_LINK([],
diff --git a/misc.c b/misc.c
index 283e17ec2..db9c2e481 100644
--- a/misc.c
+++ b/misc.c
@@ -131,8 +131,12 @@ pwcopy(struct passwd *pw)
131 copy->pw_gecos = xstrdup(pw->pw_gecos); 131 copy->pw_gecos = xstrdup(pw->pw_gecos);
132 copy->pw_uid = pw->pw_uid; 132 copy->pw_uid = pw->pw_uid;
133 copy->pw_gid = pw->pw_gid; 133 copy->pw_gid = pw->pw_gid;
134#ifdef HAVE_PW_EXPIRE_IN_PASSWD
134 copy->pw_expire = pw->pw_expire; 135 copy->pw_expire = pw->pw_expire;
136#endif
137#ifdef HAVE_PW_CHANGE_IN_PASSWD
135 copy->pw_change = pw->pw_change; 138 copy->pw_change = pw->pw_change;
139#endif
136#ifdef HAVE_PW_CLASS_IN_PASSWD 140#ifdef HAVE_PW_CLASS_IN_PASSWD
137 copy->pw_class = xstrdup(pw->pw_class); 141 copy->pw_class = xstrdup(pw->pw_class);
138#endif 142#endif