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

Diff for /src/usr.bin/ssh/sshconnect.c between version 1.285 and 1.286

version 1.285, 2017/09/03 23:33:13 version 1.286, 2017/09/12 06:32:07
Line 93 
Line 93 
  * a connected fd back to us.   * a connected fd back to us.
  */   */
 static int  static int
 ssh_proxy_fdpass_connect(const char *host, u_short port,  ssh_proxy_fdpass_connect(struct ssh *ssh, const char *host, u_short port,
     const char *proxy_command)      const char *proxy_command)
 {  {
         char *command_string;          char *command_string;
Line 164 
Line 164 
                         fatal("Couldn't wait for child: %s", strerror(errno));                          fatal("Couldn't wait for child: %s", strerror(errno));
   
         /* Set the connection file descriptors. */          /* Set the connection file descriptors. */
         packet_set_connection(sock, sock);          if (ssh_packet_set_connection(ssh, sock, sock) == NULL)
                   return -1; /* ssh_packet_set_connection logs error */
   
         return 0;          return 0;
 }  }
Line 173 
Line 174 
  * Connect to the given ssh server using a proxy command.   * Connect to the given ssh server using a proxy command.
  */   */
 static int  static int
 ssh_proxy_connect(const char *host, u_short port, const char *proxy_command)  ssh_proxy_connect(struct ssh *ssh, const char *host, u_short port,
       const char *proxy_command)
 {  {
         char *command_string;          char *command_string;
         int pin[2], pout[2];          int pin[2], pout[2];
Line 240 
Line 242 
         free(command_string);          free(command_string);
   
         /* Set the connection file descriptors. */          /* Set the connection file descriptors. */
         packet_set_connection(pout[0], pin[1]);          if (ssh_packet_set_connection(ssh, pout[0], pin[1]) == NULL)
                   return -1; /* ssh_packet_set_connection logs error */
   
         /* Indicate OK return */  
         return 0;          return 0;
 }  }
   
Line 398 
Line 400 
  * the daemon.   * the daemon.
  */   */
 static int  static int
 ssh_connect_direct(const char *host, struct addrinfo *aitop,  ssh_connect_direct(struct ssh *ssh, const char *host, struct addrinfo *aitop,
     struct sockaddr_storage *hostaddr, u_short port, int family,      struct sockaddr_storage *hostaddr, u_short port, int family,
     int connection_attempts, int *timeout_ms, int want_keepalive, int needpriv)      int connection_attempts, int *timeout_ms, int want_keepalive, int needpriv)
 {  {
Line 472 
Line 474 
                 error("setsockopt SO_KEEPALIVE: %.100s", strerror(errno));                  error("setsockopt SO_KEEPALIVE: %.100s", strerror(errno));
   
         /* Set the connection. */          /* Set the connection. */
         packet_set_connection(sock, sock);          if (ssh_packet_set_connection(ssh, sock, sock) == NULL)
                   return -1; /* ssh_packet_set_connection logs error */
   
         return 0;          return 0;
 }  }
   
 int  int
 ssh_connect(const char *host, struct addrinfo *addrs,  ssh_connect(struct ssh *ssh, const char *host, struct addrinfo *addrs,
     struct sockaddr_storage *hostaddr, u_short port, int family,      struct sockaddr_storage *hostaddr, u_short port, int family,
     int connection_attempts, int *timeout_ms, int want_keepalive, int needpriv)      int connection_attempts, int *timeout_ms, int want_keepalive, int needpriv)
 {  {
         if (options.proxy_command == NULL) {          if (options.proxy_command == NULL) {
                 return ssh_connect_direct(host, addrs, hostaddr, port, family,                  return ssh_connect_direct(ssh, host, addrs, hostaddr, port,
                     connection_attempts, timeout_ms, want_keepalive, needpriv);                      family, connection_attempts, timeout_ms, want_keepalive,
                       needpriv);
         } else if (strcmp(options.proxy_command, "-") == 0) {          } else if (strcmp(options.proxy_command, "-") == 0) {
                 packet_set_connection(STDIN_FILENO, STDOUT_FILENO);                  if ((ssh_packet_set_connection(ssh,
                 return 0; /* Always succeeds */                      STDIN_FILENO, STDOUT_FILENO)) == NULL)
                           return -1; /* ssh_packet_set_connection logs error */
                   return 0;
         } else if (options.proxy_use_fdpass) {          } else if (options.proxy_use_fdpass) {
                 return ssh_proxy_fdpass_connect(host, port,                  return ssh_proxy_fdpass_connect(ssh, host, port,
                     options.proxy_command);                      options.proxy_command);
         }          }
         return ssh_proxy_connect(host, port, options.proxy_command);          return ssh_proxy_connect(ssh, host, port, options.proxy_command);
 }  }
   
 static void  static void

Legend:
Removed from v.1.285  
changed lines
  Added in v.1.286