Repository navigation
test(windows): automate W1a-W1h on a real Windows host (issue #119) - #128
Open
FuRongJun-1999 wants to merge 4 commits into
Open
FuRongJun-1999 wants to merge 4 commits into
FuRongJun-1999 wants to merge 4 commits into
Conversation
) docs/windows-verification.md listed what only a real Windows host can answer about ops_replace. This adds test/windows-security.test.mjs, which runs the shipped worker through the standard boundary and answers all of it: - W1a/W1b in finding mode: an explicit DACL does not survive a replacement - measured: the read-only grant comes back as (F) full control (widened); a deny ACE for another principal is dropped. Assertions lock the finding in so the ReplaceFileW fix must flip them consciously. - W1c: same-user owner unchanged (two-user case stays manual). - W1d/W1e: READONLY and no-share targets refuse with structured errors, nothing rewritten, no debris. Measured: deny(W)/deny(D) on the target also blocks Node's own readFileSync, so fixtures assert after releasing holders. - W1g/W1h: uncontended replace succeeds under the sidecar lock, a racing loser reports structured REVISION_CONFLICT, reads never fail in flight. harness: rmSync gains maxRetries - Windows transiently denies a just-touched path (Defender scans, handle handoff) and one EPERM at cleanup crashed the whole gate; documented rmSync contract covers EPERM retries. Measured on Windows 11 Pro x64, NTFS, Node v24.18.0, worker from this tree. Raw icacls before/after is in the suite output and summarized in docs/windows-verification.md. Pre-existing on this host and unrelated: bash-ipc MSYS acceptance and permissions/ptc provisioning (verified by a clean-baseline stash experiment).
Owner
|
本轮检查发现 main 已有 #187 的 Windows owner/group/DACL/时间戳保留修复及对应真实 worker 覆盖,但本 PR 不能直接当重复关闭:W1d/e/g/h 与清理重试仍有价值。合入前需把 W1a/W1b 旧的“权限丢失即通过”断言改为精确保留或明确拒绝,更新历史测量文案并跑新 head CI。跨账号与 ADS/MOTW 未测部分请继续显式保留,不能把别的 metadata 套件通过视为全部 W1 验收完成。 |
…doc the fixed state Per the T-Auto#128 review: main now carries T-Auto#187 (Windows owner/group/DACL/timestamp preservation in the private-sibling path), so the W1a/W1b assertions that used to lock in the pre-fix finding must flip to exact preservation. - W1a: explicit `(R)` survives the replacement unchanged; no inherited ACE comes back (before/after icacls printed by the suite). - W1b: the `Guest:(DENY)(W)` ACE survives a successful replacement. - Header and docs/windows-verification.md now describe the fixed state; the 2026-10-15 pre-fix measurement is kept as the historical record. - Rebuilt the win32-x64 native runtime from the merged tree (build:ptc). Verified on a real Windows 11 x64 host: windows-security suite 8/8 passed (W1a before/after icacls identical; W1b DENY present after replace).
Author
|
@T-Auto 更新好了,麻烦再看一下:
新提交已经推上来了,CI 会在新 head 上跑。 |
Author
|
@T-Auto 看了一下,这里不是代码冲突:
你在页面里点「Approve and run」后 CI 就会跑;跑完如果哪项没通过,我再修。 本机 Windows 11 x64 真跑:8 项检查全过(W1a / W1b 的 |
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.
这是什么
issue #119 要的两样交付,这一份 PR 都带上了:真 Windows x64 宿主的实测,以及作者更想要的那个结果——把 A 半场自动化成随门禁跑的套件。
实测宿主:Windows 11 Pro x64 · NTFS · Node v24.18.0 · worker 由本仓源码构建(
npm run build:ptc)。新套件:
test/windows-security.test.mjs(8 检查,全绿)user:(R)、已断继承)在替换后变成user:(F)完全控制——不只是丢 DACL,是放大了访问。icacls before/after 原文在套件输出里Guest:(DENY)(W))在成功替换后消失——限制被无声移除error.code在场),原文未动,无残片REVISION_CONFLICT(非裸平台错误)W1a/W1b 以 finding 模式锁定当前行为——测试名里写明这是 finding;
ReplaceFileW修复落地时,CI 会强迫这次翻转是有意识的而不是顺手的。顺带的 harness 修复(1 行)
test/lib/harness.mjs的清理rmSync加了maxRetries:Windows 对刚碰过的路径会瞬态 EPERM(Defender 扫描、句柄交接),一次 EPERM 就崩掉整个门禁的清理——审计 W1 时实测撞上。rmSync 的文档契约本就覆盖 EPERM 重试。已知与本机环境预存、与本 PR 无关
本机的 bash-ipc(MSYS 私有 runtime 校验)与 permissions/ptc 在干净基线(stash 本 PR 全部改动后)同样失败,属宿主环境预存;CI hosted runner 不受影响(issue 正文已列它们在云上跑通)。
边界