-
Notifications
You must be signed in to change notification settings - Fork 17.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
os: RemoveAll doesn't remove nested un-readable directories #30555
Comments
I presume this will need a backport into 1.12.1 as well. /cc @ostenbom |
Change https://golang.org/cl/165057 mentions this issue: |
@gopherbot please open backport to 1.12 |
Backport issue(s) opened: #30579 (for 1.12). Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://golang.org/wiki/MinorReleases. |
Change https://golang.org/cl/165058 mentions this issue: |
Updates #30555 Fixes #30579 Change-Id: Ib894b4f3cdba23a18a69c9470cf69ceb83591a4d Reviewed-on: https://go-review.googlesource.com/c/go/+/165057 Run-TryBot: Baokun Lee <nototon@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> (cherry picked from commit c746592) Reviewed-on: https://go-review.googlesource.com/c/go/+/165058 Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes. It is a new regression in Go 1.12.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
os.RemoveAll doesn't remove nested directories if they are read-only. It does work if the top directory (i.e., the argument provided to RemoveAll) is read-only.
Demo:
What did you expect to see?
No output; successful execution.
What did you see instead?
Notes
This is a regression in Go 1.12. The bug is not present in Go 1.11.5.
The bug was introduced in https://golang.org/cl/146020, which was the fix for #27029.
Before that CL, RemoveAll would unconditionally attempt to call Remove on nested directories.
After that CL, it calls
openat
first and fails.This regression is similar to (but distinct from) #29983, which was also caused by CL 146020.
cc @ianlancetaylor
The text was updated successfully, but these errors were encountered: