[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.2 and 1.3

version 1.2, 2000/04/06 08:55:22 version 1.3, 2000/04/14 10:09:16
Line 1134 
Line 1134 
         s->row = packet_get_int();          s->row = packet_get_int();
         s->xpixel = packet_get_int();          s->xpixel = packet_get_int();
         s->ypixel = packet_get_int();          s->ypixel = packet_get_int();
           packet_done();
         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);
         return 1;          return 1;
 }  }
Line 1142 
Line 1143 
 session_pty_req(Session *s)  session_pty_req(Session *s)
 {  {
         unsigned int len;          unsigned int len;
           char *term_modes;       /* encoded terminal modes */
   
         if (s->ttyfd != -1)          if (s->ttyfd != -1)
                 return -1;                  return 0;
         s->term = packet_get_string(&len);          s->term = packet_get_string(&len);
         s->col = packet_get_int();          s->col = packet_get_int();
         s->row = packet_get_int();          s->row = packet_get_int();
         s->xpixel = packet_get_int();          s->xpixel = packet_get_int();
         s->ypixel = packet_get_int();          s->ypixel = packet_get_int();
           term_modes = packet_get_string(&len);
           packet_done();
   
         if (strcmp(s->term, "") == 0) {          if (strcmp(s->term, "") == 0) {
                 xfree(s->term);                  xfree(s->term);
Line 1162 
Line 1166 
                 s->ptyfd = -1;                  s->ptyfd = -1;
                 s->ttyfd = -1;                  s->ttyfd = -1;
                 error("session_pty_req: session %d alloc failed", s->self);                  error("session_pty_req: session %d alloc failed", s->self);
                 return -1;                  xfree(term_modes);
                   return 0;
         }          }
         debug("session_pty_req: session %d alloc %s", s->self, s->tty);          debug("session_pty_req: session %d alloc %s", s->self, s->tty);
         /*          /*
Line 1174 
Line 1179 
         /* 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);
   
           /* XXX parse and set terminal modes */
           xfree(term_modes);
         return 1;          return 1;
 }  }
   
Line 1206 
Line 1213 
          */           */
         if (c->type == SSH_CHANNEL_LARVAL) {          if (c->type == SSH_CHANNEL_LARVAL) {
                 if (strcmp(rtype, "shell") == 0) {                  if (strcmp(rtype, "shell") == 0) {
                           packet_done();
                         if (s->ttyfd == -1)                          if (s->ttyfd == -1)
                                 do_exec_no_pty(s, NULL, s->pw);                                  do_exec_no_pty(s, NULL, s->pw);
                         else                          else
Line 1213 
Line 1221 
                         success = 1;                          success = 1;
                 } else if (strcmp(rtype, "exec") == 0) {                  } else if (strcmp(rtype, "exec") == 0) {
                         char *command = packet_get_string(&len);                          char *command = packet_get_string(&len);
                           packet_done();
                         if (s->ttyfd == -1)                          if (s->ttyfd == -1)
                                 do_exec_no_pty(s, command, s->pw);                                  do_exec_no_pty(s, command, s->pw);
                         else                          else
Line 1220 
Line 1229 
                         xfree(command);                          xfree(command);
                         success = 1;                          success = 1;
                 } else if (strcmp(rtype, "pty-req") == 0) {                  } else if (strcmp(rtype, "pty-req") == 0) {
                         if (session_pty_req(s) > 0)                          success =  session_pty_req(s);
                                 success = 1;  
                 }                  }
         }          }
         if (strcmp(rtype, "window-change") == 0) {          if (strcmp(rtype, "window-change") == 0) {

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3