Skip to content

fix(test): recognize Entra account SIDs in fixture ownership #1031

Description

@chirag127

What was wrong

ownWindowsFixture() in test/lib/harness.mjs only recognizes SIDs beginning with S-1-5-. A Windows user with an Entra/Azure AD SID beginning with S-1-12-1- therefore gets Cannot identify fixture owner before icacls is called, even though whoami /user /fo csv /nh succeeds.

This blocks the otherwise unrelated settings-client fixture used by #1029. The evaluated base is 58f6e2817618fae52476e8c7f1920aaeb4421c7a (0.5.5); the helper is unchanged in that contribution. Its recorded settings run was 72 passed, 1 failed, 0 skipped.

Synthetic reproduction of the parser (no real account details):

const output = '"AzureAD\\fixture","S-1-12-1-100-200-300-400"\r\n'
output.match(/S-1-5-[0-9-]+/)?.[0] // undefined

Proposed scoped fix

I am taking this bug as a separate test-infrastructure fix. Read the SID field from successful whoami CSV output, validate its full SID syntax, and retain the existing icacls /setowner operation and failure checks. Reject failed commands and malformed/ambiguous output. Do not change production ownership checks or permissions on developer data.

Scope: test/lib/harness.mjs, a small pure parsing helper under test/lib/, its offline regression suite, and the bilingual Unreleased changelog. The regressions will cover traditional and Entra user SIDs, exact field extraction, and invalid/error output. This is distinct from #666's missing privilege to set an already-identified owner.

Validation boundary

Tests use synthetic command results or fresh temporary fixture directories only. No live DSH profile or account/provider integration is involved. Full native-worker and release gates remain separate from this parser defect.

Environment

Windows x64, Node 26.13.0, dsh-ops 0.5.5 source checkout. Tests use their own temporary DSH_HOME and development-only DSH packages at 0.2.2-rc.1. This parser failure occurs before worker or Bash resolution, so native payload availability is not its cause. The repository's troubleshooting and test prerequisites were checked.

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions