aboutsummaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
authorBryan C. Mills <bcmills@google.com>2019-11-11 11:36:36 -0500
committerBryan C. Mills <bcmills@google.com>2019-11-11 17:59:46 +0000
commit6375fe4b9e5656e0ac7a46752ec2a997dd62d370 (patch)
treefe4e4668db9033a892322ded97cd1fd32a99dc5d /misc
parent70be4819a47263055040d6beb5c0b1b31487f52c (diff)
downloadgo-6375fe4b9e5656e0ac7a46752ec2a997dd62d370.tar.gz
go-6375fe4b9e5656e0ac7a46752ec2a997dd62d370.zip
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 <bcmills@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'misc')
-rw-r--r--misc/cgo/life/overlaydir_test.go2
-rw-r--r--misc/cgo/stdio/overlaydir_test.go2
-rw-r--r--misc/cgo/test/overlaydir_test.go2
-rw-r--r--misc/cgo/testcarchive/overlaydir_test.go2
-rw-r--r--misc/cgo/testcshared/overlaydir_test.go2
-rw-r--r--misc/cgo/testplugin/overlaydir_test.go2
-rw-r--r--misc/cgo/testshared/overlaydir_test.go2
-rw-r--r--misc/cgo/testso/overlaydir_test.go2
-rw-r--r--misc/cgo/testsovar/overlaydir_test.go2
-rw-r--r--misc/reboot/overlaydir_test.go2
10 files changed, 10 insertions, 10 deletions
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.