PrintLastLog option is not honored

Christian Kurz shorty at debian.org
Thu Dec 28 09:56:56 EST 2000


On 00-12-28 Pekka Savola wrote:
> On Wed, 27 Dec 2000, Christian Kurz wrote:
> > here's another bug report against openssh with a patch included (from
> > the same person who submitted the bug report). Would you please apply
> > it? Thanks!

> Umm.. There is no print_lastlog option in OpenSSH base/portable.
> Perhaps you should supply the actual patch too ;-)

Thanks, I just noticed that I wonder where this patch is coming from.
Damn it's getting late. I should better go to bed know, but could this
be the patch for LastLog:

Index: session.c
--- session.c.prev
+++ session.c   Tue Sep 12 14:29:49 2000
@@ -681,19 +681,22 @@ do_login(Session *s)
 #endif /* WITH_AIXAUTHENTICATE */
 
-       /*
-        * Get the time when the user last logged in.  'buf' will be set
-        * to contain the hostname the last login was from. 
-        */
-       last_login_time = get_last_login_time(pw->pw_uid, pw->pw_name,
-           buf, sizeof(buf));
-       if (last_login_time != 0) {
-               time_string = ctime(&last_login_time);
-               if (strchr(time_string, '\n'))
-                       *strchr(time_string, '\n') = 0;
-               if (strcmp(buf, "") == 0)
-                       printf("Last login: %s\r\n", time_string);
-               else
-                       printf("Last login: %s from %s\r\n", time_string, buf);
+       if (options.print_lastlog) {
+               /*
+                * Get the time when the user last logged in.  'buf' will
+                * be set to contain the hostname the last login was from.
+                */
+               last_login_time = get_last_login_time(pw->pw_uid, pw->pw_name,
+                                                     buf, sizeof(buf));
+               if (last_login_time != 0) {
+                       time_string = ctime(&last_login_time);
+                       if (strchr(time_string, '\n'))
+                               *strchr(time_string, '\n') = 0;
+                       printf("Last login: %s", time_string);
+                       if (*buf)
+                               printf(" from %s", buf);
+                       printf("\r\n");
+               }
        }
+
        if (options.print_motd) {
 #ifdef HAVE_LOGIN_CAP

I found it in a bugreport with the comment:

|The PrintLastLogin configuration option is currently ignored:
|last-login info is *always* printed.  This patch corrects the bug.

The patch above was written by Chip Salzenberg
<chip at tytlal.perlsupport.com>, if this matters.

Ciao
     Christian
-- 
          Debian Developer and Quality Assurance Team Member
    1024/26CC7853 31E6 A8CA 68FC 284F 7D16  63EC A9E6 67FF 26CC 7853





More information about the openssh-unix-dev mailing list