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

Diff for /src/usr.bin/ssh/channels.c between version 1.214.2.2 and 1.215

version 1.214.2.2, 2006/02/03 02:53:44 version 1.215, 2005/06/16 03:38:36
Line 58 
Line 58 
   
 /* -- channel core */  /* -- channel core */
   
   #define CHAN_RBUF       16*1024
   
 /*  /*
  * Pointer to an array containing all allocated channels.  The array is   * Pointer to an array containing all allocated channels.  The array is
  * dynamically extended as needed.   * dynamically extended as needed.
Line 109 
Line 111 
 /* Maximum number of fake X11 displays to try. */  /* Maximum number of fake X11 displays to try. */
 #define MAX_DISPLAYS  1000  #define MAX_DISPLAYS  1000
   
 /* Saved X11 local (client) display. */  
 static char *x11_saved_display = NULL;  
   
 /* Saved X11 authentication protocol name. */  /* Saved X11 authentication protocol name. */
 static char *x11_saved_proto = NULL;  static char *x11_saved_proto = NULL;
   
Line 140 
Line 139 
 /* -- channel core */  /* -- channel core */
   
 Channel *  Channel *
 channel_by_id(int id)  channel_lookup(int id)
 {  {
         Channel *c;          Channel *c;
   
         if (id < 0 || (u_int)id >= channels_alloc) {          if (id < 0 || (u_int)id >= channels_alloc) {
                 logit("channel_by_id: %d: bad id", id);                  logit("channel_lookup: %d: bad id", id);
                 return NULL;                  return NULL;
         }          }
         c = channels[id];          c = channels[id];
         if (c == NULL) {          if (c == NULL) {
                 logit("channel_by_id: %d: bad id: channel free", id);                  logit("channel_lookup: %d: bad id: channel free", id);
                 return NULL;                  return NULL;
         }          }
         return c;          return c;
 }  }
   
 /*  /*
  * Returns the channel if it is allowed to receive protocol messages.  
  * Private channels, like listening sockets, may not receive messages.  
  */  
 Channel *  
 channel_lookup(int id)  
 {  
         Channel *c;  
   
         if ((c = channel_by_id(id)) == NULL)  
                 return (NULL);  
   
         switch(c->type) {  
         case SSH_CHANNEL_X11_OPEN:  
         case SSH_CHANNEL_LARVAL:  
         case SSH_CHANNEL_CONNECTING:  
         case SSH_CHANNEL_DYNAMIC:  
         case SSH_CHANNEL_OPENING:  
         case SSH_CHANNEL_OPEN:  
         case SSH_CHANNEL_INPUT_DRAINING:  
         case SSH_CHANNEL_OUTPUT_DRAINING:  
                 return (c);  
                 break;  
         }  
         logit("Non-public channel %d, type %d.", id, c->type);  
         return (NULL);  
 }  
   
 /*  
  * Register filedescriptors for a channel, used when allocating a channel or   * Register filedescriptors for a channel, used when allocating a channel or
  * when the channel consumer/producer is ready, e.g. shell exec'd   * when the channel consumer/producer is ready, e.g. shell exec'd
  */   */
Line 294 
Line 265 
         c->force_drain = 0;          c->force_drain = 0;
         c->single_connection = 0;          c->single_connection = 0;
         c->detach_user = NULL;          c->detach_user = NULL;
         c->detach_close = 0;  
         c->confirm = NULL;          c->confirm = NULL;
         c->confirm_ctx = NULL;          c->confirm_ctx = NULL;
         c->input_filter = NULL;          c->input_filter = NULL;
         c->output_filter = NULL;  
         debug("channel %d: new [%s]", found, remote_name);          debug("channel %d: new [%s]", found, remote_name);
         return c;          return c;
 }  }
