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

Diff for /src/usr.bin/ssh/session.c between version 1.337 and 1.338

version 1.337, 2024/02/01 02:37:33 version 1.338, 2024/05/17 00:30:24
Line 705 
Line 705 
 {  {
         socklen_t fromlen;          socklen_t fromlen;
         struct sockaddr_storage from;          struct sockaddr_storage from;
         struct passwd * pw = s->pw;  
         pid_t pid = getpid();  
   
         /*          /*
          * Get IP address of client. If the connection is not a socket, let           * Get IP address of client. If the connection is not a socket, let
Line 722 
Line 720 
                 }                  }
         }          }
   
         /* Record that there was a login on that tty from the remote host. */  
         if (!use_privsep)  
                 record_login(pid, s->tty, pw->pw_name, pw->pw_uid,  
                     session_get_remote_name_or_ip(ssh, utmp_len,  
                     options.use_dns),  
                     (struct sockaddr *)&from, fromlen);  
   
         if (check_quietlogin(s, command))          if (check_quietlogin(s, command))
                 return;                  return;
   
Line 1606 
Line 1597 
   
         /* Allocate a pty and open it. */          /* Allocate a pty and open it. */
         debug("Allocating pty.");          debug("Allocating pty.");
         if (!PRIVSEP(pty_allocate(&s->ptyfd, &s->ttyfd, s->tty,          if (!mm_pty_allocate(&s->ptyfd, &s->ttyfd, s->tty, sizeof(s->tty))) {
             sizeof(s->tty)))) {  
                 free(s->term);                  free(s->term);
                 s->term = NULL;                  s->term = NULL;
                 s->ptyfd = -1;                  s->ptyfd = -1;
Line 1622 
Line 1612 
         if ((r = sshpkt_get_end(ssh)) != 0)          if ((r = sshpkt_get_end(ssh)) != 0)
                 sshpkt_fatal(ssh, r, "%s: parse packet", __func__);                  sshpkt_fatal(ssh, r, "%s: parse packet", __func__);
   
         if (!use_privsep)  
                 pty_setowner(s->pw, s->tty);  
   
         /* Set window size from the packet. */          /* Set window size from the packet. */
         pty_change_window_size(s->ptyfd, s->row, s->col, s->xpixel, s->ypixel);          pty_change_window_size(s->ptyfd, s->row, s->col, s->xpixel, s->ypixel);
   
Line 1840 
Line 1827 
                     signame, s->forced ? "forced-command" : "subsystem");                      signame, s->forced ? "forced-command" : "subsystem");
                 goto out;                  goto out;
         }          }
         if (!use_privsep || mm_is_monitor()) {          if (mm_is_monitor()) {
                 error_f("session signalling requires privilege separation");                  error_f("session signalling requires privilege separation");
                 goto out;                  goto out;
         }          }
Line 1983 
Line 1970 
 void  void
 session_pty_cleanup(Session *s)  session_pty_cleanup(Session *s)
 {  {
         PRIVSEP(session_pty_cleanup2(s));          mm_session_pty_cleanup2(s);
 }  }
   
 static char *  static char *
Line 2354 
Line 2341 
          * Cleanup ptys/utmp only if privsep is disabled,           * Cleanup ptys/utmp only if privsep is disabled,
          * or if running in monitor.           * or if running in monitor.
          */           */
         if (!use_privsep || mm_is_monitor())          if (mm_is_monitor())
                 session_destroy_all(ssh, session_pty_cleanup2);                  session_destroy_all(ssh, session_pty_cleanup2);
 }  }
   

Legend:
Removed from v.1.337  
changed lines
  Added in v.1.338