Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 28736 - [>=pam-login-3.10]: login not fully devfs/devpts-aware, writes wrong `ll_line' info to lastlog
Summary: [>=pam-login-3.10]: login not fully devfs/devpts-aware, writes wrong `ll_line...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: PAM Gentoo Team (OBSOLETE)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-09-14 15:20 UTC by bartron
Modified: 2003-09-24 20:58 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
pam-login-3.11-lastlog-fix.patch (pam-login-3.11-lastlog-fix.patch,362 bytes, patch)
2003-09-14 15:22 UTC, bartron
Details | Diff
pam-login-3.10-lastlog-fix.patch (pam-login-3.10-lastlog-fix.patch,362 bytes, patch)
2003-09-14 15:24 UTC, bartron
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description bartron 2003-09-14 15:20:47 UTC
[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'.
Comment 1 bartron 2003-09-14 15:22:27 UTC
Created attachment 17723 [details, diff]
pam-login-3.11-lastlog-fix.patch

patch for pam-login 3.11
Comment 2 bartron 2003-09-14 15:24:26 UTC
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.
Comment 3 bartron 2003-09-14 15:30:51 UTC
[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
----
Comment 4 Martin Schlemmer (RETIRED) gentoo-dev 2003-09-24 20:58:38 UTC
Ok, added to 3.12, thanks.