[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.1 and 1.104.2.2

version 1.104.2.1, 2003/04/01 00:12:13 version 1.104.2.2, 2003/09/16 21:20:25
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(write, fileno(stdout), buffer_ptr(bout), buffer_len(bout));                  atomicio(vwrite, fileno(stdout), buffer_ptr(bout), buffer_len(bout));
         if (buffer_len(berr) > 0)          if (buffer_len(berr) > 0)
                 atomicio(write, fileno(stderr), buffer_ptr(berr), buffer_len(berr));                  atomicio(vwrite, 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')) {
                 log("Invalid command.");                  logit("Invalid command.");
                 goto out;                  goto out;
         }          }
         if (s[1] == 'L')          if (s[1] == 'L')
                 local = 1;                  local = 1;
         if (!local && !compat20) {          if (!local && !compat20) {
                 log("Not supported for SSH protocol version 1.");                  logit("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) {
                 log("Bad forwarding specification.");                  logit("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) {
                 log("Bad forwarding port(s).");                  logit("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) {
                         log("Port forwarding failed.");                          logit("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);
         log("Forwarding port.");          logit("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)
                                                 log("Server does not support re-keying");                                                  logit("Server does not support re-keying");
                                         else                                          else
                                                 need_rekeying = 1;                                                  need_rekeying = 1;
                                 }                                  }
Line 636 
Line 649 
 "%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 646 
Line 660 
 (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 968 
Line 982 
                 /* 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()) {
                         if (need_rekeying) {                                  debug("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 1146 
Line 1159 
         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,
             xstrdup(originator_address), 1);              originator_address, 1);
         xfree(originator_address);          xfree(originator_address);
         xfree(listen_address);          xfree(listen_address);
         return c;          return c;
Line 1182 
Line 1195 
                 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,              CHAN_TCP_WINDOW_DEFAULT, CHAN_X11_PACKET_DEFAULT, 0, "x11", 1);
             xstrdup("x11"), 1);  
         c->force_drain = 1;          c->force_drain = 1;
         return c;          return c;
 }  }
Line 1205 
Line 1217 
         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,
             xstrdup("authentication agent connection"), 1);              "authentication agent connection", 1);
         c->force_drain = 1;          c->force_drain = 1;
         return c;          return c;
 }  }

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