mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-14 21:47:19 +02:00
* g10.c, options.h: New option --limit-card-insert-tries.
* cardglue.c (open_card): Use it.
This commit is contained in:
parent
730247b19e
commit
a0b4f40301
4 changed files with 18 additions and 2 deletions
|
@ -385,6 +385,7 @@ open_card (void)
|
|||
int rc;
|
||||
app_t app;
|
||||
int did_shutdown = 0;
|
||||
int retry_count = 0;
|
||||
|
||||
/* First check whether we can contact a gpg-agent and divert all
|
||||
operation to it. This is required because gpg as well as the
|
||||
|
@ -421,7 +422,10 @@ open_card (void)
|
|||
app = xcalloc (1, sizeof *app);
|
||||
app->slot = slot;
|
||||
rc = app_select_openpgp (app);
|
||||
if (rc && !opt.batch)
|
||||
if (opt.limit_card_insert_tries
|
||||
&& ++retry_count >= opt.limit_card_insert_tries)
|
||||
;
|
||||
else if (rc && !opt.batch)
|
||||
{
|
||||
write_status_text (STATUS_CARDCTRL, "1");
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue