[didn't check earlier versions] When writing to `/var/log/lastlog', login chops off everything up to and including the rightmost '/' of its terminal name. tty names such as `/dev/pts/n' [n=0,1,..] or `/dev/vc/n' [n=1,2,..] appear in lastlog as just `n'. Steps to reproduce: 1. Make sure you're not using pam_lastlog, and that "LASTLOG_ENAB" is "yes" in `login.defs' (default after fresh install) 2. goto unused virtual console 3. log in 4. type the following commands: $ tty $ lastlog -u `id -un` 5. compare `tty' output and `Port' column of `lastlog' output 6. ^D and login again 7. note `Last login:' line Actual results vc login: ---- $ tty /dev/vc/6 $ lastlog -u bartron Username Port From Latest bartron 6 Sun Sep 14 19:22:18 +0200 2003 [logout/login] Last login: Sun Sep 14 19:22:18 on 6 ---- Actual results telnet login: ---- $ tty /dev/pts/6 $ lastlog -u bartron Username Port From Latest bartron 6 localhost Sun Sep 14 19:23:51 +0200 2003 ---- Expected results: `/dev/vc/6' and `/dev/pts/6' be recorded as `vc/6' and `pts/6', respectively, instead of just `6'.
Created attachment 17723 [details, diff] pam-login-3.11-lastlog-fix.patch patch for pam-login 3.11
Created attachment 17724 [details, diff] pam-login-3.10-lastlog-fix.patch this coming from the depths of my to-to pile when 3.10 was still current, here's a patch for pam-login-3.10 as well.
[um, it appears bugzilla doesn't expand tabs correctly...here's the output of above commands again...sorry about that] Actual results vc login: ---- $ tty /dev/vc/6 $ lastlog -u bartron Username Port From Latest bartron 6 Sun Sep 14 19:22:18 +0200 2003 [logout/login] Last login: Sun Sep 14 19:22:18 on 6 ---- Actual results telnet login: ---- $ tty /dev/pts/6 $ lastlog -u bartron Username Port From Latest bartron 6 localhost Sun Sep 14 19:23:51 +0200 2003 ----
Ok, added to 3.12, thanks.