mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #3302] [TUI] Windows: owner-only check fails for the built-in Administrator (SDDL alias LA) and blocks the engine test start #1339
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#1339
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @BoogeAI on GitHub (Oct 20, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/3302
Problem: On Windows, when the Terminal runs as the built-in Administrator account (RID 500, here renamed), the owner-only check rejects a folder whose ACL this code has just set itself.
strata updateverifies engine 0.1.45.3 and then fails its test start withProfileError: runtime directory must be owner-only (mode 0700); the engine is rolled back. A managed start on the same account fails the same way.Environment:
whoami /usershows SIDS-1-5-21-<domain>-500.68fa0ee7c23bb0343e57f2e7b1db61a0f44aa7835f421b396df94502859d78af).Reproduce:
…-500).strata updatewith no engine installed.Engine none NOT changed: The new engine 0.1.45.3 did not pass its test start (ProfileError: runtime directory must be owner-only (mode 0700)).runtime.runtime_dir()creates the runtime folder.Expected: The test start passes; the folder is owner-only already and only this account can reach it.
Actual:
ProfileError, update not installed.Evidence (reproduced locally, not static analysis):
STRATA_RUNTIME_DIRcreated throughruntime.runtime_dir()reports this DACL:D:PAI(A;OICI;FA;;;LA).Get-Aclon that folder resolves the single ACE to<machine>\<user>, SIDS-1-5-21-<domain>-500, FullControl;icaclsshows<machine>\<user>:(OI)(CI)(F).restrict_to_current_user()did what it promises.private_files.current_user_sid()returnsS-1-5-21-<domain>-500.private_files.is_private()andis_unshared()split the SDDL text and compare the ACE principal (fields[5]) with that string. Windows renders the RID-500 account as the SDDL aliasLA, so the comparison is"LA" == "S-1-5-21-<domain>-500"and returns False — including immediately after this module set the protected DACL itself.runtime.runtime_dir()raises, so the update test start never reaches the engine.LAas the current SID when the SID ends in-500makesis_unshared()return True;strata updatethen installs 0.1.45.3 and reportstested: started, answered one token, stopped.Suggested fix: resolve SDDL aliases (at least
LA) or compare binary ACE SIDs withEqualSidinstead of comparing SDDL text.owner_transportcallsis_private()and is affected the same way on such an account.Reproduction status: reproduced locally on the machine described above.
@jackbapa commented on GitHub (Oct 20, 2026):
Same failure here on a Windows host whose only account is the built-in Administrator.
Root cause:
restrict_to_current_user()writes the user's SID, but Windows renders RID 500 back as the SDDL aliasLA.is_private()therefore compares"LA"withS-1-5-21-...-500and returns False, andis_unshared()rejects that entry for the same reason.runtime_dir()then raisesruntime directory must be owner-only (mode 0700), which also blocks the engine test start and the activity lease.Fix: resolve every trustee field with
ConvertStringSidToSidW+ConvertSidToStringSidWbefore comparing - theEqualSidcomparison suggested above, with string SIDs instead of extra handles. The ACL that is written does not change, and POSIX is untouched.PR: https://github.com/Niko1221/Strata/pull/3406
Verified on Windows x86_64 signed in as the built-in Administrator:
runtime_dir()returns the directory,dacl_sddl()isD:PAI(A;OICI;FA;;;LA),is_private()andis_unshared()are True; a DACL that names a different account still returns False.