Skip to content

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugA problem that causes incorrect behavior or crashes.help wantedThe issue requires extra attention or help from others.os-specific bugA bug or issue that occurs only on a specific operating system.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions