[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.3 and 1.4

version 1.3, 1999/09/30 08:34:25 version 1.4, 1999/10/11 20:24:54
Line 57 
Line 57 
       f = fopen("/dev/tty", "r");        f = fopen("/dev/tty", "r");
       if (!f)        if (!f)
         {          {
           if (getenv("DISPLAY"))  
             {  
               char command[512];  
               fprintf(stderr,  
                       "Executing ssh-askpass to query the password...\n");  
               fflush(stdout);  
               fflush(stderr);  
               sprintf(command, "ssh-askpass '%.400s'", prompt);  
               f = popen(command, "r");  
               if (!fgets(buf, sizeof(buf), f))  
                 {  
                   pclose(f);  
                   fprintf(stderr, "No passphrase supplied.  Exiting.\n");  
                   exit(1);  
                 }  
               pclose(f);  
               if (strchr(buf, '\n'))  
                 *strchr(buf, '\n') = 0;  
               return xstrdup(buf);  
             }  
   
           /* No controlling terminal and no DISPLAY.  Nowhere to read. */            /* No controlling terminal and no DISPLAY.  Nowhere to read. */
           fprintf(stderr, "You have no controlling tty and no DISPLAY.  Cannot read passphrase.\n");            fprintf(stderr, "You have no controlling tty and no DISPLAY.  Cannot read passphrase.\n");
           exit(1);            exit(1);

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4