[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.466 and 1.467

version 1.466, 2017/10/23 05:08:00 version 1.467, 2017/10/25 00:21:37
Line 1767 
Line 1767 
 static int  static int
 ssh_session2(struct ssh *ssh, struct passwd *pw)  ssh_session2(struct ssh *ssh, struct passwd *pw)
 {  {
         int id = -1;          int devnull, id = -1;
         char *cp, *tun_fwd_ifname = NULL;          char *cp, *tun_fwd_ifname = NULL;
   
         /* XXX should be pre-session */          /* XXX should be pre-session */
Line 1849 
Line 1849 
         if (options.local_command != NULL &&          if (options.local_command != NULL &&
             options.permit_local_command)              options.permit_local_command)
                 ssh_local_cmd(options.local_command);                  ssh_local_cmd(options.local_command);
   
           /*
            * stdout is now owned by the session channel; clobber it here
            * so future channel closes are propagated to the local fd.
            * NB. this can only happen after LocalCommand has completed,
            * as it may want to write to stdout.
            */
           if ((devnull = open(_PATH_DEVNULL, O_WRONLY)) == -1)
                   error("%s: open %s: %s", __func__,
                       _PATH_DEVNULL, strerror(errno));
           if (dup2(devnull, STDOUT_FILENO) < 0)
                   fatal("%s: dup2() stdout failed", __func__);
           if (devnull > STDERR_FILENO)
                   close(devnull);
   
         /*          /*
          * If requested and we are not interested in replies to remote           * If requested and we are not interested in replies to remote

Legend:
Removed from v.1.466  
changed lines
  Added in v.1.467