diff options
author | Ben Lindstrom <mouring@eviladmin.org> | 2001-03-26 05:45:53 +0000 |
---|---|---|
committer | Ben Lindstrom <mouring@eviladmin.org> | 2001-03-26 05:45:53 +0000 |
commit | 7bfff36ca3acf469de9fcad98826562ea6c1fbbe (patch) | |
tree | 964fdf0f76f7a5089a32018bcaa444782c81b954 /session.c | |
parent | 6029432ec5b07eecdd1fc96cb3110d77aa7faa36 (diff) |
- stevesk@cvs.openbsd.org 2001/03/25 13:16:11
[servconf.c servconf.h session.c sshd.8 sshd_config]
PrintLastLog option; from chip@valinux.com with some minor
changes by me. ok markus@
Diffstat (limited to 'session.c')
-rw-r--r-- | session.c | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -33,7 +33,7 @@ | |||
33 | */ | 33 | */ |
34 | 34 | ||
35 | #include "includes.h" | 35 | #include "includes.h" |
36 | RCSID("$OpenBSD: session.c,v 1.68 2001/03/25 00:01:34 djm Exp $"); | 36 | RCSID("$OpenBSD: session.c,v 1.69 2001/03/25 13:16:11 stevesk Exp $"); |
37 | 37 | ||
38 | #include "ssh.h" | 38 | #include "ssh.h" |
39 | #include "ssh1.h" | 39 | #include "ssh1.h" |
@@ -718,9 +718,11 @@ do_login(Session *s, const char *command) | |||
718 | } | 718 | } |
719 | 719 | ||
720 | /* Get the time and hostname when the user last logged in. */ | 720 | /* Get the time and hostname when the user last logged in. */ |
721 | hostname[0] = '\0'; | 721 | if (options.print_lastlog) { |
722 | last_login_time = get_last_login_time(pw->pw_uid, pw->pw_name, | 722 | hostname[0] = '\0'; |
723 | hostname, sizeof(hostname)); | 723 | last_login_time = get_last_login_time(pw->pw_uid, pw->pw_name, |
724 | hostname, sizeof(hostname)); | ||
725 | } | ||
724 | 726 | ||
725 | /* Record that there was a login on that tty from the remote host. */ | 727 | /* Record that there was a login on that tty from the remote host. */ |
726 | record_login(pid, s->tty, pw->pw_name, pw->pw_uid, | 728 | record_login(pid, s->tty, pw->pw_name, pw->pw_uid, |
@@ -757,7 +759,7 @@ do_login(Session *s, const char *command) | |||
757 | printf("%s\n", aixloginmsg); | 759 | printf("%s\n", aixloginmsg); |
758 | #endif /* WITH_AIXAUTHENTICATE */ | 760 | #endif /* WITH_AIXAUTHENTICATE */ |
759 | 761 | ||
760 | if (last_login_time != 0) { | 762 | if (options.print_lastlog && last_login_time != 0) { |
761 | time_string = ctime(&last_login_time); | 763 | time_string = ctime(&last_login_time); |
762 | if (strchr(time_string, '\n')) | 764 | if (strchr(time_string, '\n')) |
763 | *strchr(time_string, '\n') = 0; | 765 | *strchr(time_string, '\n') = 0; |