Skip to content

Tests: check for DAC override capability instead of using geteuid() #94315

Closed

Description

@tiran

Feature or enhancement

Several tests use os.geteuid() == 0 to check whether the current effective user can override discretionary access control and bypass permission checks for files. While user root typically has CAP_DAC_OVERRIDE, it may not actually have the capability. Non-root accounts can have CAP_DAC_OVERRIDE, too. On wasm32-emscripten it is not possible to query the actual effective uid.

I propose to add a check for DAC override instead of relying on effective uid check.

Activity

  1. added
    type-featureA feature request or enhancement
    type-bugAn unexpected behavior, bug, or error
    testsTests in the Lib/test dir
    3.11only security fixes
    3.12only security fixes
    and removed
    type-featureA feature request or enhancement
    on Jun 27, 2022
  2. added 2 commits that reference this issue on Jun 27, 2022
  3. hauntsaninja commented on Oct 12, 2022

    @hauntsaninja
    Contributor

    Thanks, looks like this has been completed

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

    3.11only security fixes3.12only security fixestestsTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions