From c73a0cb5c428e973d35a9156c9dd9615307ca8f2 Mon Sep 17 00:00:00 2001 From: damien Date: Tue, 28 Dec 1999 15:32:22 +0000 Subject: [PATCH] - Applied another NetBSD portability patch from David Rankin - Fix --with-default-path option. --- ChangeLog | 5 +++++ acconfig.h | 3 +++ configure.in | 7 ++++++- login.c | 2 ++ 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index bb27a81f..a61a18cd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +19991229 + - Applied another NetBSD portability patch from David Rankin + + - Fix --with-default-path option. + 19991228 - Replacement for getpagesize() for systems which lack it - NetBSD login.c compile fix from David Rankin diff --git a/acconfig.h b/acconfig.h index 23376f8d..dc0c2818 100644 --- a/acconfig.h +++ b/acconfig.h @@ -48,6 +48,9 @@ /* Define is utmp.h has a ut_tv field */ #undef HAVE_TV_IN_UTMP +/* Define is utmp.h has a ut_id field */ +#undef HAVE_ID_IN_UTMP + /* Define if you want to use utmpx */ #undef USE_UTMPX diff --git a/configure.in b/configure.in index a232a746..6d03beca 100644 --- a/configure.in +++ b/configure.in @@ -302,6 +302,11 @@ AC_EGREP_HEADER(ut_tv, utmp.h, [AC_DEFINE(HAVE_TV_IN_UTMP) AC_MSG_RESULT(yes); ], [AC_MSG_RESULT(no)] ) +AC_MSG_CHECKING([whether utmp.h has ut_id field]) +AC_EGREP_HEADER(ut_id, utmp.h, + [AC_DEFINE(HAVE_ID_IN_UTMP) AC_MSG_RESULT(yes); ], + [AC_MSG_RESULT(no)] +) dnl Look for lastlog location AC_ARG_WITH(lastlog, @@ -440,7 +445,7 @@ AC_ARG_WITH(path, [ --with-default-path=PATH Specify default \$PATH environment for server], [ if test "x$withval" != "xno" ; then - AC_DEFINE_UNQUOTED(USER_PATH, $withval") + AC_DEFINE_UNQUOTED(USER_PATH, "$withval") fi ] ) diff --git a/login.c b/login.c index d713155d..6f2c2693 100644 --- a/login.c +++ b/login.c @@ -141,7 +141,9 @@ record_login(int pid, const char *ttyname, const char *user, uid_t uid, /* Construct an utmp/wtmp entry. */ memset(&u, 0, sizeof(u)); strncpy(u.ut_line, ttyname + 5, sizeof(u.ut_line)); +#if defined(HAVE_ID_IN_UTMP) strncpy(u.ut_id, ttyname + 8, sizeof(u.ut_id)); +#endif /* defined(HAVE_ID_IN_UTMP) */ strncpy(u.ut_name, user, sizeof(u.ut_name)); #if defined(HAVE_TV_IN_UTMP) (void)gettimeofday(&u.ut_tv, NULL); -- 2.45.2