AIX and 2.1.1p1

Andre Lucas andre.lucas at dial.pipex.com
Tue Jun 13 09:45:06 EST 2000


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 */
 }


More information about the openssh-unix-dev mailing list