aboutsummaryrefslogtreecommitdiffstats
path: root/agent
diff options
context:
space:
mode:
Diffstat (limited to 'agent')
-rw-r--r--agent/agent.h4
-rw-r--r--agent/gpg-agent.c6
2 files changed, 7 insertions, 3 deletions
diff --git a/agent/agent.h b/agent/agent.h
index f0b2a334e..06bc1e046 100644
--- a/agent/agent.h
+++ b/agent/agent.h
@@ -86,8 +86,8 @@ struct
/* Enable pinentry debugging (--debug 1024 should also be used). */
int debug_pinentry;
- /* Filename of the program to start as pinentry. */
- const char *pinentry_program;
+ /* Filename of the program to start as pinentry (malloced). */
+ char *pinentry_program;
/* Filename of the program to handle daemon tasks. */
const char *daemon_program[DAEMON_MAX_TYPE];
diff --git a/agent/gpg-agent.c b/agent/gpg-agent.c
index a5448ac38..5305098d2 100644
--- a/agent/gpg-agent.c
+++ b/agent/gpg-agent.c
@@ -864,6 +864,7 @@ parse_rereadable_options (gpgrt_argparse_t *pargs, int reread)
opt.debug = 0;
opt.no_grab = 1;
opt.debug_pinentry = 0;
+ xfree (opt.pinentry_program);
opt.pinentry_program = NULL;
opt.pinentry_touch_file = NULL;
xfree (opt.pinentry_invisible_char);
@@ -924,7 +925,10 @@ parse_rereadable_options (gpgrt_argparse_t *pargs, int reread)
case oNoGrab: opt.no_grab |= 1; break;
case oGrab: opt.no_grab |= 2; break;
- case oPinentryProgram: opt.pinentry_program = pargs->r.ret_str; break;
+ case oPinentryProgram:
+ xfree (opt.pinentry_program);
+ opt.pinentry_program = make_filename_try (pargs->r.ret_str, NULL);
+ break;
case oPinentryTouchFile: opt.pinentry_touch_file = pargs->r.ret_str; break;
case oPinentryInvisibleChar:
xfree (opt.pinentry_invisible_char);