[BACK]Return to sshlogin.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / ssh

Diff for /src/usr.bin/ssh/sshlogin.c between version 1.7 and 1.8

version 1.7, 2003/06/12 07:57:38 version 1.8, 2004/06/21 17:36:31
Line 83 
Line 83 
  * systems were more standardized.   * systems were more standardized.
  */   */
 void  void
 record_login(pid_t pid, const char *ttyname, const char *user, uid_t uid,  record_login(pid_t pid, const char *tty, const char *user, uid_t uid,
     const char *host, struct sockaddr * addr, socklen_t addrlen)      const char *host, struct sockaddr * addr, socklen_t addrlen)
 {  {
         int fd;          int fd;
Line 93 
Line 93 
   
         /* Construct an utmp/wtmp entry. */          /* Construct an utmp/wtmp entry. */
         memset(&u, 0, sizeof(u));          memset(&u, 0, sizeof(u));
         strncpy(u.ut_line, ttyname + 5, sizeof(u.ut_line));          strncpy(u.ut_line, tty + 5, sizeof(u.ut_line));
         u.ut_time = time(NULL);          u.ut_time = time(NULL);
         strncpy(u.ut_name, user, sizeof(u.ut_name));          strncpy(u.ut_name, user, sizeof(u.ut_name));
         strncpy(u.ut_host, host, sizeof(u.ut_host));          strncpy(u.ut_host, host, sizeof(u.ut_host));
Line 111 
Line 111 
   
                 /* Update lastlog. */                  /* Update lastlog. */
                 ll.ll_time = time(NULL);                  ll.ll_time = time(NULL);
                 strncpy(ll.ll_line, ttyname + 5, sizeof(ll.ll_line));                  strncpy(ll.ll_line, tty + 5, sizeof(ll.ll_line));
                 strncpy(ll.ll_host, host, sizeof(ll.ll_host));                  strncpy(ll.ll_host, host, sizeof(ll.ll_host));
                 fd = open(lastlog, O_RDWR);                  fd = open(lastlog, O_RDWR);
                 if (fd >= 0) {                  if (fd >= 0) {
Line 125 
Line 125 
   
 /* Records that the user has logged out. */  /* Records that the user has logged out. */
 void  void
 record_logout(pid_t pid, const char *ttyname)  record_logout(pid_t pid, const char *tty)
 {  {
         const char *line = ttyname + 5; /* /dev/ttyq8 -> ttyq8 */          const char *line = tty + 5;     /* /dev/ttyq8 -> ttyq8 */
         if (logout(line))          if (logout(line))
                 logwtmp(line, "", "");                  logwtmp(line, "", "");
 }  }

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8