diff options
author | Werner Koch <[email protected]> | 2019-05-17 11:40:24 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2019-05-17 11:40:24 +0000 |
commit | 386bacd9741639d7f5e83c81628d3cad78407197 (patch) | |
tree | b2b4e5c69c837a69eab9ff001a839cbf6e4f3678 /g10/decrypt.c | |
parent | gpg: Improve the photo image viewer selection. (diff) | |
download | gnupg-386bacd9741639d7f5e83c81628d3cad78407197.tar.gz gnupg-386bacd9741639d7f5e83c81628d3cad78407197.zip |
gpg: Fix using --decrypt along with --use-embedded-filename.
* g10/options.h (opt): Add flags.dummy_outfile.
* g10/decrypt.c (decrypt_message): Set this global flag instead of the
fucntion local flag.
* g10/plaintext.c (get_output_file): Ignore opt.output if that was
used as a dummy option aslong with --use-embedded-filename.
--
The problem here was that an explicit specified --decrypt, as
meanwhile suggested, did not work with that dangerous
--use-embedded-filename. In contrast it worked when gpg decrypted as
a side-effect of parsing the data.
GnuPG-bug-id: 4500
Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'g10/decrypt.c')
-rw-r--r-- | g10/decrypt.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/g10/decrypt.c b/g10/decrypt.c index 4d6734d40..9589aff58 100644 --- a/g10/decrypt.c +++ b/g10/decrypt.c @@ -48,7 +48,6 @@ decrypt_message (ctrl_t ctrl, const char *filename) armor_filter_context_t *afx = NULL; progress_filter_context_t *pfx; int rc; - int no_out = 0; pfx = new_progress_context (); @@ -82,11 +81,13 @@ decrypt_message (ctrl_t ctrl, const char *filename) if (!opt.outfile) { - no_out = 1; opt.outfile = "-"; + opt.flags.dummy_outfile = 1; } + else + opt.flags.dummy_outfile = 0; rc = proc_encryption_packets (ctrl, NULL, fp ); - if (no_out) + if (opt.flags.dummy_outfile) opt.outfile = NULL; iobuf_close (fp); |