]> Cypherpunks repositories - gostls13.git/commitdiff
misc: ensure that test overlay directories are writable
authorBryan C. Mills <bcmills@google.com>
Mon, 11 Nov 2019 16:36:36 +0000 (11:36 -0500)
committerBryan C. Mills <bcmills@google.com>
Mon, 11 Nov 2019 17:59:46 +0000 (17:59 +0000)
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>
misc/cgo/life/overlaydir_test.go
misc/cgo/stdio/overlaydir_test.go
misc/cgo/test/overlaydir_test.go
misc/cgo/testcarchive/overlaydir_test.go
misc/cgo/testcshared/overlaydir_test.go
misc/cgo/testplugin/overlaydir_test.go
misc/cgo/testshared/overlaydir_test.go
misc/cgo/testso/overlaydir_test.go
misc/cgo/testsovar/overlaydir_test.go
misc/reboot/overlaydir_test.go

index f381ea62f3b12aa443d83901b4454230b2a690b9..a25b125c7c38396c8970a885450d6daac50665d1 100644 (file)
@@ -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.
index 8a8dcdb3a5a3dd706f7e656f8e24c83eff62851e..5d6858f9605109e72c7bd1bba442ee43869d9636 100644 (file)
@@ -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.
index 1b5c67de70f6b72ea8afe742fcefbb76140da713..cad9577ca118975f085d6a29bfdf3cb8ca767adf 100644 (file)
@@ -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.
index 68878e4c66aaf637cf702be1b43cce1c7ac5674a..ee35dd50f7bcb12aae5146d98b812294b899d0f4 100644 (file)
@@ -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.
index 1eaabf6fe211f592047420f0c521e7546d5ca1a4..0c23ec0c15a7ad7f301239150786314b35df2213 100644 (file)
@@ -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.
index b68436ac035f6f25f228c90f272fa28839eae309..ffb107cf8bdb0deaba5efed584146ceb9f12c268 100644 (file)
@@ -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.
index 68be0562567cb7232989bcd5065741de9e8ad5bb..3a7c9b04a042f69718df3ef603cc33ac2103e001 100644 (file)
@@ -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.
index 10c874d92589adceed8ef8c6423c76ab6d4f0fc3..91732d123dc5938bd0fccba1418e898a7f5d4d60 100644 (file)
@@ -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.
index 10c874d92589adceed8ef8c6423c76ab6d4f0fc3..91732d123dc5938bd0fccba1418e898a7f5d4d60 100644 (file)
@@ -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.
index b38a8efbb9bf5447864adb5701b75213fe94235b..6e77b2e97b70808694006823a1492b9143fa85aa 100644 (file)
@@ -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.