[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.345 and 1.346

version 1.345, 2010/08/04 05:42:47 version 1.346, 2010/08/12 21:49:44
Line 227 
Line 227 
         sanitise_stdfd();          sanitise_stdfd();
   
         /*          /*
            * Discard other fds that are hanging around. These can cause problem
            * with backgrounded ssh processes started by ControlPersist.
            */
           closefrom(STDERR_FILENO + 1);
   
           /*
          * Save the original real uid.  It will be needed later (uid-swapping           * Save the original real uid.  It will be needed later (uid-swapping
          * may clobber the real uid).           * may clobber the real uid).
          */           */
Line 879 
Line 885 
 control_persist_detach(void)  control_persist_detach(void)
 {  {
         pid_t pid;          pid_t pid;
           int devnull;
   
         debug("%s: backgrounding master process", __func__);          debug("%s: backgrounding master process", __func__);
   
Line 905 
Line 912 
                 /* muxclient() doesn't return on success. */                  /* muxclient() doesn't return on success. */
                 fatal("Failed to connect to new control master");                  fatal("Failed to connect to new control master");
         }          }
           if ((devnull = open(_PATH_DEVNULL, O_RDWR)) == -1) {
                   error("%s: open(\"/dev/null\"): %s", __func__,
                       strerror(errno));
           } else {
                   if (dup2(devnull, STDIN_FILENO) == -1 ||
                       dup2(devnull, STDOUT_FILENO) == -1)
                           error("%s: dup2: %s", __func__, strerror(errno));
                   if (devnull > STDERR_FILENO)
                           close(devnull);
           }
 }  }
   
 /* Do fork() after authentication. Used by "ssh -f" */  /* Do fork() after authentication. Used by "ssh -f" */

Legend:
Removed from v.1.345  
changed lines
  Added in v.1.346