summaryrefslogtreecommitdiffstats
path: root/crypto/openssh
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2002-04-22 06:26:29 +0000
committerdes <des@FreeBSD.org>2002-04-22 06:26:29 +0000
commitad8d1ef86437bedffa64b0236177744517aafc2b (patch)
treeb97ef4b87c310e83f89780f7b7bb61e4a6bb6d0d /crypto/openssh
parent1a6399fa3be477587355282bb93877236e8ea199 (diff)
downloadFreeBSD-src-ad8d1ef86437bedffa64b0236177744517aafc2b.zip
FreeBSD-src-ad8d1ef86437bedffa64b0236177744517aafc2b.tar.gz
Don't report last login time in PAM case. (perforce change 10057)
Sponsored by: DARPA, NAI Labs
Diffstat (limited to 'crypto/openssh')
-rw-r--r--crypto/openssh/session.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/crypto/openssh/session.c b/crypto/openssh/session.c
index 3356117..2901242 100644
--- a/crypto/openssh/session.c
+++ b/crypto/openssh/session.c
@@ -604,17 +604,17 @@ void
do_login(Session *s, const char *command)
{
FILE *f;
- char *time_string;
#ifndef USE_PAM
+ char *time_string;
char *newcommand = NULL;
#endif
char buf[256];
- char hostname[MAXHOSTNAMELEN];
#ifndef USE_PAM
+ char hostname[MAXHOSTNAMELEN];
socklen_t fromlen;
struct sockaddr_storage from;
-#endif
time_t last_login_time;
+#endif
struct passwd * pw = s->pw;
#ifndef USE_PAM
pid_t pid = getpid();
@@ -647,6 +647,7 @@ do_login(Session *s, const char *command)
}
#endif
+#ifndef USE_PAM
/* Get the time and hostname when the user last logged in. */
if (options.print_lastlog) {
hostname[0] = '\0';
@@ -654,7 +655,6 @@ do_login(Session *s, const char *command)
hostname, sizeof(hostname));
}
-#ifndef USE_PAM
/* Record that there was a login on that tty from the remote host. */
record_login(pid, s->tty, pw->pw_name, pw->pw_uid,
get_remote_name_or_ip(utmp_len, options.verify_reverse_mapping),
@@ -736,6 +736,7 @@ do_login(Session *s, const char *command)
}
#endif /* HAVE_LOGIN_CAP */
+#ifndef USE_PAM
/*
* If the user has logged in before, display the time of last
* login. However, don't display anything extra if a command
@@ -756,6 +757,7 @@ do_login(Session *s, const char *command)
else
printf("Last login: %s from %s\r\n", time_string, hostname);
}
+#endif /* !USE_PAM */
#ifdef HAVE_LOGIN_CAP
if (command == NULL && !check_quietlogin(s, command) &&
OpenPOWER on IntegriCloud