[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.66 and 1.67

version 1.66, 2001/04/29 19:16:52 version 1.67, 2001/05/04 23:47:34
Line 1027 
Line 1027 
         Channel* c = NULL;          Channel* c = NULL;
         char *listen_address, *originator_address;          char *listen_address, *originator_address;
         int listen_port, originator_port;          int listen_port, originator_port;
         int sock, newch;          int sock;
   
         /* Get rest of the packet */          /* Get rest of the packet */
         listen_address = packet_get_string(NULL);          listen_address = packet_get_string(NULL);
Line 1040 
Line 1040 
             listen_address, listen_port, originator_address, originator_port);              listen_address, listen_port, originator_address, originator_port);
   
         sock = channel_connect_by_listen_adress(listen_port);          sock = channel_connect_by_listen_adress(listen_port);
         if (sock >= 0) {          if (sock < 0) {
                 newch = channel_new("forwarded-tcpip",                  xfree(originator_address);
                     SSH_CHANNEL_CONNECTING, sock, sock, -1,                  xfree(listen_address);
                     CHAN_TCP_WINDOW_DEFAULT, CHAN_TCP_WINDOW_DEFAULT, 0,                  return NULL;
                     xstrdup(originator_address), 1);  
                 c = channel_lookup(newch);  
         }          }
           c = channel_new("forwarded-tcpip",
               SSH_CHANNEL_CONNECTING, sock, sock, -1,
               CHAN_TCP_WINDOW_DEFAULT, CHAN_TCP_WINDOW_DEFAULT, 0,
               xstrdup(originator_address), 1);
           if (c == NULL) {
                   error("client_request_forwarded_tcpip: channel_new failed");
                   close(sock);
           }
         xfree(originator_address);          xfree(originator_address);
         xfree(listen_address);          xfree(listen_address);
         return c;          return c;
Line 1058 
Line 1064 
         Channel *c = NULL;          Channel *c = NULL;
         char *originator;          char *originator;
         int originator_port;          int originator_port;
         int sock, newch;          int sock;
   
         if (!options.forward_x11) {          if (!options.forward_x11) {
                 error("Warning: ssh server tried X11 forwarding.");                  error("Warning: ssh server tried X11 forwarding.");
Line 1076 
Line 1082 
         /* XXX check permission */          /* XXX check permission */
         debug("client_request_x11: request from %s %d", originator,          debug("client_request_x11: request from %s %d", originator,
             originator_port);              originator_port);
           xfree(originator);
         sock = x11_connect_display();          sock = x11_connect_display();
         if (sock >= 0) {          if (sock < 0)
                 newch = channel_new("x11",                  return NULL;
                     SSH_CHANNEL_X11_OPEN, sock, sock, -1,          c = channel_new("x11",
                     CHAN_TCP_WINDOW_DEFAULT, CHAN_X11_PACKET_DEFAULT, 0,              SSH_CHANNEL_X11_OPEN, sock, sock, -1,
                     xstrdup("x11"), 1);              CHAN_TCP_WINDOW_DEFAULT, CHAN_X11_PACKET_DEFAULT, 0,
                 c = channel_lookup(newch);              xstrdup("x11"), 1);
           if (c == NULL) {
                   error("client_request_x11: channel_new failed");
                   close(sock);
         }          }
         xfree(originator);  
         return c;          return c;
 }  }
   
Line 1092 
Line 1101 
 client_request_agent(const char *request_type, int rchan)  client_request_agent(const char *request_type, int rchan)
 {  {
         Channel *c = NULL;          Channel *c = NULL;
         int sock, newch;          int sock;
   
         if (!options.forward_agent) {          if (!options.forward_agent) {
                 error("Warning: ssh server tried agent forwarding.");                  error("Warning: ssh server tried agent forwarding.");
Line 1100 
Line 1109 
                 return NULL;                  return NULL;
         }          }
         sock =  ssh_get_authentication_socket();          sock =  ssh_get_authentication_socket();
         if (sock >= 0) {          if (sock < 0)
                 newch = channel_new("authentication agent connection",                  return NULL;
                     SSH_CHANNEL_OPEN, sock, sock, -1,          c = channel_new("authentication agent connection",
                     CHAN_X11_WINDOW_DEFAULT, CHAN_TCP_WINDOW_DEFAULT, 0,              SSH_CHANNEL_OPEN, sock, sock, -1,
                     xstrdup("authentication agent connection"), 1);              CHAN_X11_WINDOW_DEFAULT, CHAN_TCP_WINDOW_DEFAULT, 0,
                 c = channel_lookup(newch);              xstrdup("authentication agent connection"), 1);
           if (c == NULL) {
                   error("client_request_agent: channel_new failed");
                   close(sock);
         }          }
         return c;          return c;
 }  }

Legend:
Removed from v.1.66  
changed lines
  Added in v.1.67