[Pkg-gnupg-commit] [gnupg2] 138/160: agent: Fix envvars for UPDATESTARTUPTTY.

Daniel Kahn Gillmor dkg at fifthhorseman.net
Fri Jul 15 09:36:44 UTC 2016


This is an automated email from the git hooks/post-receive script.

dkg pushed a commit to branch upstream
in repository gnupg2.

commit 7be218177701af316db75057c99ca674d53cf585
Author: NIIBE Yutaka <gniibe at fsij.org>
Date:   Wed Jul 13 09:24:26 2016 +0900

    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 <gniibe at fsij.org>
---
 agent/command.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/agent/command.c b/agent/command.c
index de5b184..e5d2268 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)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-gnupg/gnupg2.git



More information about the Pkg-gnupg-commit mailing list