Line 655 
Line 624 
         c->confirm_ctx = ctx;          c->confirm_ctx = ctx;
 }  }
 void  void
 channel_register_cleanup(int id, channel_callback_fn *fn, int do_close)  channel_register_cleanup(int id, channel_callback_fn *fn)
 {  {
         Channel *c = channel_by_id(id);          Channel *c = channel_lookup(id);
   
         if (c == NULL) {          if (c == NULL) {
                 logit("channel_register_cleanup: %d: bad id", id);                  logit("channel_register_cleanup: %d: bad id", id);
                 return;                  return;
         }          }
         c->detach_user = fn;          c->detach_user = fn;
         c->detach_close = do_close;  
 }  }
 void  void
 channel_cancel_cleanup(int id)  channel_cancel_cleanup(int id)
 {  {
         Channel *c = channel_by_id(id);          Channel *c = channel_lookup(id);
   
         if (c == NULL) {          if (c == NULL) {
                 logit("channel_cancel_cleanup: %d: bad id", id);                  logit("channel_cancel_cleanup: %d: bad id", id);
                 return;                  return;
         }          }
         c->detach_user = NULL;          c->detach_user = NULL;
         c->detach_close = 0;  
 }  }
 void  void
 channel_register_filter(int id, channel_infilter_fn *ifn,  channel_register_filter(int id, channel_filter_fn *fn)
     channel_outfilter_fn *ofn)  
 {  {
         Channel *c = channel_lookup(id);          Channel *c = channel_lookup(id);
   
Line 688 
Line 654 
                 logit("channel_register_filter: %d: bad id", id);                  logit("channel_register_filter: %d: bad id", id);
                 return;                  return;
         }          }
         c->input_filter = ifn;          c->input_filter = fn;
         c->output_filter = ofn;  
 }  }
   
 void  void
Line 761 
Line 726 
                         FD_SET(c->wfd, writeset);                          FD_SET(c->wfd, writeset);
                 } else if (c->ostate == CHAN_OUTPUT_WAIT_DRAIN) {                  } else if (c->ostate == CHAN_OUTPUT_WAIT_DRAIN) {
                         if (CHANNEL_EFD_OUTPUT_ACTIVE(c))                          if (CHANNEL_EFD_OUTPUT_ACTIVE(c))
                                 debug2("channel %d: obuf_empty delayed efd %d/(%d)",                                 debug2("channel %d: obuf_empty delayed efd %d/(%d)",
                                     c->self, c->efd, buffer_len(&c->extended));                                     c->self, c->efd, buffer_len(&c->extended));
                         else                          else
                                 chan_obuf_empty(c);                                  chan_obuf_empty(c);
                 }                  }
Line 928 
Line 893 
 channel_decode_socks4(Channel *c, fd_set * readset, fd_set * writeset)  channel_decode_socks4(Channel *c, fd_set * readset, fd_set * writeset)
 {  {
         char *p, *host;          char *p, *host;
         u_int len, have, i, found;          int len, have, i, found;
         char username[256];          char username[256];
         struct {          struct {
                 u_int8_t version;                  u_int8_t version;
Line 1013 
Line 978 
         } s5_req, s5_rsp;          } s5_req, s5_rsp;
         u_int16_t dest_port;          u_int16_t dest_port;
         u_char *p, dest_addr[255+1];          u_char *p, dest_addr[255+1];
         u_int have, i, found, nmethods, addrlen, af;          int i, have, found, nmethods, addrlen, af;
   
         debug2("channel %d: decode socks5", c->self);          debug2("channel %d: decode socks5", c->self);
         p = buffer_ptr(&c->input);          p = buffer_ptr(&c->input);
Line 1109 
Line 1074 
 channel_pre_dynamic(Channel *c, fd_set * readset, fd_set * writeset)  channel_pre_dynamic(Channel *c, fd_set * readset, fd_set * writeset)
 {  {
         u_char *p;          u_char *p;
         u_int have;          int have, ret;
         int ret;  
   
         have = buffer_len(&c->input);          have = buffer_len(&c->input);
         c->delayed = 0;          c->delayed = 0;
Line 1213 
Line 1177 
         int direct;          int direct;
         char buf[1024];          char buf[1024];
         char *remote_ipaddr = get_peer_ipaddr(c->sock);          char *remote_ipaddr = get_peer_ipaddr(c->sock);
         int remote_port = get_peer_port(c->sock);          u_short remote_port = get_peer_port(c->sock);
   
         direct = (strcmp(rtype, "direct-tcpip") == 0);          direct = (strcmp(rtype, "direct-tcpip") == 0);
   
Line 1243 
Line 1207 
                 }                  }
                 /* originator host and port */                  /* originator host and port */
                 packet_put_cstring(remote_ipaddr);                  packet_put_cstring(remote_ipaddr);
                 packet_put_int((u_int)remote_port);                  packet_put_int(remote_port);
                 packet_send();                  packet_send();
         } else {          } else {
                 packet_start(SSH_MSG_PORT_OPEN);                  packet_start(SSH_MSG_PORT_OPEN);
Line 1258 
Line 1222 
         xfree(remote_ipaddr);          xfree(remote_ipaddr);
 }  }
   
 static void  
 channel_set_reuseaddr(int fd)  
 {  
         int on = 1;  
   
         /*  
          * Set socket options.  
          * Allow local port reuse in TIME_WAIT.  
          */  
         if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)) == -1)  
                 error("setsockopt SO_REUSEADDR fd %d: %s", fd, strerror(errno));  
 }  
   
 /*  /*
  * This socket is listening for connections to a forwarded TCP/IP port.   * This socket is listening for connections to a forwarded TCP/IP port.
  */   */
Line 1442 
Line 1393 
                                 debug2("channel %d: filter stops", c->self);                                  debug2("channel %d: filter stops", c->self);
                                 chan_read_failed(c);                                  chan_read_failed(c);
                         }                          }
                 } else if (c->datagram) {  
                         buffer_put_string(&c->input, buf, len);  
                 } else {                  } else {
                         buffer_append(&c->input, buf, len);                          buffer_append(&c->input, buf, len);
                 }                  }
Line 1454 
Line 1403 
 channel_handle_wfd(Channel *c, fd_set * readset, fd_set * writeset)  channel_handle_wfd(Channel *c, fd_set * readset, fd_set * writeset)
 {  {
         struct termios tio;          struct termios tio;
         u_char *data = NULL, *buf;          u_char *data;
         u_int dlen;          u_int dlen;
         int len;          int len;
   
Line 1462 
Line 1411 
         if (c->wfd != -1 &&          if (c->wfd != -1 &&
             FD_ISSET(c->wfd, writeset) &&              FD_ISSET(c->wfd, writeset) &&
             buffer_len(&c->output) > 0) {              buffer_len(&c->output) > 0) {
                 if (c->output_filter != NULL) {                  data = buffer_ptr(&c->output);
                         if ((buf = c->output_filter(c, &data, &dlen)) == NULL) {                  dlen = buffer_len(&c->output);
                                 debug2("channel %d: filter stops", c->self);                  len = write(c->wfd, data, dlen);
                                 if (c->type != SSH_CHANNEL_OPEN)  
                                         chan_mark_dead(c);  
                                 else  
                                         chan_write_failed(c);  
                                 return -1;  
                         }  
                 } else if (c->datagram) {  
                         buf = data = buffer_get_string(&c->output, &dlen);  
                 } else {  
                         buf = data = buffer_ptr(&c->output);  
                         dlen = buffer_len(&c->output);  
                 }  
   
                 if (c->datagram) {  
                         /* ignore truncated writes, datagrams might get lost */  
                         c->local_consumed += dlen + 4;  
                         len = write(c->wfd, buf, dlen);  
                         xfree(data);  
                         if (len < 0 && (errno == EINTR || errno == EAGAIN))  
                                 return 1;  
                         if (len <= 0) {  
                                 if (c->type != SSH_CHANNEL_OPEN)  
                                         chan_mark_dead(c);  
                                 else  
                                         chan_write_failed(c);  
                                 return -1;  
                         }  
                         return 1;  
                 }  
   
                 len = write(c->wfd, buf, dlen);  
                 if (len < 0 && (errno == EINTR || errno == EAGAIN))                  if (len < 0 && (errno == EINTR || errno == EAGAIN))
                         return 1;                          return 1;
                 if (len <= 0) {                  if (len <= 0) {
Line 1512 
Line 1430 
                         }                          }
                         return -1;                          return -1;
                 }                  }
                 if (compat20 && c->isatty && dlen >= 1 && buf[0] != '\r') {                  if (compat20 && c->isatty && dlen >= 1 && data[0] != '\r') {
                         if (tcgetattr(c->wfd, &tio) == 0 &&                          if (tcgetattr(c->wfd, &tio) == 0 &&
                             !(tio.c_lflag & ECHO) && (tio.c_lflag & ICANON)) {                              !(tio.c_lflag & ECHO) && (tio.c_lflag & ICANON)) {
                                 /*                                  /*
                                  * Simulate echo to reduce the impact of                                   * Simulate echo to reduce the impact of
                                  * traffic analysis. We need to match the                                   * traffic analysis. We need to match the
                                  * size of a SSH2_MSG_CHANNEL_DATA message                                   * size of a SSH2_MSG_CHANNEL_DATA message
                                  * (4 byte channel id + buf)                                   * (4 byte channel id + data)
                                  */                                   */
                                 packet_send_ignore(4 + len);                                  packet_send_ignore(4 + len);
                                 packet_send();                                  packet_send();
Line 1738 
Line 1656 
         if (c == NULL)          if (c == NULL)
                 return;                  return;
         if (c->detach_user != NULL) {          if (c->detach_user != NULL) {
                 if (!chan_is_dead(c, c->detach_close))                  if (!chan_is_dead(c, 0))
                         return;                          return;
                 debug2("channel %d: gc: notify user", c->self);                  debug2("channel %d: gc: notify user", c->self);
                 c->detach_user(c->self, NULL);                  c->detach_user(c->self, NULL);
Line 1848 
Line 1766 
                 if ((c->istate == CHAN_INPUT_OPEN ||                  if ((c->istate == CHAN_INPUT_OPEN ||
                     c->istate == CHAN_INPUT_WAIT_DRAIN) &&                      c->istate == CHAN_INPUT_WAIT_DRAIN) &&
                     (len = buffer_len(&c->input)) > 0) {                      (len = buffer_len(&c->input)) > 0) {
                         if (c->datagram) {  
                                 if (len > 0) {  
                                         u_char *data;  
                                         u_int dlen;  
   
                                         data = buffer_get_string(&c->input,  
                                             &dlen);  
                                         packet_start(SSH2_MSG_CHANNEL_DATA);  
                                         packet_put_int(c->remote_id);  
                                         packet_put_string(data, dlen);  
                                         packet_send();  
                                         c->remote_window -= dlen + 4;  
                                         xfree(data);  
                                 }  
                                 continue;  
                         }  
                         /*                          /*
                          * Send some data for the other side over the secure                           * Send some data for the other side over the secure
                          * connection.                           * connection.
Line 1901 
Line 1803 
                          * hack for extended data: delay EOF if EFD still in use.                           * hack for extended data: delay EOF if EFD still in use.
                          */                           */
                         if (CHANNEL_EFD_INPUT_ACTIVE(c))                          if (CHANNEL_EFD_INPUT_ACTIVE(c))
                                 debug2("channel %d: ibuf_empty delayed efd %d/(%d)",                                 debug2("channel %d: ibuf_empty delayed efd %d/(%d)",
                                     c->self, c->efd, buffer_len(&c->extended));                                     c->self, c->efd, buffer_len(&c->extended));
                         else                          else
                                 chan_ibuf_empty(c);                                  chan_ibuf_empty(c);
                 }                  }
Line 1986 
Line 1888 
                 c->local_window -= data_len;                  c->local_window -= data_len;
         }          }
         packet_check_eom();          packet_check_eom();
         if (c->datagram)          buffer_append(&c->output, data, data_len);
                 buffer_put_string(&c->output, data, data_len);  
         else  
                 buffer_append(&c->output, data, data_len);  
         xfree(data);          xfree(data);
 }  }
   
Line 2220 
Line 2119 
         id = packet_get_int();          id = packet_get_int();
         c = channel_lookup(id);          c = channel_lookup(id);
   
         if (c == NULL) {          if (c == NULL || c->type != SSH_CHANNEL_OPEN) {
                 logit("Received window adjust for non-open channel %d.", id);                  logit("Received window adjust for "
                       "non-open channel %d.", id);
                 return;                  return;
         }          }
         adjust = packet_get_int();          adjust = packet_get_int();
Line 2278 
Line 2178 
     const char *host_to_connect, u_short port_to_connect, int gateway_ports)      const char *host_to_connect, u_short port_to_connect, int gateway_ports)
 {  {
         Channel *c;          Channel *c;
         int sock, r, success = 0, wildcard = 0, is_client;          int sock, r, success = 0, on = 1, wildcard = 0, is_client;
         struct addrinfo hints, *ai, *aitop;          struct addrinfo hints, *ai, *aitop;
         const char *host, *addr;          const char *host, *addr;
         char ntop[NI_MAXHOST], strport[NI_MAXSERV];          char ntop[NI_MAXHOST], strport[NI_MAXSERV];
Line 2289 
Line 2189 
   
         if (host == NULL) {          if (host == NULL) {
                 error("No forward host name.");                  error("No forward host name.");
                 return 0;                  return success;
         }          }
         if (strlen(host) > SSH_CHANNEL_PATH_LEN - 1) {          if (strlen(host) > SSH_CHANNEL_PATH_LEN - 1) {
                 error("Forward host name too long.");                  error("Forward host name too long.");
                 return 0;                  return success;
         }          }
   
         /*          /*
Line 2344 
Line 2244 
                         packet_disconnect("getaddrinfo: fatal error: %s",                          packet_disconnect("getaddrinfo: fatal error: %s",
                             gai_strerror(r));                              gai_strerror(r));
                 } else {                  } else {
                         error("channel_setup_fwd_listener: "                          verbose("channel_setup_fwd_listener: "
                             "getaddrinfo(%.64s): %s", addr, gai_strerror(r));                              "getaddrinfo(%.64s): %s", addr, gai_strerror(r));
                           packet_send_debug("channel_setup_fwd_listener: "
                               "getaddrinfo(%.64s): %s", addr, gai_strerror(r));
                 }                  }
                 return 0;                  aitop = NULL;
         }          }
   
         for (ai = aitop; ai; ai = ai->ai_next) {          for (ai = aitop; ai; ai = ai->ai_next) {
Line 2365 
Line 2267 
                         verbose("socket: %.100s", strerror(errno));                          verbose("socket: %.100s", strerror(errno));
                         continue;                          continue;
                 }                  }
                   /*
                    * Set socket options.
                    * Allow local port reuse in TIME_WAIT.
                    */
                   if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &on,
                       sizeof(on)) == -1)
                           error("setsockopt SO_REUSEADDR: %s", strerror(errno));
   
                 channel_set_reuseaddr(sock);  
   
                 debug("Local forwarding listening on %s port %s.", ntop, strport);                  debug("Local forwarding listening on %s port %s.", ntop, strport);
   
                 /* Bind the socket to the address. */                  /* Bind the socket to the address. */
Line 2534 
Line 2441 
   
         permitted_opens[i].listen_port = 0;          permitted_opens[i].listen_port = 0;
         permitted_opens[i].port_to_connect = 0;          permitted_opens[i].port_to_connect = 0;
         xfree(permitted_opens[i].host_to_connect);          free(permitted_opens[i].host_to_connect);
         permitted_opens[i].host_to_connect = NULL;          permitted_opens[i].host_to_connect = NULL;
 }  }
   
