diff options
author | Damien Miller <djm@mindrot.org> | 1999-12-29 02:32:22 +1100 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 1999-12-29 02:32:22 +1100 |
commit | 9550a76c3716acc1a591dd9604cbc958a92ad891 (patch) | |
tree | 39968e63afca468fc699f9629a16868b015394a4 | |
parent | 74d0d4a3d9157823fda11c892c6d592562486b84 (diff) |
- Applied another NetBSD portability patch from David Rankin
<drankin@bohemians.lexington.ky.us>
- Fix --with-default-path option.
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | acconfig.h | 3 | ||||
-rw-r--r-- | configure.in | 7 | ||||
-rw-r--r-- | login.c | 4 |
4 files changed, 17 insertions, 2 deletions
@@ -1,3 +1,8 @@ | |||
1 | 19991229 | ||
2 | - Applied another NetBSD portability patch from David Rankin | ||
3 | <drankin@bohemians.lexington.ky.us> | ||
4 | - Fix --with-default-path option. | ||
5 | |||
1 | 19991228 | 6 | 19991228 |
2 | - Replacement for getpagesize() for systems which lack it | 7 | - Replacement for getpagesize() for systems which lack it |
3 | - NetBSD login.c compile fix from David Rankin | 8 | - NetBSD login.c compile fix from David Rankin |
diff --git a/acconfig.h b/acconfig.h index 23376f8d4..dc0c28185 100644 --- a/acconfig.h +++ b/acconfig.h | |||
@@ -48,6 +48,9 @@ | |||
48 | /* Define is utmp.h has a ut_tv field */ | 48 | /* Define is utmp.h has a ut_tv field */ |
49 | #undef HAVE_TV_IN_UTMP | 49 | #undef HAVE_TV_IN_UTMP |
50 | 50 | ||
51 | /* Define is utmp.h has a ut_id field */ | ||
52 | #undef HAVE_ID_IN_UTMP | ||
53 | |||
51 | /* Define if you want to use utmpx */ | 54 | /* Define if you want to use utmpx */ |
52 | #undef USE_UTMPX | 55 | #undef USE_UTMPX |
53 | 56 | ||
diff --git a/configure.in b/configure.in index a232a746b..6d03beca7 100644 --- a/configure.in +++ b/configure.in | |||
@@ -302,6 +302,11 @@ AC_EGREP_HEADER(ut_tv, utmp.h, | |||
302 | [AC_DEFINE(HAVE_TV_IN_UTMP) AC_MSG_RESULT(yes); ], | 302 | [AC_DEFINE(HAVE_TV_IN_UTMP) AC_MSG_RESULT(yes); ], |
303 | [AC_MSG_RESULT(no)] | 303 | [AC_MSG_RESULT(no)] |
304 | ) | 304 | ) |
305 | AC_MSG_CHECKING([whether utmp.h has ut_id field]) | ||
306 | AC_EGREP_HEADER(ut_id, utmp.h, | ||
307 | [AC_DEFINE(HAVE_ID_IN_UTMP) AC_MSG_RESULT(yes); ], | ||
308 | [AC_MSG_RESULT(no)] | ||
309 | ) | ||
305 | 310 | ||
306 | dnl Look for lastlog location | 311 | dnl Look for lastlog location |
307 | AC_ARG_WITH(lastlog, | 312 | AC_ARG_WITH(lastlog, |
@@ -440,7 +445,7 @@ AC_ARG_WITH(path, | |||
440 | [ --with-default-path=PATH Specify default \$PATH environment for server], | 445 | [ --with-default-path=PATH Specify default \$PATH environment for server], |
441 | [ | 446 | [ |
442 | if test "x$withval" != "xno" ; then | 447 | if test "x$withval" != "xno" ; then |
443 | AC_DEFINE_UNQUOTED(USER_PATH, $withval") | 448 | AC_DEFINE_UNQUOTED(USER_PATH, "$withval") |
444 | fi | 449 | fi |
445 | ] | 450 | ] |
446 | ) | 451 | ) |
@@ -18,7 +18,7 @@ | |||
18 | */ | 18 | */ |
19 | 19 | ||
20 | #include "includes.h" | 20 | #include "includes.h" |
21 | RCSID("$Id: login.c,v 1.14 1999/12/27 23:41:12 damien Exp $"); | 21 | RCSID("$Id: login.c,v 1.15 1999/12/28 15:32:22 damien Exp $"); |
22 | 22 | ||
23 | #if defined(HAVE_UTMPX_H) && defined(USE_UTMPX) | 23 | #if defined(HAVE_UTMPX_H) && defined(USE_UTMPX) |
24 | # include <utmpx.h> | 24 | # include <utmpx.h> |
@@ -141,7 +141,9 @@ record_login(int pid, const char *ttyname, const char *user, uid_t uid, | |||
141 | /* Construct an utmp/wtmp entry. */ | 141 | /* Construct an utmp/wtmp entry. */ |
142 | memset(&u, 0, sizeof(u)); | 142 | memset(&u, 0, sizeof(u)); |
143 | strncpy(u.ut_line, ttyname + 5, sizeof(u.ut_line)); | 143 | strncpy(u.ut_line, ttyname + 5, sizeof(u.ut_line)); |
144 | #if defined(HAVE_ID_IN_UTMP) | ||
144 | strncpy(u.ut_id, ttyname + 8, sizeof(u.ut_id)); | 145 | strncpy(u.ut_id, ttyname + 8, sizeof(u.ut_id)); |
146 | #endif /* defined(HAVE_ID_IN_UTMP) */ | ||
145 | strncpy(u.ut_name, user, sizeof(u.ut_name)); | 147 | strncpy(u.ut_name, user, sizeof(u.ut_name)); |
146 | #if defined(HAVE_TV_IN_UTMP) | 148 | #if defined(HAVE_TV_IN_UTMP) |
147 | (void)gettimeofday(&u.ut_tv, NULL); | 149 | (void)gettimeofday(&u.ut_tv, NULL); |