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

Diff for /src/usr.bin/ssh/clientloop.c between version 1.104.2.2 and 1.105

version 1.104.2.2, 2003/09/16 21:20:25 version 1.105, 2002/11/18 16:43:44
Line 395 
Line 395 
   
         /* Flush stdout and stderr buffers. */          /* Flush stdout and stderr buffers. */
         if (buffer_len(bout) > 0)          if (buffer_len(bout) > 0)
                 atomicio(vwrite, fileno(stdout), buffer_ptr(bout), buffer_len(bout));                  atomicio(write, fileno(stdout), buffer_ptr(bout), buffer_len(bout));
         if (buffer_len(berr) > 0)          if (buffer_len(berr) > 0)
                 atomicio(vwrite, fileno(stderr), buffer_ptr(berr), buffer_len(berr));                  atomicio(write, fileno(stderr), buffer_ptr(berr), buffer_len(berr));
   
         leave_raw_mode();          leave_raw_mode();
   
Line 490 
Line 490 
         if (*s == 0)          if (*s == 0)
                 goto out;                  goto out;
         if (strlen(s) < 2 || s[0] != '-' || !(s[1] == 'L' || s[1] == 'R')) {          if (strlen(s) < 2 || s[0] != '-' || !(s[1] == 'L' || s[1] == 'R')) {
                 logit("Invalid command.");                  log("Invalid command.");
                 goto out;                  goto out;
         }          }
         if (s[1] == 'L')          if (s[1] == 'L')
                 local = 1;                  local = 1;
         if (!local && !compat20) {          if (!local && !compat20) {
                 logit("Not supported for SSH protocol version 1.");                  log("Not supported for SSH protocol version 1.");
                 goto out;                  goto out;
         }          }
         s += 2;          s += 2;
Line 507 
Line 507 
             sfwd_port, buf, sfwd_host_port) != 3 &&              sfwd_port, buf, sfwd_host_port) != 3 &&
             sscanf(s, "%5[0-9]/%255[^/]/%5[0-9]",              sscanf(s, "%5[0-9]/%255[^/]/%5[0-9]",
             sfwd_port, buf, sfwd_host_port) != 3) {              sfwd_port, buf, sfwd_host_port) != 3) {
                 logit("Bad forwarding specification.");                  log("Bad forwarding specification.");
                 goto out;                  goto out;
         }          }
         if ((fwd_port = a2port(sfwd_port)) == 0 ||          if ((fwd_port = a2port(sfwd_port)) == 0 ||
             (fwd_host_port = a2port(sfwd_host_port)) == 0) {              (fwd_host_port = a2port(sfwd_host_port)) == 0) {
                 logit("Bad forwarding port(s).");                  log("Bad forwarding port(s).");
                 goto out;                  goto out;
         }          }
         if (local) {          if (local) {
                 if (channel_setup_local_fwd_listener(fwd_port, buf,                  if (channel_setup_local_fwd_listener(fwd_port, buf,
                     fwd_host_port, options.gateway_ports) < 0) {                      fwd_host_port, options.gateway_ports) < 0) {
                         logit("Port forwarding failed.");                          log("Port forwarding failed.");
                         goto out;                          goto out;
                 }                  }
         } else          } else
                 channel_request_remote_forwarding(fwd_port, buf,                  channel_request_remote_forwarding(fwd_port, buf,
                     fwd_host_port);                      fwd_host_port);
         logit("Forwarding port.");          log("Forwarding port.");
 out:  out:
         signal(SIGINT, handler);          signal(SIGINT, handler);
         enter_raw_mode();          enter_raw_mode();
Line 574 
Line 574 
                                 /* We have been continued. */                                  /* We have been continued. */
                                 continue;                                  continue;
   
                         case 'B':  
                                 if (compat20) {  
                                         snprintf(string, sizeof string,  
                                             "%cB\r\n", escape_char);  
                                         buffer_append(berr, string,  
                                             strlen(string));  
                                         channel_request_start(session_ident,  
                                             "break", 0);  
                                         packet_put_int(1000);  
                                         packet_send();  
                                 }  
                                 continue;  
   
                         case 'R':                          case 'R':
                                 if (compat20) {                                  if (compat20) {
                                         if (datafellows & SSH_BUG_NOREKEY)                                          if (datafellows & SSH_BUG_NOREKEY)
                                                 logit("Server does not support re-keying");                                                  log("Server does not support re-keying");
                                         else                                          else
                                                 need_rekeying = 1;                                                  need_rekeying = 1;
                                 }                                  }
