Skip to content

The pre-lock ACL refusal names each principal once per path (#4043) - #4069

Merged
erikdarlingdata merged 1 commit into
devfrom
feature/4043-refusal-names-principal-once
Sep 23, 2026
Merged

erikdarlingdata merged 1 commit into
devfrom
feature/4043-refusal-names-principal-once

Conversation

@erikdarlingdata

Copy link
Copy Markdown
Owner

Why

Today I deployed dev to DARLING01. Its install folder is older than #4038, so the upgrade script refused it, as #4050 intends. But the refusal named one principal twice:

BUILTIN\Users on C:\PerformanceMonitorDarling
BUILTIN\Users on C:\PerformanceMonitorDarling

A folder made under C:\ gets BUILTIN\Users as two ACEs: one gives append rights and one gives write rights. Get-UntrustedWriteGrantees writes one line for each ACE. Two of its four callers removed the repeated lines. The other two did not: the install folder check and the SHA256SUMS folder check in upgrade-darling.ps1.

What changes

  • Get-UntrustedWriteGrantees returns each finding once. Both scripts get the same change, so the test that keeps the two copies identical still passes.
  • The two callers that removed repeats themselves do not need to now, so those two lines are gone.
  • A new test, ThePreLockWritableExtractionCheck_NamesAPrincipalOnce_WhenTwoOfItsAcesGrantWrite, gives one principal two write ACEs and expects one finding. Before the fix, it failed with count=2.

This PR has no CHANGELOG entry. #4050 is not released yet, and its entry is still true.

Test plan

  • On DARLING01: dev's upgrade refused the old install folder and showed the repeated line. With -AcceptWritableExtraction, the upgrade ran and locked the folder. A second run without the switch passed the install folder check and refused the staging folder, which ordinary users can write to.
  • The new test failed before the fix and passes after it.
  • The 9 test classes that read the two scripts: 194 passed, 0 failed.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Ua31ugERL5DmhFVRtf6keQ

A folder made under C:\ inherits BUILTIN\Users as two ACEs, and dev's
upgrade refused DARLING01's pre-#4038 install root with "BUILTIN\Users on
C:\PerformanceMonitorDarling" listed twice. Two of the four callers of
Get-UntrustedWriteGrantees dropped repeated lines and two did not.

The function now returns each finding once (both script copies change
identically, so the byte-identity test still holds), and the two
call-site de-duplications it replaces are removed. New test: two write
ACEs for one principal produce one finding; red before the fix (count=2).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ua31ugERL5DmhFVRtf6keQ
@erikdarlingdata
erikdarlingdata marked this pull request as ready for review September 23, 2026 20:37
@erikdarlingdata
erikdarlingdata merged commit 3b67d9c into dev Sep 23, 2026
15 of 16 checks passed
@erikdarlingdata
erikdarlingdata deleted the feature/4043-refusal-names-principal-once branch September 23, 2026 20:37
erikdarlingdata added a commit that referenced this pull request Sep 23, 2026
…ntries in their sections (#4080)

Adds 42 entries and 42 link refs (#3992, #3995, #3996, #3998, #4001, #4002, #4003, #4007, #4010, #4011, #4013, #4015, #4020, #4022, #4025, #4029, #4030, #4031, #4036, #4038, #4039, #4040, #4044, #4047, #4048, #4049, #4050, #4051, #4055, #4061, #4063, #4064, #4065, #4066, #4067, #4068, #4069, #4070, #4071, #4073, #4074, #4078). Each PR's entry was buffered, and this lands every entry whose PR was merged on origin/dev when it ran.

#3989 left 26 entries under bare 'Changed' and 'Fixed' lines above '### Added'. They move into '### Changed' and '### Fixed', below the new entries, and one blank line stays under [Unreleased].


Claude-Session: https://claude.ai/code/session_01Ua31ugERL5DmhFVRtf6keQ

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant