The new login code works fine with AIX 4.3. Two nits, though. If --disable-lastlog is defined, the code still tries to slog through wtmp to determine the last login time. Is this a bug or a feature? If a feature, change the DISABLE_LASTLOG test below to WITH_AIXAUTHENTICATE. Also, a small typo in configure.in, plus an AIX tweak. --- configure.in.orig Thu Jun 8 21:58:35 2000 +++ configure.in Mon Jun 12 16:27:54 2000 @@ -38,6 +38,8 @@ AC_DEFINE(BROKEN_GETADDRINFO) dnl AIX handles lastlog as part of its login message AC_DEFINE(DISABLE_LASTLOG) + MANTYPE='$(CATMAN)' + mansubdir=cat ;; *-*-hpux10*) if test -z "$GCC"; then @@ -994,7 +996,7 @@ [ char *lastlog = _PATH_LASTLOG; ], [ AC_MSG_RESULT(yes) ], [ - AC_MSG_RESULT(no), + AC_MSG_RESULT(no) system_lastlog_path=no ]) ] --- session.c.orig Mon Jun 12 16:52:59 2000 +++ session.c Mon Jun 12 16:54:24 2000 @@ -524,6 +524,9 @@ /* Get remote host name. */ hostname = get_canonical_hostname(); +#if defined(DISABLE_LASTLOG) + last_login_time = 0; +#else /* * Get the time when the user last logged in. Buf will be set to * contain the hostname the last login was from. @@ -532,6 +535,7 @@ last_login_time = get_last_login_time(pw->pw_uid, pw->pw_name, buf, sizeof(buf)); } +#endif #ifdef USE_PAM do_pam_session(pw->pw_name, s->tty); -- Tom Bertelson "Any sufficiently advanced technology RHI Consulting is indistinguishable from magic." tbert at abac.com -- Arthur C. Clarke
Tom Bertelson wrote:> > The new login code works fine with AIX 4.3. Two nits, though. If > --disable-lastlog is defined, the code still tries to slog through wtmp > to determine the last login time. Is this a bug or a feature? If a > feature, change the DISABLE_LASTLOG test below to WITH_AIXAUTHENTICATE. > Also, a small typo in configure.in, plus an AIX tweak. >8< 8< Glad to hear it's working on AIX :) The DISABLE_LASTLOG issue you mention is a bug, I've made some changes to loginrec.c that I hope will fix it. If you have time please could you test the attached patch? All it does is immediately return 0 if DISABLE_LASTLOG is defined. USE_LASTLOG isn't the opposite of DISABLE_LASTLOG. A bit confusing, I know. USE_LASTLOG means 'this system has some form of lastlog recording of its own so use it', whereas DISABLE_LASTLOG should mean 'don't even *try* to retrieve lastlog information from any source.' USE_SYSTEM_LASTLOG might be a better symbol name than USE_LASTLOG. Since the problem should be fixed in loginrec.c, no change is required in session.c. I've applied your changes to configure.in, thanks. -Andre'> > -- > Tom Bertelson "Any sufficiently advanced technology > RHI Consulting is indistinguishable from magic." > tbert at abac.com -- Arthur C. Clarke-------------- next part -------------- Index: loginrec.c ==================================================================RCS file: /var/cvs/openssh/loginrec.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- loginrec.c 2000/06/07 11:32:13 1.4 +++ loginrec.c 2000/06/12 22:21:44 1.5 @@ -170,7 +170,7 @@ #include "xmalloc.h" #include "loginrec.h" -RCSID("$Id: loginrec.c,v 1.4 2000/06/07 11:32:13 djm Exp $"); +RCSID("$Id: loginrec.c,v 1.5 2000/06/12 22:21:44 andre Exp $"); /** ** prototypes for helper functions in this file @@ -372,29 +372,40 @@ #else /* !USE_LASTLOG */ +# ifdef DISABLE_LASTLOG + /* On some systems we shouldn't even try to obtain last login + * time, e.g. AIX */ + return 0; + +# else /* Try to retrieve the last login time from wtmp */ -# if defined(USE_WTMP) && (defined(HAVE_TIME_IN_UTMP) || defined(HAVE_TV_IN_UTMP)) +# if defined(USE_WTMP) && (defined(HAVE_TIME_IN_UTMP) || defined(HAVE_TV_IN_UTMP)) /* retrieve last login time from utmp */ if (wtmp_get_entry(li)) return 1; else return 0; -# else +# else /* If wtmp isn't available, try wtmpx */ -# if defined(USE_WTMPX) && (defined(HAVE_TIME_IN_UTMPX) || defined(HAVE_TV_IN_UTMPX)) +# if defined(USE_WTMPX) && (defined(HAVE_TIME_IN_UTMPX) || defined(HAVE_TV_IN_UTMPX)) /* retrieve last login time from utmpx */ if (wtmpx_get_entry(li)) return 1; else return 0; -# else +# else /* Give up: No means of retrieving last login time */ return 0; +# endif + /* USE_WTMPX && (HAVE_TIME_IN_UTMPX || HAVE_TV_IN_UTMPX) */ + # endif + /* USE_WTMP && (HAVE_TIME_IN_UTMP || HAVE_TV_IN_UTMP) */ # endif + /* DISABLE_LASTLOG */ #endif /* USE_LASTLOG */ }