Print this page
6057 login(1) "Last login" hostname is too short
Reviewed by: Gary Mills <gary_mills@fastmail.fm>
Reviewed by: Albert Lee <trisk@omniti.com>
Reviewed by: Jason King <jason.brian.king@gmail.com>
Reviewed by: Alex Wilson <alex.wilson@joyent.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/ssh/sshd/sshlogin.c
          +++ new/usr/src/cmd/ssh/sshd/sshlogin.c
↓ open down ↓ 48 lines elided ↑ open up ↑
  49   49  #include "log.h"
  50   50  #include "buffer.h"
  51   51  #include "servconf.h"
  52   52  #include "canohost.h"
  53   53  #include "packet.h"
  54   54  
  55   55  extern u_int utmp_len;
  56   56  extern ServerOptions options;
  57   57  
  58   58  /*
  59      - * Returns the time when the user last logged in.  Returns 0 if the
  60      - * information is not available.  This must be called before record_login.
  61      - * The host the user logged in from will be returned in buf.
  62      - */
  63      -u_long
  64      -get_last_login_time(uid_t uid, const char *logname,
  65      -    char *buf, u_int bufsize)
  66      -{
  67      -  struct logininfo li;
  68      -
  69      -  (void) login_get_lastlog(&li, uid);
  70      -  (void) strlcpy(buf, li.hostname, bufsize);
  71      -  return li.tv_sec;
  72      -}
  73      -
  74      -/*
  75   59   * Records that the user has logged in.  If only these parts of operating
  76   60   * systems were more standardized.
  77   61   */
  78   62  void
  79   63  record_login(pid_t pid, const char *ttyname, const char *progname,
  80   64                  const char *user)
  81   65  {
  82   66    struct logininfo *li;
  83   67    static int initialized = 0;
  84   68    static socklen_t fromlen;
↓ open down ↓ 42 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX