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

Diff for /src/usr.bin/ssh/ssh.c between version 1.129 and 1.130

version 1.129, 2001/07/11 16:29:59 version 1.130, 2001/07/25 14:35:18
Line 244 
Line 244 
 int  int
 main(int ac, char **av)  main(int ac, char **av)
 {  {
         int i, opt, exit_status, ok;          int i, opt, exit_status, cerr;
         u_short fwd_port, fwd_host_port;          u_short fwd_port, fwd_host_port;
         char *p, *cp, buf[256];          char *p, *cp, buf[256];
         struct stat st;          struct stat st;
Line 642 
Line 642 
   
         /* Open a connection to the remote host. */          /* Open a connection to the remote host. */
   
         ok = ssh_connect(host, &hostaddr, options.port,          cerr = ssh_connect(host, &hostaddr, options.port,
             options.connection_attempts,              options.connection_attempts,
             original_effective_uid != 0 || !options.use_privileged_port,              original_effective_uid != 0 || !options.use_privileged_port,
             pw, options.proxy_command);              pw, options.proxy_command);
Line 655 
Line 655 
          */           */
         sensitive_data.nkeys = 0;          sensitive_data.nkeys = 0;
         sensitive_data.keys = NULL;          sensitive_data.keys = NULL;
         if (ok && (options.rhosts_rsa_authentication ||          if (!cerr && (options.rhosts_rsa_authentication ||
             options.hostbased_authentication)) {              options.hostbased_authentication)) {
                 sensitive_data.nkeys = 3;                  sensitive_data.nkeys = 3;
                 sensitive_data.keys = xmalloc(sensitive_data.nkeys*sizeof(Key));                  sensitive_data.keys = xmalloc(sensitive_data.nkeys*sizeof(Key));
Line 693 
Line 693 
                         error("Could not create directory '%.200s'.", buf);                          error("Could not create directory '%.200s'.", buf);
   
         /* Check if the connection failed, and try "rsh" if appropriate. */          /* Check if the connection failed, and try "rsh" if appropriate. */
         if (!ok) {          if (cerr) {
                   if (!options.fallback_to_rsh)
                           exit(1);
                 if (options.port != 0)                  if (options.port != 0)
                         log("Secure connection to %.100s on port %hu refused%.100s.",                          log("Secure connection to %.100s on port %hu refused; "
                             host, options.port,                              "reverting to insecure method",
                             options.fallback_to_rsh ? "; reverting to insecure method" : "");                              host, options.port);
                 else                  else
                         log("Secure connection to %.100s refused%.100s.", host,                          log("Secure connection to %.100s refused; "
                             options.fallback_to_rsh ? "; reverting to insecure method" : "");                              "reverting to insecure method.", host);
   
                 if (options.fallback_to_rsh) {                  rsh_connect(host, options.user, &command);
                         rsh_connect(host, options.user, &command);                  fatal("rsh_connect returned");
                         fatal("rsh_connect returned");  
                 }  
                 exit(1);  
         }          }
         /* load options.identity_files */          /* load options.identity_files */
         load_public_identity_files();          load_public_identity_files();

Legend:
Removed from v.1.129  
changed lines
  Added in v.1.130