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

Diff for /src/usr.bin/ssh/readpass.c between version 1.27 and 1.28

version 1.27, 2002/03/26 15:58:46 version 1.28, 2003/01/23 13:50:27
Line 48 
Line 48 
                 fatal("internal error: askpass undefined");                  fatal("internal error: askpass undefined");
         if (pipe(p) < 0) {          if (pipe(p) < 0) {
                 error("ssh_askpass: pipe: %s", strerror(errno));                  error("ssh_askpass: pipe: %s", strerror(errno));
                 return xstrdup("");                  return NULL;
         }          }
         if ((pid = fork()) < 0) {          if ((pid = fork()) < 0) {
                 error("ssh_askpass: fork: %s", strerror(errno));                  error("ssh_askpass: fork: %s", strerror(errno));
                 return xstrdup("");                  return NULL;
         }          }
         if (pid == 0) {          if (pid == 0) {
                 seteuid(getuid());                  seteuid(getuid());
Line 81 
Line 81 
                 if (errno != EINTR)                  if (errno != EINTR)
                         break;                          break;
   
           if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) {
                   memset(buf, 0, sizeof(buf));
                   return NULL;
           }
   
         buf[strcspn(buf, "\r\n")] = '\0';          buf[strcspn(buf, "\r\n")] = '\0';
         pass = xstrdup(buf);          pass = xstrdup(buf);
         memset(buf, 0, sizeof(buf));          memset(buf, 0, sizeof(buf));
Line 117 
Line 122 
                         askpass = getenv(SSH_ASKPASS_ENV);                          askpass = getenv(SSH_ASKPASS_ENV);
                 else                  else
                         askpass = _PATH_SSH_ASKPASS_DEFAULT;                          askpass = _PATH_SSH_ASKPASS_DEFAULT;
                 return ssh_askpass(askpass, prompt);                  if ((ret = ssh_askpass(askpass, prompt)) == NULL)
                           if (!(flags & RP_ALLOW_EOF))
                                   return xstrdup("");
                   return ret;
         }          }
   
         if (readpassphrase(prompt, buf, sizeof buf, rppflags) == NULL) {          if (readpassphrase(prompt, buf, sizeof buf, rppflags) == NULL) {

Legend:
Removed from v.1.27  
changed lines
  Added in v.1.28