From 386bacd9741639d7f5e83c81628d3cad78407197 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Fri, 17 May 2019 13:40:24 +0200 Subject: 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 --- g10/plaintext.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'g10/plaintext.c') diff --git a/g10/plaintext.c b/g10/plaintext.c index c5d1ddb7f..f9e0a4296 100644 --- a/g10/plaintext.c +++ b/g10/plaintext.c @@ -70,7 +70,8 @@ get_output_file (const byte *embedded_name, int embedded_namelen, goto leave; } } - else if (opt.outfile) + else if (opt.outfile + && !(opt.flags.use_embedded_filename && opt.flags.dummy_outfile)) { fname = xtrystrdup (opt.outfile); if (!fname) -- cgit v1.2.3