fix(workspace): treat '/' and '\' as the same separator in root matching (#1718) - #1786
fix(workspace): treat '/' and '\' as the same separator in root matching (#1718)#1786umi008 wants to merge 1 commit into
Conversation
|
Thanks for opening this — it has been seen, and it is queued. This note is automated, but it is not a brush-off: it exists so you know where your PR stands instead of having to guess from silence. Current review status: working through a backlog. What that means for this PR, concretely:
Things that will genuinely speed it up whenever review does happen:
If this fixes a bug, a reproduction we can run is worth more than a description of the symptom. Thanks for contributing, and sorry in advance for the wait. |
The Windows sensitive-root escape hatch broke on separator spelling: the grant is recorded from cbm_canonical_path (backslashes) while the indexer hands the candidate normalized to '/'. ws_is_ancestor_or_equal compared bytes, so an approved 'Program Files' root never matched the candidate and --approve-sensitive could not lift the refusal. Compare component boundaries with separator equivalence, consistent with ws_is_sep used everywhere else in this module. The containment rule (a separator byte is never part of a component name) is unchanged. Fixes DeusData#1718 Signed-off-by: Ulises Millan Guerrero <ulises.millanguerrero@gmail.com>
0439845 to
8553224
Compare
|
Thank you for finding this separator-normalization hole in the sensitive-root grant path. I checked current I have labeled this as a high-priority Windows security bug and routed it for review. The Windows test shard is currently red, so that failure must be attributed before the PR can advance. Our review queue is full, so detailed review may take a little time. Thank you for keeping the containment boundary intact while narrowing the change to separator equivalence. |
What does this PR do?
--approve-sensitivenever lifted the sensitive-root refusal on Windows for paths underProgram Files, because the grant is recorded fromcbm_canonical_path(backslashes) while the indexer hands the candidate already normalized to/.ws_is_ancestor_or_equalcompared the raw bytes, so the recorded grant never matched the candidate and the escape hatch stayed dead exactly where it is needed most.The comparison now treats
/and\as the same separator on the component boundary, consistent withws_is_sepeverywhere else in this module. The containment rule (a separator byte is never part of a component name) is unchanged.The
ws_paths_equalhome-directory rule incbm_workspace_classify_rootuses the same helper, so home detection becomes robust to separator spelling as well. No classification semantics changed beyond separator equivalence.Checklist
git commit -s) — required, CI rejects unsigned commits (DCO, see CONTRIBUTING.md)make -f Makefile.cbm test)make -f Makefile.cbm lint-ci)