Line 2738 
Line 2645 
  */   */
 int  int
 x11_create_display_inet(int x11_display_offset, int x11_use_localhost,  x11_create_display_inet(int x11_display_offset, int x11_use_localhost,
     int single_connection, u_int *display_numberp, int **chanids)      int single_connection, u_int *display_numberp)
 {  {
         Channel *nc = NULL;          Channel *nc = NULL;
         int display_number, sock;          int display_number, sock;
Line 2747 
Line 2654 
         char strport[NI_MAXSERV];          char strport[NI_MAXSERV];
         int gaierr, n, num_socks = 0, socks[NUM_SOCKS];          int gaierr, n, num_socks = 0, socks[NUM_SOCKS];
   
         if (chanids == NULL)  
                 return -1;  
   
         for (display_number = x11_display_offset;          for (display_number = x11_display_offset;
             display_number < MAX_DISPLAYS;              display_number < MAX_DISPLAYS;
             display_number++) {              display_number++) {
Line 2773 
Line 2677 
                                 freeaddrinfo(aitop);                                  freeaddrinfo(aitop);
                                 return -1;                                  return -1;
                         }                          }
                         channel_set_reuseaddr(sock);  
                         if (bind(sock, ai->ai_addr, ai->ai_addrlen) < 0) {                          if (bind(sock, ai->ai_addr, ai->ai_addrlen) < 0) {
                                 debug2("bind port %d: %.100s", port, strerror(errno));                                  debug2("bind port %d: %.100s", port, strerror(errno));
                                 close(sock);                                  close(sock);
Line 2810 
Line 2713 
         }          }
   
         /* Allocate a channel for each socket. */          /* Allocate a channel for each socket. */
         *chanids = xmalloc(sizeof(**chanids) * (num_socks + 1));  
         for (n = 0; n < num_socks; n++) {          for (n = 0; n < num_socks; n++) {
                 sock = socks[n];                  sock = socks[n];
                 nc = channel_new("x11 listener",                  nc = channel_new("x11 listener",
Line 2818 
Line 2720 
                     CHAN_X11_WINDOW_DEFAULT, CHAN_X11_PACKET_DEFAULT,                      CHAN_X11_WINDOW_DEFAULT, CHAN_X11_PACKET_DEFAULT,
                     0, "X11 inet listener", 1);                      0, "X11 inet listener", 1);
                 nc->single_connection = single_connection;                  nc->single_connection = single_connection;
                 (*chanids)[n] = nc->self;  
         }          }
         (*chanids)[n] = -1;  
   
         /* Return the display number for the DISPLAY environment variable. */          /* Return the display number for the DISPLAY environment variable. */
         *display_numberp = display_number;          *display_numberp = display_number;
Line 3006 
Line 2906 
                 error("deny_input_open: type %d", type);                  error("deny_input_open: type %d", type);
                 break;                  break;
         }          }
         error("Warning: this is probably a break-in attempt by a malicious server.");          error("Warning: this is probably a break in attempt by a malicious server.");
         packet_start(SSH_MSG_CHANNEL_OPEN_FAILURE);          packet_start(SSH_MSG_CHANNEL_OPEN_FAILURE);
         packet_put_int(rchan);          packet_put_int(rchan);
         packet_send();          packet_send();
