Skip to content

Commit

Permalink
misc: ensure that test overlay directories are writable
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Bryan C. Mills committed Nov 11, 2019
1 parent 70be481 commit 6375fe4
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion misc/cgo/life/overlaydir_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion misc/cgo/stdio/overlaydir_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion misc/cgo/test/overlaydir_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion misc/cgo/testcarchive/overlaydir_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion misc/cgo/testcshared/overlaydir_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion misc/cgo/testplugin/overlaydir_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion misc/cgo/testshared/overlaydir_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion misc/cgo/testso/overlaydir_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion misc/cgo/testsovar/overlaydir_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion misc/reboot/overlaydir_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 6375fe4

Please sign in to comment.