Remove duplicate "last" log messages with UseLogin

Wayne Davison wayne at blorf.net
Thu Jun 7 03:28:36 EST 2001


Using UseLogin on a system that has to twiddle utmpx before calling
login currently also twiddles wtmpx, and this causes problems on Solaris
in the "last" log.  Changing the source to avoid modifying wtmpx when
also modifying utmpx fixes things up nicely:

Index: loginrec.c
--- loginrec.c	2001/05/08 20:33:06	1.33
+++ loginrec.c	2001/06/06 17:14:25
@@ -456,9 +456,10 @@
 # endif
 # ifdef USE_UTMPX
 	utmpx_write_entry(li);
-# endif
-# ifdef USE_WTMPX
+# else
+#  ifdef USE_WTMPX
 	wtmpx_write_entry(li);
+#  endif
 # endif
 	return 0;
 }

Now running "last -10" after logging in has only a single entry for each
ssh user, rather than a totally bogus entry before each valid entry.
I'd be interested in knowing if this works properly on UNICOS or not.

..wayne..




More information about the openssh-unix-dev mailing list