last login time, was: snapshot-20001014: HP-UX 10.20 success and some remarks
Peter Stuge
stuge at cdy.org
Sun Oct 15 05:17:30 EST 2000
On Sat, Oct 14, 2000 at 07:42:03PM +0200, Kevin Steves wrote:
> : I also just noted (I never cared to look onto that in detail), that the
> : date of last login printed just on top does not show the last login
> : but the actual one. This is already true for 2.2.0p1, don't know about
> : older versions.
>
> Hmm, works fine on 11.0. I glanced at the code and didn't see anything
> that would cause this, so more investigation is needed. My OpenBSD
> system with 2.2.0 seems to be doing this as well, so I may be missing
> something obvious. Can you try to debug on your end?
When checking out the code this behaviour is what you'd expect, it's not
what we want, however. The problem (in 2.2.0p1) was in session.c:662;
record_login(), which calls login_login() which calls login_write() which
stores the current login in lastlog/utmp/whatever, is called before
get_last_login_time(), which does it's job and tells us the last recorded
login time.
I just downloaded SNAP-20001014 and this has been fixed there. Twice. (?)
Patch cleans this up.
--- session.c.old Sat Oct 14 20:12:38 2000
+++ session.c Sat Oct 14 20:12:09 2000
@@ -708,10 +708,6 @@
}
/* Get the time and hostname when the user last logged in. */
- last_login_time = get_last_login_time(pw->pw_uid, pw->pw_name,
- hostname, sizeof(hostname));
-
- /* Get the time and hostname when the user last logged in. */
hostname[0] = '\0';
last_login_time = get_last_login_time(pw->pw_uid, pw->pw_name,
hostname, sizeof(hostname));
//Peter
--
irc: CareBear\ tel: +46-40-914420
irl: Peter Stuge gsm: +46-705-783805
More information about the openssh-unix-dev
mailing list