mirror of
git://git.gnupg.org/gnupg.git
synced 2024-12-31 11:41:32 +01:00
gpg: set full --dry-run when used with --show-keys
* g10/gpg.c (main): ensure that opt.dry_run matches opt.import_options[IMPORT_DRY_RUN]. -- It seems that the import_options IMPORT_DRY_RUN bit doesn't have the same power as the opt.dry_run bit itself. When one is set or cleared by command-line options or other option parsing, we should ensure that the other is also set or cleared. It would probably be cleaner to have just a single bit, stored in a single place, but that kind of overhaul is beyond the scope of this bugfix. GnuPG-Bug-id: 4017 Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
This commit is contained in:
parent
dc96fd8835
commit
e051c27921
27
g10/gpg.c
27
g10/gpg.c
@ -2609,6 +2609,7 @@ main (int argc, char **argv)
|
|||||||
set_cmd (&cmd, pargs.r_opt);
|
set_cmd (&cmd, pargs.r_opt);
|
||||||
opt.import_options |= IMPORT_SHOW;
|
opt.import_options |= IMPORT_SHOW;
|
||||||
opt.import_options |= IMPORT_DRY_RUN;
|
opt.import_options |= IMPORT_DRY_RUN;
|
||||||
|
opt.dry_run = 1;
|
||||||
opt.import_options &= ~IMPORT_REPAIR_KEYS;
|
opt.import_options &= ~IMPORT_REPAIR_KEYS;
|
||||||
opt.list_options |= LIST_SHOW_UNUSABLE_UIDS;
|
opt.list_options |= LIST_SHOW_UNUSABLE_UIDS;
|
||||||
opt.list_options |= LIST_SHOW_UNUSABLE_SUBKEYS;
|
opt.list_options |= LIST_SHOW_UNUSABLE_SUBKEYS;
|
||||||
@ -2647,7 +2648,10 @@ main (int argc, char **argv)
|
|||||||
|
|
||||||
case oQuiet: opt.quiet = 1; break;
|
case oQuiet: opt.quiet = 1; break;
|
||||||
case oNoTTY: tty_no_terminal(1); break;
|
case oNoTTY: tty_no_terminal(1); break;
|
||||||
case oDryRun: opt.dry_run = 1; break;
|
case oDryRun:
|
||||||
|
opt.dry_run = 1;
|
||||||
|
opt.import_options |= IMPORT_DRY_RUN;
|
||||||
|
break;
|
||||||
case oInteractive: opt.interactive = 1; break;
|
case oInteractive: opt.interactive = 1; break;
|
||||||
case oVerbose:
|
case oVerbose:
|
||||||
opt.verbose++;
|
opt.verbose++;
|
||||||
@ -3208,14 +3212,19 @@ main (int argc, char **argv)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case oImportOptions:
|
case oImportOptions:
|
||||||
if(!parse_import_options(pargs.r.ret_str,&opt.import_options,1))
|
{
|
||||||
{
|
unsigned int old_import_options = opt.import_options;
|
||||||
if(configname)
|
if(!parse_import_options(pargs.r.ret_str,&opt.import_options,1))
|
||||||
log_error(_("%s:%d: invalid import options\n"),
|
{
|
||||||
configname,configlineno);
|
if(configname)
|
||||||
else
|
log_error(_("%s:%d: invalid import options\n"),
|
||||||
log_error(_("invalid import options\n"));
|
configname,configlineno);
|
||||||
}
|
else
|
||||||
|
log_error(_("invalid import options\n"));
|
||||||
|
}
|
||||||
|
if ((old_import_options & IMPORT_DRY_RUN) != (opt.import_options & IMPORT_DRY_RUN))
|
||||||
|
opt.dry_run = !!(opt.import_options & IMPORT_DRY_RUN);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case oImportFilter:
|
case oImportFilter:
|
||||||
rc = parse_and_set_import_filter (pargs.r.ret_str);
|
rc = parse_and_set_import_filter (pargs.r.ret_str);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user