1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-02 22:46:30 +02:00

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: 40dbee86f3
This commit is contained in:
Werner Koch 2022-03-21 13:06:00 +01:00
parent 2f1afc1296
commit e5ef5e3b91
No known key found for this signature in database
GPG key ID: E3FDFF218E45B72B
6 changed files with 275 additions and 146 deletions

View file

@ -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. */