SetAllowNonOwnerAccess does not work and is a no-op
- Dominant language
- C++
- Stars
- 32.1k
- Forks
- 6.9k
- Avg merge
- 32m
- Merged PRs (30d)
- 1
Description
This was found during code inspection.
There is a method Env::SetAllowNonOwnerAccess that is meant to change the umask settings for files that are opened. By default this method returns NotSupported.
With the introduction of the FileSystem class, there was an additional "SetAllowNonOwnerAccess" method added to the PosixFileSystem (but not the FileSystem class). There is no wiring between the Env and the FileSystem to update the value for owner access, so the value in PosixFileSystem cannot currently be changed (always true).
When it worked, the umask will be 644 or 600 depending on the whether allow non owner access was true or false.
The only test for this feature (in env_test) is disabled, hence no one noticing the issue.
There are several potential solutions to this problem:
1. Eliminate the feature altogether (deprecate/remove the API)
2. Add the corresponding API to the FileSystem class and wire it up accordingly.
3. Once the FileSystem class is Configurable/Customizable, allow this property to be set through configuration settings.
I will leave it to others to decide if the feature should be deprecated or configurable. Personally, I would prefer #1 or #3 to the adding a new API to the FileSystem class (#2) to support a use case that is likely very specific to one FileSystem implementation.
Contributor guide
Assessment
This issue has not been assessed yet.