From b389e04ef5260628bfd8002e20873114a3d4fa4b Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Wed, 6 Nov 2024 16:09:18 +0100 Subject: [PATCH] gpgtar: Use log-file from common.conf only in --batch mode. * tools/gpgtar.c (main): Do it. -- This makes the interactive use of gpgtar more convenient and is more aligned to what gpg and gpgsm do. --- doc/tools.texi | 3 ++- tools/gpgtar.c | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/doc/tools.texi b/doc/tools.texi index 6e95a81a3..7186c362a 100644 --- a/doc/tools.texi +++ b/doc/tools.texi @@ -2060,7 +2060,8 @@ implemented. @item --batch @opindex batch Use batch mode. Never ask but use the default action. This option is -passed directly to @command{gpg}. +passed directly to @command{gpg}. This option is also required to +activate the @option{log-file} in @file{common.conf} for this program. @item --yes @opindex yes diff --git a/tools/gpgtar.c b/tools/gpgtar.c index 3e4d135f0..4a169ac17 100644 --- a/tools/gpgtar.c +++ b/tools/gpgtar.c @@ -496,8 +496,11 @@ main (int argc, char **argv) if (log_get_errorcount (0)) exit (2); - /* Get a log file from common.conf. */ - if (!parse_comopt (GNUPG_MODULE_NAME_GPGTAR, any_debug) && comopt.logfile) + /* Get a log file from common.conf but use it only in --batch mode + * because people expect to see the verbose output here even if they + * have a log-file in their common.conf. */ + if (!parse_comopt (GNUPG_MODULE_NAME_GPGTAR, any_debug) && comopt.logfile + && opt.batch) log_set_file (comopt.logfile); /* Print a warning if an argument looks like an option. */