net/http/cgi: merge upstream changes to default env vars
authorNikhil Benesch <nikhil.benesch@gmail.com>
Wed, 21 Oct 2020 07:00:04 +0000 (03:00 -0400)
committerIan Lance Taylor <iant@golang.org>
Fri, 23 Oct 2020 23:55:57 +0000 (16:55 -0700)
Incorporate upstream modifications to the cgi package's set of rules
about which environment variables should be inherited by child processes
by default on each platform. In particular this permits tests to pass on
NetBSD by preserving the value of the LD_LIBRARY_PATH environment
variable.

This is a partial backport of the following upstream CLs:

    https://golang.org/cl/263802
    https://golang.org/cl/263577
    https://golang.org/cl/254740

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/264097

gcc/go/gofrontend/MERGE
libgo/go/net/http/cgi/host.go

index 384ca6e88647faf62fafed81aec67d8677dbbeb6..3ad6c9633f13cf8b2e3d0a316ee1b9aabcc40dc2 100644 (file)
@@ -1,4 +1,4 @@
-fa66bd11bbe58943e273cfa74356771c996f5b24
+28f3df468666787f83f94220312383a7c267a8ce
 
 The first line of this file holds the git revision number of the last
 merge done from the gofrontend repository.
index 863f40638ab3412b218c09ef0c4b407c0fe065ff..eff67caf4e6efbe242129f768898acbd1f95741b 100644 (file)
@@ -37,15 +37,15 @@ var trailingPort = regexp.MustCompile(`:([0-9]+)$`)
 
 var osDefaultInheritEnv = func() []string {
        switch runtime.GOOS {
-       case "darwin":
+       case "darwin", "ios":
                return []string{"DYLD_LIBRARY_PATH"}
-       case "linux", "freebsd", "openbsd":
+       case "linux", "freebsd", "netbsd", "openbsd":
                return []string{"LD_LIBRARY_PATH"}
        case "hpux":
                return []string{"LD_LIBRARY_PATH", "SHLIB_PATH"}
        case "irix":
                return []string{"LD_LIBRARY_PATH", "LD_LIBRARYN32_PATH", "LD_LIBRARY64_PATH"}
-       case "solaris":
+       case "illumos", "solaris":
                return []string{"LD_LIBRARY_PATH", "LD_LIBRARY_PATH_32", "LD_LIBRARY_PATH_64"}
        case "windows":
                return []string{"SystemRoot", "COMSPEC", "PATHEXT", "WINDIR"}