mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-03 12:11:33 +01:00
tools/gpgtar: Handle '--gpg' argument.
* tools/gpgtar-create.c (gpgtar_create): Use given gpg program. * tools/gpgtar-extract.c (gpgtar_extract): Likewise. * tools/gpgtar-list.c (gpgtar_list): Likewise. * tools/gpgtar.c (enum cmd_and_opt_values): New constant. (opts): Add argument. (main): Handle argument. * tools/gpgtar.h (opt): Add field 'gpg_program'. Signed-off-by: Justus Winter <justus@g10code.com>
This commit is contained in:
parent
f76fb047c1
commit
89e104eb38
@ -892,7 +892,8 @@ gpgtar_create (char **inpattern, int encrypt)
|
||||
if (err)
|
||||
goto leave;
|
||||
|
||||
err = gpg_encrypt_stream (NULL, NULL,
|
||||
err = gpg_encrypt_stream (NULL,
|
||||
opt.gpg_program,
|
||||
outstream,
|
||||
opt.recipients,
|
||||
cipher_stream);
|
||||
|
@ -303,7 +303,7 @@ gpgtar_extract (const char *filename, int decrypt)
|
||||
err = gpg_error_from_syserror ();
|
||||
goto leave;
|
||||
}
|
||||
err = gpg_decrypt_stream (NULL, NULL, cipher_stream, stream);
|
||||
err = gpg_decrypt_stream (NULL, opt.gpg_program, cipher_stream, stream);
|
||||
if (err)
|
||||
goto leave;
|
||||
|
||||
|
@ -306,7 +306,7 @@ gpgtar_list (const char *filename, int decrypt)
|
||||
err = gpg_error_from_syserror ();
|
||||
goto leave;
|
||||
}
|
||||
err = gpg_decrypt_stream (NULL, NULL, cipher_stream, stream);
|
||||
err = gpg_decrypt_stream (NULL, opt.gpg_program, cipher_stream, stream);
|
||||
if (err)
|
||||
goto leave;
|
||||
|
||||
|
@ -64,6 +64,7 @@ enum cmd_and_opt_values
|
||||
oNoVerbose = 500,
|
||||
|
||||
aSignEncrypt,
|
||||
oGpgProgram,
|
||||
oSkipCrypto,
|
||||
oOpenPGP,
|
||||
oCMS,
|
||||
@ -90,6 +91,7 @@ static ARGPARSE_OPTS opts[] = {
|
||||
ARGPARSE_s_s (oOutput, "output", N_("|FILE|write output to FILE")),
|
||||
ARGPARSE_s_n (oVerbose, "verbose", N_("verbose")),
|
||||
ARGPARSE_s_n (oQuiet, "quiet", N_("be somewhat more quiet")),
|
||||
ARGPARSE_s_s (oGpgProgram, "gpg", "@"),
|
||||
ARGPARSE_s_n (oSkipCrypto, "skip-crypto", N_("skip the crypto processing")),
|
||||
ARGPARSE_s_s (oSetFilename, "set-filename", "@"),
|
||||
ARGPARSE_s_s (oFilesFrom, "files-from",
|
||||
@ -221,6 +223,10 @@ main (int argc, char **argv)
|
||||
opt.symmetric = 1;
|
||||
break;
|
||||
|
||||
case oGpgProgram:
|
||||
opt.gpg_program = pargs.r.ret_str;
|
||||
break;
|
||||
|
||||
case oSkipCrypto:
|
||||
skip_crypto = 1;
|
||||
break;
|
||||
|
@ -29,6 +29,7 @@ struct
|
||||
int verbose;
|
||||
unsigned int debug_level;
|
||||
int quiet;
|
||||
const char *gpg_program;
|
||||
const char *outfile;
|
||||
strlist_t recipients;
|
||||
const char *user;
|
||||
|
Loading…
x
Reference in New Issue
Block a user