From: Bryan C. Mills Date: Mon, 11 Nov 2019 16:36:36 +0000 (-0500) Subject: misc: ensure that test overlay directories are writable X-Git-Tag: go1.14beta1~261 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=6375fe4b9e5656e0ac7a46752ec2a997dd62d370;p=gostls13.git misc: ensure that test overlay directories are writable Otherwise, the test cannot create new files in the directory. Updates #32407 Updates #30316 Change-Id: Ief0df94a202be92f57d458d4ab4e4daa9ec189b1 Reviewed-on: https://go-review.googlesource.com/c/go/+/206458 Run-TryBot: Bryan C. Mills TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- diff --git a/misc/cgo/life/overlaydir_test.go b/misc/cgo/life/overlaydir_test.go index f381ea62f3..a25b125c7c 100644 --- a/misc/cgo/life/overlaydir_test.go +++ b/misc/cgo/life/overlaydir_test.go @@ -52,7 +52,7 @@ func overlayDir(dstRoot, srcRoot string) error { // Always copy directories (don't symlink them). // If we add a file in the overlay, we don't want to add it in the original. if info.IsDir() { - return os.Mkdir(dstPath, perm) + return os.Mkdir(dstPath, perm|0200) } // If the OS supports symlinks, use them instead of copying bytes. diff --git a/misc/cgo/stdio/overlaydir_test.go b/misc/cgo/stdio/overlaydir_test.go index 8a8dcdb3a5..5d6858f960 100644 --- a/misc/cgo/stdio/overlaydir_test.go +++ b/misc/cgo/stdio/overlaydir_test.go @@ -52,7 +52,7 @@ func overlayDir(dstRoot, srcRoot string) error { // Always copy directories (don't symlink them). // If we add a file in the overlay, we don't want to add it in the original. if info.IsDir() { - return os.Mkdir(dstPath, perm) + return os.Mkdir(dstPath, perm|0200) } // If the OS supports symlinks, use them instead of copying bytes. diff --git a/misc/cgo/test/overlaydir_test.go b/misc/cgo/test/overlaydir_test.go index 1b5c67de70..cad9577ca1 100644 --- a/misc/cgo/test/overlaydir_test.go +++ b/misc/cgo/test/overlaydir_test.go @@ -52,7 +52,7 @@ func overlayDir(dstRoot, srcRoot string) error { // Always copy directories (don't symlink them). // If we add a file in the overlay, we don't want to add it in the original. if info.IsDir() { - return os.Mkdir(dstPath, perm) + return os.Mkdir(dstPath, perm|0200) } // If the OS supports symlinks, use them instead of copying bytes. diff --git a/misc/cgo/testcarchive/overlaydir_test.go b/misc/cgo/testcarchive/overlaydir_test.go index 68878e4c66..ee35dd50f7 100644 --- a/misc/cgo/testcarchive/overlaydir_test.go +++ b/misc/cgo/testcarchive/overlaydir_test.go @@ -52,7 +52,7 @@ func overlayDir(dstRoot, srcRoot string) error { // Always copy directories (don't symlink them). // If we add a file in the overlay, we don't want to add it in the original. if info.IsDir() { - return os.Mkdir(dstPath, perm) + return os.Mkdir(dstPath, perm|0200) } // If the OS supports symlinks, use them instead of copying bytes. diff --git a/misc/cgo/testcshared/overlaydir_test.go b/misc/cgo/testcshared/overlaydir_test.go index 1eaabf6fe2..0c23ec0c15 100644 --- a/misc/cgo/testcshared/overlaydir_test.go +++ b/misc/cgo/testcshared/overlaydir_test.go @@ -52,7 +52,7 @@ func overlayDir(dstRoot, srcRoot string) error { // Always copy directories (don't symlink them). // If we add a file in the overlay, we don't want to add it in the original. if info.IsDir() { - return os.Mkdir(dstPath, perm) + return os.Mkdir(dstPath, perm|0200) } // If the OS supports symlinks, use them instead of copying bytes. diff --git a/misc/cgo/testplugin/overlaydir_test.go b/misc/cgo/testplugin/overlaydir_test.go index b68436ac03..ffb107cf8b 100644 --- a/misc/cgo/testplugin/overlaydir_test.go +++ b/misc/cgo/testplugin/overlaydir_test.go @@ -52,7 +52,7 @@ func overlayDir(dstRoot, srcRoot string) error { // Always copy directories (don't symlink them). // If we add a file in the overlay, we don't want to add it in the original. if info.IsDir() { - return os.Mkdir(dstPath, perm) + return os.Mkdir(dstPath, perm|0200) } // If the OS supports symlinks, use them instead of copying bytes. diff --git a/misc/cgo/testshared/overlaydir_test.go b/misc/cgo/testshared/overlaydir_test.go index 68be056256..3a7c9b04a0 100644 --- a/misc/cgo/testshared/overlaydir_test.go +++ b/misc/cgo/testshared/overlaydir_test.go @@ -52,7 +52,7 @@ func overlayDir(dstRoot, srcRoot string) error { // Always copy directories (don't symlink them). // If we add a file in the overlay, we don't want to add it in the original. if info.IsDir() { - return os.Mkdir(dstPath, perm) + return os.Mkdir(dstPath, perm|0200) } // If the OS supports symlinks, use them instead of copying bytes. diff --git a/misc/cgo/testso/overlaydir_test.go b/misc/cgo/testso/overlaydir_test.go index 10c874d925..91732d123d 100644 --- a/misc/cgo/testso/overlaydir_test.go +++ b/misc/cgo/testso/overlaydir_test.go @@ -52,7 +52,7 @@ func overlayDir(dstRoot, srcRoot string) error { // Always copy directories (don't symlink them). // If we add a file in the overlay, we don't want to add it in the original. if info.IsDir() { - return os.Mkdir(dstPath, perm) + return os.Mkdir(dstPath, perm|0200) } // If the OS supports symlinks, use them instead of copying bytes. diff --git a/misc/cgo/testsovar/overlaydir_test.go b/misc/cgo/testsovar/overlaydir_test.go index 10c874d925..91732d123d 100644 --- a/misc/cgo/testsovar/overlaydir_test.go +++ b/misc/cgo/testsovar/overlaydir_test.go @@ -52,7 +52,7 @@ func overlayDir(dstRoot, srcRoot string) error { // Always copy directories (don't symlink them). // If we add a file in the overlay, we don't want to add it in the original. if info.IsDir() { - return os.Mkdir(dstPath, perm) + return os.Mkdir(dstPath, perm|0200) } // If the OS supports symlinks, use them instead of copying bytes. diff --git a/misc/reboot/overlaydir_test.go b/misc/reboot/overlaydir_test.go index b38a8efbb9..6e77b2e97b 100644 --- a/misc/reboot/overlaydir_test.go +++ b/misc/reboot/overlaydir_test.go @@ -51,7 +51,7 @@ func overlayDir(dstRoot, srcRoot string) error { // Always copy directories (don't symlink them). // If we add a file in the overlay, we don't want to add it in the original. if info.IsDir() { - return os.Mkdir(dstPath, perm) + return os.Mkdir(dstPath, perm|0200) } // If the OS supports symlinks, use them instead of copying bytes.