Changeset 1266:75da91412f7f in roaraudio
- Timestamp:
- 02/27/09 04:07:18 (15 years ago)
- Branch:
- default
- Phase:
- public
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
include/libroar/vio_cmd.h
r1264 r1266 89 89 int roar_vio_open_gzip(struct roar_vio_calls * calls, struct roar_vio_calls * dst, int level); 90 90 91 int roar_vio_open_gpg(struct roar_vio_calls * calls, struct roar_vio_calls * dst, char * pw, int wronly, char * opts); 92 int roar_vio_open_pgp_decrypt(struct roar_vio_calls * calls, struct roar_vio_calls * dst, char * pw); 93 91 94 #endif 92 95 -
libroar/vio_cmd.c
r1264 r1266 374 374 } 375 375 376 int roar_vio_open_gpg(struct roar_vio_calls * calls, struct roar_vio_calls * dst, char * pw, int wronly, char * opts) { 377 #ifdef ROAR_HAVE_BIN_GPG 378 char command[1024]; 379 int pwpipe[2]; 380 int ret; 381 382 if ( pw != NULL ) { 383 if ( pipe(pwpipe) == -1 ) 384 return -1; 385 386 snprintf(command, 1024, "%s --no-verbose --quiet --passphrase-repeat 0 --passphrase-fd %i %s", ROAR_HAVE_BIN_GPG, pwpipe[0], opts); 387 388 write(pwpipe[1], pw, strlen(pw)); 389 390 close(pwpipe[1]); 391 } else { 392 snprintf(command, 1024, "%s --no-verbose --quiet %s", ROAR_HAVE_BIN_GPG, opts); 393 } 394 395 if ( wronly ) { 396 ret = roar_vio_open_cmd(calls, dst, NULL, command, 0); 397 } else { 398 ret = roar_vio_open_cmd(calls, dst, command, NULL, 0); 399 } 400 401 if ( pw != NULL ) 402 close(pwpipe[0]); 403 404 return ret; 405 #else 406 return -1; 407 #endif 408 } 409 410 int roar_vio_open_pgp_decrypt(struct roar_vio_calls * calls, struct roar_vio_calls * dst, char * pw) { 411 return roar_vio_open_gpg(calls, dst, pw, 0, "-d"); 412 } 413 414 376 415 //ll
Note: See TracChangeset
for help on using the changeset viewer.