Repository navigation
Conversation
O_RDONLY is zero, so testing it as a bit skipped the read permission mask and opened files without metadata authorization. Request read access for every access mode except write-only, and cover non-owner read, write, and read-write opens.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
webdavFS.OpenFiletestedos.O_RDONLY(zero) as a bit, so read-only opens passed flags0toFileSystem.Open, which skipsmeta.Openand its access check. A non-root WebDAV server could serve orCOPYfiles its UID cannot read (e.g. another user's0600file).Change
See short changes.
Validation
go test ./pkg/fs -run '^TestWebdav': pass.TestWebdavPermissionsfails onprivateandwrite-only-readwith the old condition restored.0600file), before -> after: GET 200 -> 404, COPY 201 -> 500; readers left after 21 GETs: 21 -> 0.Risks and open questions
x/net/webdav opens every PROPFIND entry read-only and skips entries that return EACCES, so files the server UID cannot read no longer show up in listings. That matches
webdav.Dir. A Depth 0 PROPFIND on such a file returns an empty 200.