diff options
| author | Werner Koch <[email protected]> | 2022-03-21 12:06:00 +0000 |
|---|---|---|
| committer | Werner Koch <[email protected]> | 2022-03-21 12:21:20 +0000 |
| commit | e5ef5e3b914d5c8f0b841b078b164500ea157804 (patch) | |
| tree | 5a30d08231a5f9fae6598ec3bd434dcaa5793662 /tools/gpgtar.c | |
| parent | common: Fix another race condition, and address the other one. (diff) | |
| download | gnupg-e5ef5e3b914d5c8f0b841b078b164500ea157804.tar.gz gnupg-e5ef5e3b914d5c8f0b841b078b164500ea157804.zip | |
gpgtar: Finally use a pipe for decryption.
* tools/gpgtar.h (opt): Add new flags.
* tools/gpgtar.c: new options --batch, --yes, --no, --status-fd, and
--require-compliance.
(main): Init signals.
* tools/gpgtar-create.c: Add new header files.
(gpgtar_create): Rework to use a pipe for encryption and signing.
* tools/gpgtar-list.c: Add new header files.
(gpgtar_list): Rework to use a pipe for decryption.
* tools/gpgtar-extract.c: Add new header files.
(gpgtar_extract): Rework to use a pipe for decryption.
--
Fixes-commit: 40dbee86f3043aff8a8c2055521e270318e33068
Diffstat (limited to 'tools/gpgtar.c')
| -rw-r--r-- | tools/gpgtar.c | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/tools/gpgtar.c b/tools/gpgtar.c index 57cac7c94..732a592fb 100644 --- a/tools/gpgtar.c +++ b/tools/gpgtar.c @@ -76,13 +76,19 @@ enum cmd_and_opt_values oNull, oUtf8Strings, + oBatch, + oAnswerYes, + oAnswerNo, + oStatusFD, + oRequireCompliance, + /* Compatibility with gpg-zip. */ oGpgArgs, oTarArgs, oTarProgram, /* Debugging. */ - oDryRun, + oDryRun }; @@ -113,6 +119,12 @@ static gpgrt_opt_t opts[] = { ARGPARSE_s_n (oOpenPGP, "openpgp", "@"), ARGPARSE_s_n (oCMS, "cms", "@"), + ARGPARSE_s_n (oBatch, "batch", "@"), + ARGPARSE_s_n (oAnswerYes, "yes", "@"), + ARGPARSE_s_n (oAnswerNo, "no", "@"), + ARGPARSE_s_i (oStatusFD, "status-fd", "@"), + ARGPARSE_s_n (oRequireCompliance, "require-compliance", "@"), + ARGPARSE_group (302, N_("@\nTar options:\n ")), ARGPARSE_s_s (oDirectory, "directory", @@ -374,6 +386,12 @@ parse_arguments (gpgrt_argparse_t *pargs, gpgrt_opt_t *popts) case oOpenPGP: /* Dummy option for now. */ break; case oCMS: /* Dummy option for now. */ break; + case oBatch: opt.batch = 1; break; + case oAnswerYes: opt.answer_yes = 1; break; + case oAnswerNo: opt.answer_no = 1; break; + case oStatusFD: opt.status_fd = pargs->r.ret_int; break; + case oRequireCompliance: opt.require_compliance = 1; break; + case oGpgArgs:; { strlist_t list; @@ -443,9 +461,13 @@ main (int argc, char **argv) /* Make sure that our subsystems are ready. */ i18n_init(); init_common_subsystems (&argc, &argv); + gnupg_init_signals (0, NULL); log_assert (sizeof (struct ustar_raw_header) == 512); + /* Set default options */ + opt.status_fd = -1; + /* Parse the command line. */ pargs.argc = &argc; pargs.argv = &argv; @@ -528,7 +550,7 @@ main (int argc, char **argv) /* Read the next record from STREAM. RECORD is a buffer provided by - the caller and must be at leadt of size RECORDSIZE. The function + the caller and must be at least of size RECORDSIZE. The function return 0 on success and error code on failure; a diagnostic printed as well. Note that there is no need for an EOF indicator because a tarball has an explicit EOF record. */ |
