Skip to content

fix(test): accept Entra SIDs in fixture ownership - #1042

Open
chirag127 wants to merge 2 commits into
T-Auto:mainfrom
chirag127:fix/1031-fixture-owner-sid
Open

chirag127 wants to merge 2 commits into
T-Auto:mainfrom
chirag127:fix/1031-fixture-owner-sid

Conversation

@chirag127

Copy link
Copy Markdown

Closes #1031

What was wrong

The shared Windows test fixture matched S-1-5-... anywhere in whoami /user /fo csv /nh output. A valid Entra S-1-12-1-... account failed with Cannot identify fixture owner before icacls ran. A SID-looking username could also be mistaken for the SID field, and failed commands were not rejected by the parser.

The issue was claimed before implementation. This is a separate test-infrastructure fix from #1029.

The change

  • Extract a small pure helper under test/lib/ that accepts only successful command results containing one quoted, two-field CSV record. Read only the SID column and validate the complete revision-1 SID, 48-bit authority, and up to fifteen 32-bit subauthorities.
  • Reject failed/interrupted commands, spawn errors, diagnostics, malformed/ambiguous CSV and incomplete/out-of-range SIDs. Escaped quotes and commas in the username do not affect owner selection.
  • Keep the existing icacls /setowner action and its failure check. Production permissions and ownership logic are unchanged.
  • Add six pure regression checks and one real Windows temporary-directory owner/read-write check, collected by the existing runner, plus an English/Chinese Unreleased entry.

Implementation: 3a6407060c237908484ae0289151e837346ee95d. Current head f2d006be908f4b7ec84522e2b30e6feb186ca59d merges main 8545d4462ab19c3de44c7f4be385afe05bf1ec42 (0.5.6), preserving history. The diff against main contains only the four issue-scoped files.

Validation

All test homes were temporary; no live DSH profile, real provider or account requests. DSH_OPS_TEST_JOBS=2 and DSH_OPS_OFFLINE=1 were set for runner commands.

Command / tree Passed Failed Skipped
node test/run.mjs fixture-owner, original parser extracted unchanged 1 check 6 checks 0
Same command, fixed parser 7 checks 0 0
node test/run.mjs settings, 0.5.5 base + fix 65 checks / 5 suites 0 0
node test/run.mjs fixture-owner settings, merged 0.5.6 tree 77 checks / 7 suites 0 1 suite
npm run validate:manifest, merged tree 92 checks 0 0
node scripts/check-file-size.mjs --json, merged tree 867 code files within 1000 lines 0 offenders —

npm run build and npm run typecheck passed on both evaluated trees. Task diff whitespace check passed. The initial test-side ACL observation used Get-Acl, whose module could not load in this shell environment; the final test uses the .NET Directory ACL API in Windows PowerShell and still verifies the actual owner SID without logging it. No permission assertion was removed.

The one skipped suite is settings-disclosure-e2e: no staged native worker. Full native/release provisioning and the all-suite npm run verify gate were not run and are not claimed as passed. No dependencies, version, production source or generated files were changed by this fix. Upstream changes included through the merge retain their original history.

The upstream pull_request CI run URL/status will be recorded after this PR is created. Local results do not substitute for the required cross-platform CI required run; workflow approval remains maintainer-owned if GitHub requests it.

Environment

Windows x64, Node 26.13.0, repository-local locked dependencies. Original reproduced base: 58f6e2817618fae52476e8c7f1920aaeb4421c7a (0.5.5). Current tested base: 8545d4462ab19c3de44c7f4be385afe05bf1ec42 (0.5.6). Source contribution only; no release or installation into a daily profile.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant