Repository navigation
fix(workspace): opt in to preparing through local directory links - #1116
Open
buguoshixc wants to merge 1 commit into
Open
buguoshixc wants to merge 1 commit into
buguoshixc wants to merge 1 commit into
Conversation
prepareWorkspace refused any workspace whose path crossed a junction or symlink. Moving DSH home to another drive and keeping its path through a junction is the standard remedy for a full system disk, and it puts every workspace below one, so every workspace-write shell in such an install was refused. The refusal is also the only blocker: the ACL script receives the resolved directory, so the link is not in its ancestor walk at all. DSH_OPS_ALLOW_LOCAL_DIRECTORY_LINKS=1 now skips that pre-check. The ACE is still written to the resolved directory, the script's own tag walk still fails closed on every tag it cannot prove, and a root that no longer resolves rejects its promise with a named cause instead of throwing out of the call. The default posture is unchanged and the message names the switch, so a migrated install can find it from the error alone.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1114
What was wrong
On an install whose
DSH_HOME(C:\Users\<user>\.dsh) was moved to another drive and kept at its oldpath through a directory junction, every
workspace-writeshell call failed withWorkspace root must not resolve through a junction or symlink, whatever workdir was selected. Thesame directory reached through its real path worked.
prepareWorkspace()walks the path as given and rejects any reparse point in the chain before the ACLscript runs. That pre-check is in fact the only blocker:
run()receivesrealpathSync.native(...), sobin/prepare-workspace.ps1never sees the junction — the0xA0000003tag is not in its ancestor walk,and #744's classification and fail-closed behaviour are unaffected by this change.
The change
DSH_OPS_ALLOW_LOCAL_DIRECTORY_LINKS=1(environment, read where the preparation runs;the row's settings are not available to this module). With it set, the link pre-check is skipped.
the switch, so a migrated install can find the remedy from the error alone.
walk still fails closed on every tag it cannot prove. Nothing in
bin/*.ps1changed.(
... does not resolve to an existing directory) instead of throwingENOENTsynchronously out ofa function whose contract is a promise.
Validation
The one remaining failure is
Real bash required for permission matrix: the pinned Bash payload is notprovisioned on this machine. It fails identically at the base commit (
1 of 15 check(s) failedatorigin/main1caf4df2).The new opt-in test asserts the resolver is called with the realpath, that removing the target turns the
same call into a refusal even with the switch on, and that the default run writes no ACL. Reverting the
allowLinksbranch fails the first and the default-posture assertions; reverting the try/catch fails themissing-root one.
Environment
Windows 11 x64, Node v24.13.1, source checkout, base
origin/main1caf4df2, Windows PowerShell 5.1,NTFS on two local fixed drives; the reporter's install used
mklink /JfromC:toD:.