[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.333 and 1.334

version 1.333, 2020/10/03 08:11:28 version 1.334, 2020/10/03 09:22:26
Line 93 
Line 93 
         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 157 
Line 139 
                  * error messages may be printed on the user's terminal.                   * error messages may be printed on the user's terminal.
                  */                   */
                 if (!debug_flag && options.control_path != NULL &&                  if (!debug_flag && options.control_path != NULL &&
                     options.control_persist)                      options.control_persist && stdfd_devnull(0, 0, 1) == -1)
                         stderr_null();                          error("%s: stdfd_devnull failed", __func__);
   
                 argv[0] = shell;                  argv[0] = shell;
                 argv[1] = "-c";                  argv[1] = "-c";
Line 240 
Line 222 
                  * error messages may be printed on the user's terminal.                   * error messages may be printed on the user's terminal.
                  */                   */
                 if (!debug_flag && options.control_path != NULL &&                  if (!debug_flag && options.control_path != NULL &&
                     options.control_persist)                      options.control_persist && stdfd_devnull(0, 0, 1) == -1)
                         stderr_null();                          error("%s: stdfd_devnull failed", __func__);
   
                 argv[0] = shell;                  argv[0] = shell;
                 argv[1] = "-c";                  argv[1] = "-c";

Legend:
Removed from v.1.333  
changed lines
  Added in v.1.334