[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.306 and 1.307

version 1.306, 2018/10/15 11:28:50 version 1.307, 2018/11/16 06:17:38
Line 65 
Line 65 
 static pid_t proxy_command_pid = 0;  static pid_t proxy_command_pid = 0;
   
 /* import */  /* import */
   extern int debug_flag;
 extern Options options;  extern Options options;
 extern char *__progname;  extern char *__progname;
   
Line 86 
Line 87 
         return ret;          return ret;
 }  }
   
   static void
   stderr_null(void)
   {
           int devnull;
   
           if ((devnull = open(_PATH_DEVNULL, O_WRONLY)) == -1) {
                   error("Can't open %s for stderr redirection: %s",
                       _PATH_DEVNULL, strerror(errno));
                   return;
           }
           if (devnull == STDERR_FILENO)
                   return;
           if (dup2(devnull, STDERR_FILENO) == -1)
                   error("Cannot redirect stderr to %s", _PATH_DEVNULL);
           if (devnull > STDERR_FILENO)
                   close(devnull);
   }
   
 /*  /*
  * Connect to the given ssh server using a proxy command that passes a   * Connect to the given ssh server using a proxy command that passes a
  * a connected fd back to us.   * a connected fd back to us.
Line 128 
Line 147 
                         close(sp[0]);                          close(sp[0]);
   
                 /*                  /*
                  * Stderr is left as it is so that error messages get                   * Stderr is left for non-ControlPersist connections is so
                  * printed on the user's terminal.                   * error messages may be printed on the user's terminal.
                  */                   */
                   if (debug_flag || !options.control_persist)
                           stderr_null();
   
                 argv[0] = shell;                  argv[0] = shell;
                 argv[1] = "-c";                  argv[1] = "-c";
                 argv[2] = command_string;                  argv[2] = command_string;
Line 206 
Line 228 
                 /* Cannot be 1 because pin allocated two descriptors. */                  /* Cannot be 1 because pin allocated two descriptors. */
                 close(pout[1]);                  close(pout[1]);
   
                 /* Stderr is left as it is so that error messages get                  /*
                    printed on the user's terminal. */                   * Stderr is left for non-ControlPersist connections is so
                    * error messages may be printed on the user's terminal.
                    */
                   if (debug_flag || !options.control_persist)
                           stderr_null();
   
                 argv[0] = shell;                  argv[0] = shell;
                 argv[1] = "-c";                  argv[1] = "-c";
                 argv[2] = command_string;                  argv[2] = command_string;

Legend:
Removed from v.1.306  
changed lines
  Added in v.1.307