Skip to content

Commit 6375fe4

Browse files
author
Bryan C. Mills
committed
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 <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Brad Fitzpatrick <[email protected]>
1 parent 70be481 commit 6375fe4

File tree

10 files changed

+10
-10
lines changed

10 files changed

+10
-10
lines changed

misc/cgo/life/overlaydir_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ func overlayDir(dstRoot, srcRoot string) error {
5252
// Always copy directories (don't symlink them).
5353
// If we add a file in the overlay, we don't want to add it in the original.
5454
if info.IsDir() {
55-
return os.Mkdir(dstPath, perm)
55+
return os.Mkdir(dstPath, perm|0200)
5656
}
5757

5858
// If the OS supports symlinks, use them instead of copying bytes.

misc/cgo/stdio/overlaydir_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ func overlayDir(dstRoot, srcRoot string) error {
5252
// Always copy directories (don't symlink them).
5353
// If we add a file in the overlay, we don't want to add it in the original.
5454
if info.IsDir() {
55-
return os.Mkdir(dstPath, perm)
55+
return os.Mkdir(dstPath, perm|0200)
5656
}
5757

5858
// If the OS supports symlinks, use them instead of copying bytes.

misc/cgo/test/overlaydir_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ func overlayDir(dstRoot, srcRoot string) error {
5252
// Always copy directories (don't symlink them).
5353
// If we add a file in the overlay, we don't want to add it in the original.
5454
if info.IsDir() {
55-
return os.Mkdir(dstPath, perm)
55+
return os.Mkdir(dstPath, perm|0200)
5656
}
5757

5858
// If the OS supports symlinks, use them instead of copying bytes.

misc/cgo/testcarchive/overlaydir_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ func overlayDir(dstRoot, srcRoot string) error {
5252
// Always copy directories (don't symlink them).
5353
// If we add a file in the overlay, we don't want to add it in the original.
5454
if info.IsDir() {
55-
return os.Mkdir(dstPath, perm)
55+
return os.Mkdir(dstPath, perm|0200)
5656
}
5757

5858
// If the OS supports symlinks, use them instead of copying bytes.

misc/cgo/testcshared/overlaydir_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ func overlayDir(dstRoot, srcRoot string) error {
5252
// Always copy directories (don't symlink them).
5353
// If we add a file in the overlay, we don't want to add it in the original.
5454
if info.IsDir() {
55-
return os.Mkdir(dstPath, perm)
55+
return os.Mkdir(dstPath, perm|0200)
5656
}
5757

5858
// If the OS supports symlinks, use them instead of copying bytes.

misc/cgo/testplugin/overlaydir_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ func overlayDir(dstRoot, srcRoot string) error {
5252
// Always copy directories (don't symlink them).
5353
// If we add a file in the overlay, we don't want to add it in the original.
5454
if info.IsDir() {
55-
return os.Mkdir(dstPath, perm)
55+
return os.Mkdir(dstPath, perm|0200)
5656
}
5757

5858
// If the OS supports symlinks, use them instead of copying bytes.

misc/cgo/testshared/overlaydir_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ func overlayDir(dstRoot, srcRoot string) error {
5252
// Always copy directories (don't symlink them).
5353
// If we add a file in the overlay, we don't want to add it in the original.
5454
if info.IsDir() {
55-
return os.Mkdir(dstPath, perm)
55+
return os.Mkdir(dstPath, perm|0200)
5656
}
5757

5858
// If the OS supports symlinks, use them instead of copying bytes.

misc/cgo/testso/overlaydir_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ func overlayDir(dstRoot, srcRoot string) error {
5252
// Always copy directories (don't symlink them).
5353
// If we add a file in the overlay, we don't want to add it in the original.
5454
if info.IsDir() {
55-
return os.Mkdir(dstPath, perm)
55+
return os.Mkdir(dstPath, perm|0200)
5656
}
5757

5858
// If the OS supports symlinks, use them instead of copying bytes.

misc/cgo/testsovar/overlaydir_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ func overlayDir(dstRoot, srcRoot string) error {
5252
// Always copy directories (don't symlink them).
5353
// If we add a file in the overlay, we don't want to add it in the original.
5454
if info.IsDir() {
55-
return os.Mkdir(dstPath, perm)
55+
return os.Mkdir(dstPath, perm|0200)
5656
}
5757

5858
// If the OS supports symlinks, use them instead of copying bytes.

misc/reboot/overlaydir_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ func overlayDir(dstRoot, srcRoot string) error {
5151
// Always copy directories (don't symlink them).
5252
// If we add a file in the overlay, we don't want to add it in the original.
5353
if info.IsDir() {
54-
return os.Mkdir(dstPath, perm)
54+
return os.Mkdir(dstPath, perm|0200)
5555
}
5656

5757
// If the OS supports symlinks, use them instead of copying bytes.

0 commit comments

Comments
 (0)