Changeset 1289:8bb644107e21 in roaraudio
- Timestamp:
- 03/12/09 01:49:00 (15 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libroar/sshaskpass.c
r1288 r1289 37 37 int roar_sshaskpass_getpass (char ** pw, char * desc) { 38 38 #ifdef ROAR_HAVE_BIN_SSH_ASKPASS 39 FILE * pipe; 39 FILE * cpipe; 40 char buf[1024]; 41 int pos; 40 42 41 if ( (pipe = popen(ROAR_HAVE_BIN_SSH_ASKPASS, "r")) == NULL ) { 43 if ( pw == NULL ) 44 return -1; 45 46 if ( (cpipe = popen(ROAR_HAVE_BIN_SSH_ASKPASS, "r")) == NULL ) { 42 47 return -1; 43 48 } 44 49 45 fclose(pipe); 50 if ( fgets(buf, 1024, cpipe) == NULL ) { 51 fclose(cpipe); 52 return -1; 53 } 54 55 fclose(cpipe); 56 57 pos = strlen(buf); 58 59 for (; pos > -1 && (buf[pos] == '\r' || buf[pos] == '\n'); pos--) 60 buf[pos] = 0; 61 62 if ( pos == 0 ) 63 return -1; 64 65 *pw = strdup(buf); 66 67 return 0; 46 68 #else 47 69 return -1;
Note: See TracChangeset
for help on using the changeset viewer.