Line 3022 
Line 2922 
     const char *proto, const char *data)      const char *proto, const char *data)
 {  {
         u_int data_len = (u_int) strlen(data) / 2;          u_int data_len = (u_int) strlen(data) / 2;
         u_int i, value;          u_int i, value, len;
         char *new_data;          char *new_data;
         int screen_number;          int screen_number;
         const char *cp;          const char *cp;
         u_int32_t rnd = 0;          u_int32_t rnd = 0;
   
         if (x11_saved_display == NULL)  
                 x11_saved_display = xstrdup(disp);  
         else if (strcmp(disp, x11_saved_display) != 0) {  
                 error("x11_request_forwarding_with_spoofing: different "  
                     "$DISPLAY already forwarded");  
                 return;  
         }  
   
         cp = disp;          cp = disp;
         if (disp)          if (disp)
                 cp = strchr(disp, ':');                  cp = strchr(disp, ':');
Line 3046 
Line 2938 
         else          else
                 screen_number = 0;                  screen_number = 0;
   
         if (x11_saved_proto == NULL) {          /* Save protocol name. */
                 /* Save protocol name. */          x11_saved_proto = xstrdup(proto);
                 x11_saved_proto = xstrdup(proto);  
                 /*          /*
                  * Extract real authentication data and generate fake data           * Extract real authentication data and generate fake data of the
                  * of the same length.           * same length.
                  */           */
                 x11_saved_data = xmalloc(data_len);          x11_saved_data = xmalloc(data_len);
                 x11_fake_data = xmalloc(data_len);          x11_fake_data = xmalloc(data_len);
                 for (i = 0; i < data_len; i++) {          for (i = 0; i < data_len; i++) {
                         if (sscanf(data + 2 * i, "%2x", &value) != 1)                  if (sscanf(data + 2 * i, "%2x", &value) != 1)
                                 fatal("x11_request_forwarding: bad "                          fatal("x11_request_forwarding: bad authentication data: %.100s", data);
                                     "authentication data: %.100s", data);                  if (i % 4 == 0)
                         if (i % 4 == 0)                          rnd = arc4random();
                                 rnd = arc4random();                  x11_saved_data[i] = value;
                         x11_saved_data[i] = value;                  x11_fake_data[i] = rnd & 0xff;
                         x11_fake_data[i] = rnd & 0xff;                  rnd >>= 8;
                         rnd >>= 8;  
                 }  
                 x11_saved_data_len = data_len;  
                 x11_fake_data_len = data_len;  
         }          }
           x11_saved_data_len = data_len;
           x11_fake_data_len = data_len;
   
         /* Convert the fake data into hex. */          /* Convert the fake data into hex. */
         new_data = tohex(x11_fake_data, data_len);          len = 2 * data_len + 1;
           new_data = xmalloc(len);
           for (i = 0; i < data_len; i++)
                   snprintf(new_data + 2 * i, len - 2 * i,
                       "%02x", (u_char) x11_fake_data[i]);
   
         /* Send the request packet. */          /* Send the request packet. */
         if (compat20) {          if (compat20) {

Legend:
Removed from v.1.214.2.2  
changed lines
  Added in v.1.215