mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-22 14:57:02 +01:00
agent: Let gpg-protect-tool pass envvars to pinentry.
* agent/protect-tool.c (opt_session_env): New. (main): Pass session environment object to gnupg_prepare_get_passphrase. -- GnuPG-bug-id: 1402 The full story can be found at https://bugzilla.redhat.com/show_bug.cgi?id=548528 Sorry for the delay.
This commit is contained in:
parent
044847a0e2
commit
045c979a76
@ -102,6 +102,7 @@ static char *opt_prompt;
|
||||
static int opt_status_msg;
|
||||
static const char *opt_p12_charset;
|
||||
static const char *opt_agent_program;
|
||||
static session_env_t opt_session_env;
|
||||
|
||||
static char *get_passphrase (int promptno);
|
||||
static void release_passphrase (char *pw);
|
||||
@ -1040,6 +1041,7 @@ main (int argc, char **argv )
|
||||
|
||||
opt_homedir = default_homedir ();
|
||||
|
||||
opt_session_env = session_env_new ();
|
||||
|
||||
pargs.argc = &argc;
|
||||
pargs.argv = &argv;
|
||||
@ -1091,7 +1093,7 @@ main (int argc, char **argv )
|
||||
opt.verbose,
|
||||
opt_homedir,
|
||||
opt_agent_program,
|
||||
NULL, NULL, NULL);
|
||||
NULL, NULL, opt_session_env);
|
||||
|
||||
if (opt_prompt)
|
||||
opt_prompt = percent_plus_unescape (opt_prompt, 0);
|
||||
@ -1127,6 +1129,8 @@ void
|
||||
agent_exit (int rc)
|
||||
{
|
||||
rc = rc? rc : log_get_errorcount(0)? 2 : 0;
|
||||
session_env_release (opt_session_env);
|
||||
opt_session_env = NULL;
|
||||
exit (rc);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user