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

Diff for /src/usr.bin/ssh/readconf.c between version 1.242 and 1.243

version 1.242, 2015/10/07 15:59:12 version 1.243, 2015/10/25 23:14:03
Line 430 
Line 430 
 static int  static int
 execute_in_shell(const char *cmd)  execute_in_shell(const char *cmd)
 {  {
         char *shell, *command_string;          char *shell;
         pid_t pid;          pid_t pid;
         int devnull, status;          int devnull, status;
         extern uid_t original_real_uid;          extern uid_t original_real_uid;
Line 438 
Line 438 
         if ((shell = getenv("SHELL")) == NULL)          if ((shell = getenv("SHELL")) == NULL)
                 shell = _PATH_BSHELL;                  shell = _PATH_BSHELL;
   
         /*  
          * Use "exec" to avoid "sh -c" processes on some platforms  
          * (e.g. Solaris)  
          */  
         xasprintf(&command_string, "exec %s", cmd);  
   
         /* Need this to redirect subprocess stdin/out */          /* Need this to redirect subprocess stdin/out */
         if ((devnull = open(_PATH_DEVNULL, O_RDWR)) == -1)          if ((devnull = open(_PATH_DEVNULL, O_RDWR)) == -1)
                 fatal("open(/dev/null): %s", strerror(errno));                  fatal("open(/dev/null): %s", strerror(errno));
Line 468 
Line 462 
   
                 argv[0] = shell;                  argv[0] = shell;
                 argv[1] = "-c";                  argv[1] = "-c";
                 argv[2] = command_string;                  argv[2] = cmd;
                 argv[3] = NULL;                  argv[3] = NULL;
   
                 execv(argv[0], argv);                  execv(argv[0], argv);
Line 483 
Line 477 
                 fatal("%s: fork: %.100s", __func__, strerror(errno));                  fatal("%s: fork: %.100s", __func__, strerror(errno));
   
         close(devnull);          close(devnull);
         free(command_string);  
   
         while (waitpid(pid, &status, 0) == -1) {          while (waitpid(pid, &status, 0) == -1) {
                 if (errno != EINTR && errno != EAGAIN)                  if (errno != EINTR && errno != EAGAIN)

Legend:
Removed from v.1.242  
changed lines
  Added in v.1.243