summaryrefslogtreecommitdiffstats
path: root/scd
diff options
context:
space:
mode:
authorNIIBE Yutaka <gniibe@fsij.org>2024-11-07 00:59:01 +0100
committerNIIBE Yutaka <gniibe@fsij.org>2024-11-07 00:59:01 +0100
commit8359f2e498953ba4714ff894cbbcb14457e8986e (patch)
treee7f3dfa148f8af73e0bb636ac633e068791699d5 /scd
parentscd: Serialize CARD access for send_card_and_app_list. (diff)
downloadgnupg2-8359f2e498953ba4714ff894cbbcb14457e8986e.tar.xz
gnupg2-8359f2e498953ba4714ff894cbbcb14457e8986e.zip
scd: Fix getinfo active_apps.
* scd/app.c (send_card_and_app_list): Avoid locking recursively. -- Fixes-commit: 25a140542a9186a27b7df9cd3ca3d478b59cbf1b GnuPG-bug-id: 7323 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
Diffstat (limited to 'scd')
-rw-r--r--scd/app.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/scd/app.c b/scd/app.c
index 9db4abc44..7d4518024 100644
--- a/scd/app.c
+++ b/scd/app.c
@@ -2756,6 +2756,9 @@ send_card_and_app_list (ctrl_t ctrl, card_t wantcard, int with_apps)
card_t *cardlist = NULL;
int n, ncardlist;
+ if (wantcard)
+ return send_serialno_and_app_status (wantcard, with_apps, ctrl);
+
card_list_r_lock ();
for (n=0, c = card_top; c; c = c->next)
n++;
@@ -2780,7 +2783,6 @@ send_card_and_app_list (ctrl_t ctrl, card_t wantcard, int with_apps)
if (wantcard && wantcard != card)
continue;
-
lock_card (card, ctrl);
err = send_serialno_and_app_status (card, with_apps, ctrl);
unlock_card (card);