From 7be218177701af316db75057c99ca674d53cf585 Mon Sep 17 00:00:00 2001 From: NIIBE Yutaka Date: Wed, 13 Jul 2016 09:24:26 +0900 Subject: agent: Fix envvars for UPDATESTARTUPTTY. agent/command.c (cmd_updatestartuptty): Use session_env_list_stdenvnames to get the list. -- Debian-bug-id: 801247 Signed-off-by: NIIBE Yutaka --- agent/command.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/agent/command.c b/agent/command.c index de5b1846c..e5d22689f 100644 --- a/agent/command.c +++ b/agent/command.c @@ -2663,14 +2663,13 @@ static const char hlp_updatestartuptty[] = static gpg_error_t cmd_updatestartuptty (assuan_context_t ctx, char *line) { - static const char *names[] = - { "GPG_TTY", "DISPLAY", "TERM", "XAUTHORITY", "PINENTRY_USER_DATA", NULL }; ctrl_t ctrl = assuan_get_pointer (ctx); gpg_error_t err = 0; session_env_t se; - int idx; char *lc_ctype = NULL; char *lc_messages = NULL; + int iterator; + const char *name; (void)line; @@ -2681,11 +2680,12 @@ cmd_updatestartuptty (assuan_context_t ctx, char *line) if (!se) err = gpg_error_from_syserror (); - for (idx=0; !err && names[idx]; idx++) + iterator = 0; + while (!err && (name = session_env_list_stdenvnames (&iterator, NULL))) { - const char *value = session_env_getenv (ctrl->session_env, names[idx]); + const char *value = session_env_getenv (ctrl->session_env, name); if (value) - err = session_env_setenv (se, names[idx], value); + err = session_env_setenv (se, name, value); } if (!err && ctrl->lc_ctype) -- cgit v1.2.3