From 89104c69d44ec188ca28b61a4b7ec054376772a2 Mon Sep 17 00:00:00 2001 From: Mark Eichin Date: Fri, 5 Aug 1994 19:37:09 +0000 Subject: [PATCH] ultrix has wierd getutent, so check if utmp.ut_pid exists, and conditionalize on that too... git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@4051 dc483132-0cff-0310-8789-dd5450dbe970 --- src/appl/bsd/ChangeLog | 6 +++++- src/appl/bsd/configure.in | 5 +++++ src/appl/bsd/logutil.c | 6 +++--- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/appl/bsd/ChangeLog b/src/appl/bsd/ChangeLog index 92c437e1c..3e0894338 100644 --- a/src/appl/bsd/ChangeLog +++ b/src/appl/bsd/ChangeLog @@ -1,4 +1,8 @@ -Wed Jul 27 12:52:04 1994 Mark Eichin (eichin@tweedledumber.cygnus.com) +Fri Aug 5 15:35:54 1994 Mark Eichin (eichin@cygnus.com) + + * configure.in, logutil.c: check for NO_UT_PID, use it. + +Wed Jul 27 12:52:04 1994 Mark Eichin (eichin@cygnus.com) * krlogind.c, krlogin.c, krcp.c: define roundup if needed. diff --git a/src/appl/bsd/configure.in b/src/appl/bsd/configure.in index 1dc3cdf2c..ae55528f0 100644 --- a/src/appl/bsd/configure.in +++ b/src/appl/bsd/configure.in @@ -37,6 +37,11 @@ AC_COMPILE_CHECK([ut_exit in struct utmp], [struct utmp ut; ut.ut_exit;], , AC_DEFINE(NO_UT_EXIT)) +AC_COMPILE_CHECK([ut_pid in struct utmp], +[#include ], +[struct utmp ut; ut.ut_pid;], +, +AC_DEFINE(NO_UT_PID)) KRB_INCLUDE WITH_KRB5ROOT WITH_KRB4 diff --git a/src/appl/bsd/logutil.c b/src/appl/bsd/logutil.c index 357d00d16..9cd8c6664 100644 --- a/src/appl/bsd/logutil.c +++ b/src/appl/bsd/logutil.c @@ -47,7 +47,7 @@ void login(ut) struct utmp utmp; int tty; -#ifdef HAVE_GETUTENT +#if defined(HAVE_GETUTENT) && !defined(NO_UT_PID) if (!ut->ut_pid) ut->ut_pid = getppid(); ut->ut_type = USER_PROCESS; @@ -94,7 +94,7 @@ logout(line) memset(ut.ut_host,0, sizeof(ut.ut_host)); #endif (void)time(&ut.ut_time); -#ifdef HAVE_GETUTENT +#if defined(HAVE_GETUTENT) && !defined(NO_UT_PID) memset(ut.ut_id, 0, sizeof(ut.ut_id)); ut.ut_pid = 0; #ifndef NO_UT_EXIT @@ -144,7 +144,7 @@ logwtmp(line, name, host, keep_open, logingin) ut.ut_pid = getpid(); #endif (void)time(&ut.ut_time); -#ifdef HAVE_GETUTENT +#if defined(HAVE_GETUTENT) && !defined(NO_UT_PID) if (*name) { if (!ut.ut_pid) ut.ut_pid = getpid(); -- 2.26.2