bytecodealliance / bytecodealliance/cap-std
Document why DirExt::access on Windows doesn't use their faccess equivalent
- Dominant language
- Rust
- Stars
- 821
- Forks
- 57
- Avg merge
- 1h 16m
- Merged PRs (30d)
- 4
Description
I noticed that your Windows implementation of `DirExt::access` just tries opening the file.
I understand if [_access, _waccess, t_access](https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/access-waccess?view=msvc-170) or [_access_s, _waccess_s, _taccess_s](https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/access-s-waccess-s?view=msvc-170) from the Microsoft C Runtime impose additional dependencies you want to avoid, and that the Win32 API-native version's [overcomplicated credentials](https://blog.aaronballman.com/2011/08/how-to-check-access-rights/) blow up to six pages in the [faccess](https://github.com/Freaky/faccess/) crate's Windows implementation ([Link to the source file](https://github.com/Freaky/faccess/blob/master/src/lib.rs), MIT-licensed) once you address various edge cases.
However, I was unable to find any clear documentation for the rationale behind that. (Which I'm guessing is "auditing burden".)
Could that be improved, please?
Contributor guide
Research direction
Start by locating the Windows implementation of DirExt::access and read how it currently checks access by opening the file. Compare that approach with the linked Microsoft CRT APIs and faccess Windows implementation, then document the project’s rationale, including any dependency or auditing concerns that are confirmed. Done means the rationale is clear to readers without changing the implementation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- documentation, security
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100