summaryrefslogtreecommitdiffstats
path: root/agent/gpg-agent.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2018-06-06 18:28:44 +0200
committerWerner Koch <wk@gnupg.org>2018-06-06 18:29:15 +0200
commit7ffc1ac7dd95d4cc1897a4c36d5cd628741c12f2 (patch)
tree6a0c8fe4356dce78c8947c295ef908c54c819b3d /agent/gpg-agent.c
parentdoc: Typo fixes (diff)
downloadgnupg2-7ffc1ac7dd95d4cc1897a4c36d5cd628741c12f2.tar.xz
gnupg2-7ffc1ac7dd95d4cc1897a4c36d5cd628741c12f2.zip
agent: Add DBUS_SESSION_BUS_ADDRESS et al. to the startup list.
* agent/gpg-agent.c (agent_copy_startup_env): Replace explicit list with the standard list. -- Although the function agent_copy_startup_env is newer than session_env_list_stdenvnames the latter was not used. When DBUS_SESSION_BUS_ADDRESS was added to the latter it was forgotten to add it to the former as well. Having all stdnames here seems to be the Right Thing (tm) to do. GnuPG-bug-id: 3947 Signed-off-by: Werner Koch <wk@gnupg.org>
Diffstat (limited to 'agent/gpg-agent.c')
-rw-r--r--agent/gpg-agent.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/agent/gpg-agent.c b/agent/gpg-agent.c
index bd9a471e8..1fdc94d0f 100644
--- a/agent/gpg-agent.c
+++ b/agent/gpg-agent.c
@@ -1979,15 +1979,15 @@ agent_deinit_default_ctrl (ctrl_t ctrl)
gpg_error_t
agent_copy_startup_env (ctrl_t ctrl)
{
- static const char *names[] =
- {"GPG_TTY", "DISPLAY", "TERM", "XAUTHORITY", "PINENTRY_USER_DATA", NULL};
gpg_error_t err = 0;
- int idx;
- const char *value;
+ int iterator = 0;
+ const char *name, *value;
- for (idx=0; !err && names[idx]; idx++)
- if ((value = session_env_getenv (opt.startup_env, names[idx])))
- err = session_env_setenv (ctrl->session_env, names[idx], value);
+ while (!err && (name = session_env_list_stdenvnames (&iterator, NULL)))
+ {
+ if ((value = session_env_getenv (opt.startup_env, name)))
+ err = session_env_setenv (ctrl->session_env, name, value);
+ }
if (!err && !ctrl->lc_ctype && opt.startup_lc_ctype)
if (!(ctrl->lc_ctype = xtrystrdup (opt.startup_lc_ctype)))