diff options
author | Ben Kibbey <[email protected]> | 2012-01-24 23:52:02 +0000 |
---|---|---|
committer | Ben Kibbey <[email protected]> | 2012-01-25 01:39:06 +0000 |
commit | 74fe0b79a1dc50a810b23100aa10284e792cc3e5 (patch) | |
tree | f0c8f04f1671d921eca8535da87fac71e6b3b49e | |
parent | Return successfully when the app has no SCD pin prompt callback. (diff) | |
download | gnupg-scd-pin-prompt.tar.gz gnupg-scd-pin-prompt.zip |
Let the RESTART command reset any scdaemon pin prompts.scd-pin-prompt
The gpg-agent sends the RESTART command to scdaemon when the client has
disconnected. This commit allows future connections to scdaemon use the
default pinentry prompts.
It is recommended to use the scdaemon LOCK command to prevent other
scdaemon clients from altering the prompts before the current client has
finished with the scdaemon pinentry since the set prompts are global to
the application.
* scd/command.c (cmd_restart): Free any allocated custom pinentry prompt
strings to let the application use its default.
-rw-r--r-- | scd/command.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/scd/command.c b/scd/command.c index 0b82a2b37..d85f0fcdf 100644 --- a/scd/command.c +++ b/scd/command.c @@ -142,7 +142,7 @@ struct server_local_s /* User-defined pinentry prompt strings. Needed both here and in the app * since they may be set by the user before an app is selected with * select_application(). They are copied to the app when - * select_application() succeeds and further modifications done in the app. + * select_application() succeeds. * */ char *pin_prompt; char *pin_admin_prompt; @@ -1838,6 +1838,11 @@ cmd_restart (assuan_context_t ctx, char *line) locked_session = NULL; log_info ("implicitly unlocking due to RESTART\n"); } + + xfree (ctrl->server_local->pin_prompt); + xfree (ctrl->server_local->pin_admin_prompt); + ctrl->server_local->pin_prompt = NULL; + ctrl->server_local->pin_admin_prompt = NULL; return 0; } |