os: RemoveAll doesn't remove nested un-readable directories #30555
Labels
FrozenDueToAge
NeedsFix
The path to resolution is known, but the work has not been done.
release-blocker
Milestone
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: