From 856ae10278b1624c15c8ac6291026da12f8b7352 Mon Sep 17 00:00:00 2001 From: Derrick Brashear Date: Fri, 8 Aug 2003 22:00:09 +0000 Subject: [PATCH] pinstall-execve-adhere-to-posix-20030808 FIXES 1886 pass in null env in posixly-correct manner --- src/pinstall/install.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/pinstall/install.c b/src/pinstall/install.c index d7fc61be9..ae5102460 100644 --- a/src/pinstall/install.c +++ b/src/pinstall/install.c @@ -183,6 +183,9 @@ quickStrip(char *iname, char *oname, int ignored, int copy_only) { int pid; pid_t status; + static char *env[] = { + 0, + }; static char *strip[] = { "strip", 0, 0, }; @@ -201,7 +204,7 @@ quickStrip(char *iname, char *oname, int ignored, int copy_only) case 0: /* child */ copy[1] = iname; copy[2] = oname; - execve("/bin/cp", copy, NULL); + execve("/bin/cp", copy, env); perror("/bin/cp"); exit(1); @@ -246,7 +249,7 @@ quickStrip(char *iname, char *oname, int ignored, int copy_only) #else #define STRIP_BIN "/bin/strip" #endif - execve(STRIP_BIN, strip, NULL); + execve(STRIP_BIN, strip, env); perror(STRIP_BIN); exit(1); @@ -272,6 +275,9 @@ static int quickStrip(char *iname, char *oname, int ignored, int copy_only) { int pid, status; + static char *env[] = { + 0, + }; static char *strip[] = { "strip", 0, 0, }; @@ -290,7 +296,7 @@ quickStrip(char *iname, char *oname, int ignored, int copy_only) case 0: /* child */ copy[1] = iname; copy[2] = oname; - execve("/bin/cp", copy, 0); + execve("/bin/cp", copy, env); perror("/bin/cp"); exit(1); @@ -328,7 +334,7 @@ quickStrip(char *iname, char *oname, int ignored, int copy_only) case 0: /* child */ strip[1] = oname; - execve("/bin/strip", strip, 0); + execve("/bin/strip", strip, env); perror("/bin/strip"); exit(1); -- 2.39.5