diff options
author | ru <ru@FreeBSD.org> | 2001-05-28 09:57:19 +0000 |
---|---|---|
committer | ru <ru@FreeBSD.org> | 2001-05-28 09:57:19 +0000 |
commit | 13b0e9b8e7b63dbad42826e41d056ecc3332f1f8 (patch) | |
tree | 6e7027055098e52dc18140e0eecd259eafdca7f5 /usr.bin/last | |
parent | 01707e0035062e46b35977381c90da78a664751b (diff) | |
download | FreeBSD-src-13b0e9b8e7b63dbad42826e41d056ecc3332f1f8.zip FreeBSD-src-13b0e9b8e7b63dbad42826e41d056ecc3332f1f8.tar.gz |
The last(1) choked if there were two successive "login" marks
found in wtmp(5) for the same TTY without in-between "logout"
mark.
This may be demonstrated by executing login(1), logging in and
out, and watching the last(1) output on this TTY:
: # last -tv7 -w
: ru ttyv7 Mon May 28 12:46 - 12:46 (00:00:01)
: ru ttyv7 Mon May 28 12:45 still logged in
The fix merely takes the second "login" mark as the "logout" for
the first "login" mark, if there were no "logout" mark in-between.
This restores the behavior of last.c,v 1.2:
: # last -tv7 -w
: ru ttyv7 Mon May 28 12:46 - 12:46 (00:00:01)
: ru ttyv7 Mon May 28 12:45 - 12:46 (00:00:25)
Silence from: -arch, dg
Diffstat (limited to 'usr.bin/last')
-rw-r--r-- | usr.bin/last/last.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/usr.bin/last/last.c b/usr.bin/last/last.c index 79d6010..d449679 100644 --- a/usr.bin/last/last.c +++ b/usr.bin/last/last.c @@ -352,13 +352,10 @@ wtmp() delta / 86400, ct); } } - LIST_REMOVE(tt, list); - free(tt); if (maxrec != -1 && !--maxrec) return; - } else { - tt->logout = bp->ut_time; } + tt->logout = bp->ut_time; } } tm = localtime(&buf[0].ut_time); |