Skip to content

Do not report every existing Windows path as accessible for every mode #528

Closed

Description

@LunaStev

The Windows access(path, mode) implementation ignores mode and only checks whether GetFileAttributes succeeds. Consequently R_OK, W_OK, X_OK and invalid mode bits are all treated like F_OK. Callers asking whether an operation is permitted can receive success solely because the path exists.

Source evidence at the head of #520:

Acceptance:

  • Validate mode bits and retain a distinct existence-only F_OK path.
  • Implement the supported permission checks with native APIs; return an explicit unsupported result for a mode whose meaning cannot be supplied reliably.
  • Add fixtures distinguishing existence from denied/read-only write access, and verify invalid mode handling.
  • Do not describe access checks as a race-free substitute for checking the subsequent open operation.

Related: #385. This concerns successful-but-false permission answers, separate from preserving native failure codes.

Audit status: identified by static source inspection; the scenarios above have not been executed during this audit. The permalink fixes the reviewed revision; this report does not claim the defect was introduced by #520.

Activity

  1. added
    bug
    help wanted
    os-specific bug
    on Sep 8, 2026
  2. self-assigned this
    on Sep 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bughelp wantedos-specific bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions