]> granicus.if.org Git - neomutt/commitdiff
Convert all exec calls to use mutt_envlist(), remove setenv function.
authorVincent Lefevre <vincent@vinc17.org>
Sun, 30 Apr 2017 19:25:08 +0000 (12:25 -0700)
committerRichard Russon <rich@flatcap.org>
Fri, 12 May 2017 13:08:59 +0000 (14:08 +0100)
The documentation implies that all children processes will be affected
by the setenv command, so convert all the exec calls to use
mutt_envlist().

The setenv("GPG_TTY") call is no longer needed so remove it.

With that removed, there are no other setenv calls in mutt, so remove
the autoconf check and replacement function.

mutt_tunnel.c
pgp.c
sendlib.c

index ebe8029f87e24d5cd23372f5fb265578a399cd6b..1d53aa1666d441c2d1743bac3a97b719f0b92314 100644 (file)
@@ -80,7 +80,7 @@ static int tunnel_socket_open(CONNECTION *conn)
     /* Don't let the subprocess think it can use the controlling tty */
     setsid();
 
-    execl(EXECSHELL, "sh", "-c", Tunnel, NULL);
+    execle(EXECSHELL, "sh", "-c", Tunnel, NULL, mutt_envlist());
     _exit(127);
   }
   mutt_unblock_signals_system(1);
diff --git a/pgp.c b/pgp.c
index 9924a6901d1b7531f48d0e92ddd7bb85fe1a7bc5..f9badb11461babed9d046ca8b4e021df78a039f8 100644 (file)
--- a/pgp.c
+++ b/pgp.c
@@ -91,10 +91,7 @@ bool pgp_use_gpg_agent(void)
     return false;
 
   if ((tty = ttyname(0)))
-  {
-    setenv("GPG_TTY", tty, 0);
     mutt_envlist_set("GPG_TTY", tty, false);
-  }
 
   return true;
 }
index 2635a64173ed4dd7ee1d42b382d7b4092f0047e8..e80c367aab013894359286c9f781aa3ce0d4c30e 100644 (file)
--- a/sendlib.c
+++ b/sendlib.c
@@ -2244,7 +2244,7 @@ static int send_msg(const char *path, char **args, const char *msg, char **tempf
           _exit(S_ERR);
       }
 
-      execvp(path, args);
+      execvpe(path, args, mutt_envlist());
       _exit(S_ERR);
     }
     else if (pid == -1)