]> Cypherpunks repositories - gostls13.git/commitdiff
go/build: allow % in ${SRCDIR} expansion for Jenkins
authorRuss Cox <rsc@golang.org>
Thu, 20 Oct 2016 14:06:54 +0000 (10:06 -0400)
committerRuss Cox <rsc@golang.org>
Mon, 24 Oct 2016 15:35:01 +0000 (15:35 +0000)
Fixes #16959.

Change-Id: Ibbb28fdf26c53788a0edb3e3ea54ec030fa2a8cf
Reviewed-on: https://go-review.googlesource.com/31611
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/go/build/build.go
src/go/build/build_test.go

index bd89e3188fb817852854b65aeff251083f70eccb..e26ab48aa4afd5be57f7dffc8fe51d094c692861 100644 (file)
@@ -1294,7 +1294,8 @@ func expandSrcDir(str string, srcdir string) (string, bool) {
 // We never pass these arguments to a shell (just to programs we construct argv for), so this should be okay.
 // See golang.org/issue/6038.
 // The @ is for OS X. See golang.org/issue/13720.
-const safeString = "+-.,/0123456789=ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz:$@"
+// The % is for Jenkins. See golang.org/issue/16959.
+const safeString = "+-.,/0123456789=ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz:$@%"
 const safeSpaces = " "
 
 var safeBytes = []byte(safeSpaces + safeString)
index 0a20af01bd7fed33d649461bacf89fe43bcf5b1d..8ca8e5e04d41565f8df28cc173db4612f8a6c7a8 100644 (file)
@@ -294,6 +294,7 @@ func TestShellSafety(t *testing.T) {
                result                  bool
        }{
                {"-I${SRCDIR}/../include", "/projects/src/issue 11868", "-I/projects/src/issue 11868/../include", true},
+               {"-I${SRCDIR}", "wtf$@%", "-Iwtf$@%", true},
                {"-X${SRCDIR}/1,${SRCDIR}/2", "/projects/src/issue 11868", "-X/projects/src/issue 11868/1,/projects/src/issue 11868/2", true},
                {"-I/tmp -I/tmp", "/tmp2", "-I/tmp -I/tmp", false},
                {"-I/tmp", "/tmp/[0]", "-I/tmp", true},