Commit 6375fe4b authored by Bryan C. Mills's avatar Bryan C. Mills

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: default avatarBrad Fitzpatrick <bradfitz@golang.org>
parent 70be4819
......@@ -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.
......
......@@ -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.
......
......@@ -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.
......
......@@ -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.
......
......@@ -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.
......
......@@ -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.
......
......@@ -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.
......
......@@ -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.
......
......@@ -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.
......
......@@ -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.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment