diff options
author | NIIBE Yutaka <[email protected]> | 2017-02-17 02:50:40 +0000 |
---|---|---|
committer | NIIBE Yutaka <[email protected]> | 2017-02-17 02:50:40 +0000 |
commit | 99d4dfe83661d05ef3a20ed04e6cec5647536738 (patch) | |
tree | be9c8926be1a560ea3878ddf9b7e93eea44fc738 /scd/command.c | |
parent | dirmngr,w32: Load all system provided certificates. (diff) | |
download | gnupg-99d4dfe83661d05ef3a20ed04e6cec5647536738.tar.gz gnupg-99d4dfe83661d05ef3a20ed04e6cec5647536738.zip |
scd: Fix RESET command handling (more).
* scd/app-common.h (struct app_ctx_s): Add reset_requested.
* scd/app.c (app_reset): Locking APP, set reset_requested.
(deallocate_app): Release the lock.
(release_application): Add LOCKED_ALREADY argument.
(scd_update_reader_status_file): Hold the lock when accessing APP.
When reset_requested is set, close the reader and deallocate APP.
* scd/command.c (open_card_with_request, cmd_restart): Follow the
change of release_application.
(send_client_notifications): Here it calls release_application holding
the lock.
Signed-off-by: NIIBE Yutaka <[email protected]>
Diffstat (limited to 'scd/command.c')
-rw-r--r-- | scd/command.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/scd/command.c b/scd/command.c index bd7e80337..5b7ddc867 100644 --- a/scd/command.c +++ b/scd/command.c @@ -227,7 +227,7 @@ open_card_with_request (ctrl_t ctrl, const char *apptype, const char *serialno) /* Re-scan USB devices. Release APP, before the scan. */ ctrl->app_ctx = NULL; - release_application (app); + release_application (app, 0); if (serialno) serialno_bin = hex_to_buffer (serialno, &serialno_bin_len); @@ -1495,7 +1495,7 @@ cmd_restart (assuan_context_t ctx, char *line) if (app) { ctrl->app_ctx = NULL; - release_application (app); + release_application (app, 0); } if (locked_session && ctrl->server_local == locked_session) { @@ -1922,7 +1922,7 @@ send_client_notifications (app_t app, int removal) { sl->ctrl_backlink->app_ctx = NULL; sl->card_removed = 1; - release_application (app); + release_application (app, 1); } if (!sl->event_signal || !sl->assuan_ctx) |