bytecodealliance / bytecodealliance/cap-std

Document why DirExt::access on Windows doesn't use their faccess equivalent

Offen Anfängerfreundlich
#416 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Rust
Sterne
821
Forks
57
Ø Merge
1 Std. 16 Min.
Gemergte PRs (30 T.)
4

Beschreibung

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?

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
rust
Bereich
documentation, security
Issue-Typ
Dokumentation
Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Aktivitätsstatus
Ruhig
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
68/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.