Output of last command is strange on Solaris 2.6/8 (OpenSSH 2.9p2)

KITAZIMA Tuneki tuneki at pb.jp.nec.com
Thu Jun 21 22:59:02 EST 2001


Hi.

OS: Solaris 2.6 and 8
OpenSSH: 2.9p2

I found a bug.
Output of last command becomes strange in case of "UseLogin yes"
in sshd_config.
# Two entries are output with one time of login.

strange case:
 % last
 fuga      pts/3        bar.foo.co.jp    Thu Jun 21 12:45 - 20:02  (07:16)
 fuga      pts/3        bar.foo.co.jp    Thu Jan  1 09:00 - 12:45 (11494+03:45)
 hoge      pts/2        foo.bar.co.jp    Thu Jun 21 11:12 - 15:30  (04:17)
 hoge      pts/2        foo.bar.co.jp    Thu Jan  1 09:00 - 11:12 (11494+02:12)
 ....


When comment on it with wtmp_write_entry and wtmpx_write_entry of
login_utmp_only function, last output an usual entry.

 % last
 fuga      pts/3        bar.foo.co.jp    Thu Jun 21 12:45 - 20:02  (07:16)
 hoge      pts/2        foo.bar.co.jp    Thu Jun 21 11:12 - 15:30  (04:17)
 ...


--- openssh-2.9p2.orig/loginrec.c       Wed May  9 05:34:33 2001
+++ openssh-2.9p2/loginrec.c    Thu Jun 21 20:23:58 2001
@@ -451,15 +451,19 @@
 # ifdef USE_UTMP
        utmp_write_entry(li);
 # endif
+#ifndef __sun
 # ifdef USE_WTMP
        wtmp_write_entry(li);
 # endif
+#endif
 # ifdef USE_UTMPX
        utmpx_write_entry(li);
 # endif
+#ifndef __sun
 # ifdef USE_WTMPX
        wtmpx_write_entry(li);
 # endif
+#endif
        return 0;
 }
 #endif


If there is a right method of this case, please teach it.

-- 
 KITAZIMA, Tuneki        NEC Informatec Systems,Ltd.
  tuneki at pb.jp.nec.com    Shared Infrastructure and Services Division



More information about the openssh-unix-dev mailing list