Line 649 
Line 636 
 "%c?\r\n\  "%c?\r\n\
 Supported escape sequences:\r\n\  Supported escape sequences:\r\n\
 %c.  - terminate connection\r\n\  %c.  - terminate connection\r\n\
 %cB  - send a BREAK to the remote system\r\n\  
 %cC  - open a command line\r\n\  %cC  - open a command line\r\n\
 %cR  - Request rekey (SSH protocol 2 only)\r\n\  %cR  - Request rekey (SSH protocol 2 only)\r\n\
 %c^Z - suspend ssh\r\n\  %c^Z - suspend ssh\r\n\
Line 660 
Line 646 
 (Note that escapes are only recognized immediately after newline.)\r\n",  (Note that escapes are only recognized immediately after newline.)\r\n",
                                     escape_char, escape_char, escape_char, escape_char,                                      escape_char, escape_char, escape_char, escape_char,
                                     escape_char, escape_char, escape_char, escape_char,                                      escape_char, escape_char, escape_char, escape_char,
                                     escape_char, escape_char, escape_char);                                      escape_char, escape_char);
                                 buffer_append(berr, string, strlen(string));                                  buffer_append(berr, string, strlen(string));
                                 continue;                                  continue;
   
Line 982 
Line 968 
                 /* Do channel operations unless rekeying in progress. */                  /* Do channel operations unless rekeying in progress. */
                 if (!rekeying) {                  if (!rekeying) {
                         channel_after_select(readset, writeset);                          channel_after_select(readset, writeset);
                         if (need_rekeying || packet_need_rekeying()) {  
                                 debug("need rekeying");                          if (need_rekeying) {
                                   debug("user requests rekeying");
                                 xxx_kex->done = 0;                                  xxx_kex->done = 0;
                                 kex_send_kexinit(xxx_kex);                                  kex_send_kexinit(xxx_kex);
                                 need_rekeying = 0;                                  need_rekeying = 0;
Line 1159 
Line 1146 
         c = channel_new("forwarded-tcpip",          c = channel_new("forwarded-tcpip",
             SSH_CHANNEL_CONNECTING, sock, sock, -1,              SSH_CHANNEL_CONNECTING, sock, sock, -1,
             CHAN_TCP_WINDOW_DEFAULT, CHAN_TCP_WINDOW_DEFAULT, 0,              CHAN_TCP_WINDOW_DEFAULT, CHAN_TCP_WINDOW_DEFAULT, 0,
             originator_address, 1);              xstrdup(originator_address), 1);
         xfree(originator_address);          xfree(originator_address);
         xfree(listen_address);          xfree(listen_address);
         return c;          return c;
Line 1195 
Line 1182 
                 return NULL;                  return NULL;
         c = channel_new("x11",          c = channel_new("x11",
             SSH_CHANNEL_X11_OPEN, sock, sock, -1,              SSH_CHANNEL_X11_OPEN, sock, sock, -1,
             CHAN_TCP_WINDOW_DEFAULT, CHAN_X11_PACKET_DEFAULT, 0, "x11", 1);              CHAN_TCP_WINDOW_DEFAULT, CHAN_X11_PACKET_DEFAULT, 0,
               xstrdup("x11"), 1);
         c->force_drain = 1;          c->force_drain = 1;
         return c;          return c;
 }  }
Line 1217 
Line 1205 
         c = channel_new("authentication agent connection",          c = channel_new("authentication agent connection",
             SSH_CHANNEL_OPEN, sock, sock, -1,              SSH_CHANNEL_OPEN, sock, sock, -1,
             CHAN_X11_WINDOW_DEFAULT, CHAN_TCP_WINDOW_DEFAULT, 0,              CHAN_X11_WINDOW_DEFAULT, CHAN_TCP_WINDOW_DEFAULT, 0,
             "authentication agent connection", 1);              xstrdup("authentication agent connection"), 1);
         c->force_drain = 1;          c->force_drain = 1;
         return c;          return c;
 }  }

Legend:
Removed from v.1.104.2.2  
changed lines
  Added in v.1.105