[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.8 and 1.9

version 1.8, 2000/04/29 16:06:08 version 1.9, 2000/05/02 07:32:44
Line 57 
Line 57 
 Session *session_new(void);  Session *session_new(void);
 void    session_set_fds(Session *s, int fdin, int fdout, int fderr);  void    session_set_fds(Session *s, int fdin, int fdout, int fderr);
 void    session_pty_cleanup(Session *s);  void    session_pty_cleanup(Session *s);
   void    session_proctitle(Session *s);
 void    do_exec_pty(Session *s, const char *command, struct passwd * pw);  void    do_exec_pty(Session *s, const char *command, struct passwd * pw);
 void    do_exec_no_pty(Session *s, const char *command, struct passwd * pw);  void    do_exec_no_pty(Session *s, const char *command, struct passwd * pw);
   
Line 392 
Line 393 
         if (s == NULL)          if (s == NULL)
                 fatal("do_exec_no_pty: no session");                  fatal("do_exec_no_pty: no session");
   
         setproctitle("%s@notty", pw->pw_name);          session_proctitle(s);
   
         /* Fork the child. */          /* Fork the child. */
         if ((pid = fork()) == 0) {          if ((pid = fork()) == 0) {
Line 518 
Line 519 
                 last_login_time = get_last_login_time(pw->pw_uid, pw->pw_name,                  last_login_time = get_last_login_time(pw->pw_uid, pw->pw_name,
                                                       buf, sizeof(buf));                                                        buf, sizeof(buf));
         }          }
         setproctitle("%s@%s", pw->pw_name, strrchr(s->tty, '/') + 1);  
   
         /* Fork the child. */          /* Fork the child. */
         if ((pid = fork()) == 0) {          if ((pid = fork()) == 0) {
Line 1184 
Line 1184 
         /* Get window size from the packet. */          /* Get 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);
   
           session_proctitle(s);
   
         /* XXX parse and set terminal modes */          /* XXX parse and set terminal modes */
         xfree(term_modes);          xfree(term_modes);
         return 1;          return 1;
Line 1426 
Line 1428 
 {  {
         session_pty_cleanup(s);          session_pty_cleanup(s);
         session_free(s);          session_free(s);
           session_proctitle(s);
 }  }
   
 void  void
Line 1467 
Line 1470 
                         error("session_close_by_channel: kill %d: %s",                          error("session_close_by_channel: kill %d: %s",
                             s->pid, strerror(errno));                              s->pid, strerror(errno));
         }          }
   }
   
   char *
   session_tty_list(void)
   {
           static char buf[1024];
           int i;
           buf[0] = '\0';
           for(i = 0; i < MAX_SESSIONS; i++) {
                   Session *s = &sessions[i];
                   if (s->used && s->ttyfd != -1) {
                           if (buf[0] != '\0')
                                   strlcat(buf, ",", sizeof buf);
                           strlcat(buf, strrchr(s->tty, '/') + 1, sizeof buf);
                   }
           }
           if (buf[0] == '\0')
                   strlcpy(buf, "notty", sizeof buf);
           return buf;
   }
   
   void
   session_proctitle(Session *s)
   {
           if (s->pw == NULL)
                   error("no user for session %d", s->self);
           else
                   setproctitle("%s@%s", s->pw->pw_name, session_tty_list());
 }  }
   
 void  void

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