-
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 does not remove directories when ancestor directory lacks permissions #29983
Comments
/cc @ianlancetaylor |
This might be acceptable and just need docs. The current docs in the release notes only says:
And, whoa, we no longer have docs on RemoveAll: https://tip.golang.org/pkg/os/#RemoveAll That needs to be fixed too. |
The docs for RemoveAll say:
So, not acceptable: RemoveAll no longer removes everything it can. |
The new |
I'm also dubious about this distinction: https://go.googlesource.com/go/+/master/src/os/removeall_at.go#132 The older RemoveAll uses |
Change https://golang.org/cl/160180 mentions this issue: |
I believe that it's fine to skip the call to |
Change https://golang.org/cl/160181 mentions this issue: |
Change https://golang.org/cl/160182 mentions this issue: |
- add EINTR loop on Darwin - return PathError on error - call newFile rather than NewFile This tries to minimize the possibility of any future changes. It would be nice to put openFdAt in the same file as openFileNolog, but build tags forbid. Updates #29983 Change-Id: I866002416d6473fbfd80ff6ef09b2bc4607f2934 Reviewed-on: https://go-review.googlesource.com/c/160181 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Damien Neil <dneil@google.com>
Updates #29983 Change-Id: Ifdf8aa9c92e053374e301a4268d85e277c15f0b5 Reviewed-on: https://go-review.googlesource.com/c/160182 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
- add EINTR loop on Darwin - return PathError on error - call newFile rather than NewFile This tries to minimize the possibility of any future changes. It would be nice to put openFdAt in the same file as openFileNolog, but build tags forbid. Updates golang#29983 Change-Id: I866002416d6473fbfd80ff6ef09b2bc4607f2934 Reviewed-on: https://go-review.googlesource.com/c/160181 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Damien Neil <dneil@google.com>
Updates golang#29983 Change-Id: Ifdf8aa9c92e053374e301a4268d85e277c15f0b5 Reviewed-on: https://go-review.googlesource.com/c/160182 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Fixes golang#29983 Change-Id: I24077bde991e621c23d00973b2a77bb3a18e4ae7 Reviewed-on: https://go-review.googlesource.com/c/160180 Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Damien Neil <dneil@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
- add EINTR loop on Darwin - return PathError on error - call newFile rather than NewFile This tries to minimize the possibility of any future changes. It would be nice to put openFdAt in the same file as openFileNolog, but build tags forbid. Updates golang#29983 Change-Id: I866002416d6473fbfd80ff6ef09b2bc4607f2934 Reviewed-on: https://go-review.googlesource.com/c/160181 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Damien Neil <dneil@google.com>
Updates golang#29983 Change-Id: Ifdf8aa9c92e053374e301a4268d85e277c15f0b5 Reviewed-on: https://go-review.googlesource.com/c/160182 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Fixes golang#29983 Change-Id: I24077bde991e621c23d00973b2a77bb3a18e4ae7 Reviewed-on: https://go-review.googlesource.com/c/160180 Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Damien Neil <dneil@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
This is a regression in Go 1.12 introduced by https://go-review.googlesource.com/c/137442 ("add support for long path names on unix RemoveAll").
On Go 1.11,
os.RemoveAll("a")
removesa/1/x
anda/2/x
and returns "remove a/1: permission denied".On Go 1.12,
os.RemoveAll("a")
returns "permission denied" and does not remove anything.The text was updated successfully, but these errors were encountered: