guest_kqueue: DeniedParentWatch aborts in an elevated process on Windows since #5493; drop the backup privileges in the test, diff included #6597
Loading…
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?
Imported from boykopovar/AnyPS5. Originally posted by frankea on 2026-10-15T22:11:35Z.
Since #5493,
guest_kqueue'sDeniedParentWatchaborts when the test process is elevated (Windows 11 26200, MinGW-w64 GCC 15.2.0 r7, Release;maina077a88dfthrough31cbb55d7, 4 of 4 and then 1 of 1 runs):Cause. The test denies
FILE_LIST_DIRECTORYon the parent directory to the current user and expects the vnode watch's directory open to fail with the parent named in the error. An elevated token holdsSeBackupPrivilegeandSeRestorePrivilege; a directory opened with backup semantics (which a directory handle needs) is granted regardless of its DACL when the caller holds them, so the watch succeeds,ThrownMessagereturns an empty string and theparentcheck aborts. Non-elevated runs and CI are unaffected, which is why it passes there.Fix. Remove both privileges from the process token at the start of
DeniedParentWatchwithAdjustTokenPrivileges(SE_PRIVILEGE_REMOVED). On a token that does not hold them the call succeeds withERROR_NOT_ALL_ASSIGNEDand changes nothing, so the non-elevated path is the same as today. Removal is permanent for the process;Timeoutis the only case that runs after it and does not touch files.Tested.
main31cbb55d7on the same elevated box: without the changeguest_kqueueaborts as above (1 of 1); with it, passes 3 of 3 (--repeat until-fail:3).python tools/check_conventions.py --base origin/mainpasses. Not run: a non-elevated Windows session (theERROR_NOT_ALL_ASSIGNEDpath), Linux (the function is inside the existing#ifdef _WIN32).Branch: https://github.com/frankea/AnyPS5/tree/fix/kqueue-denied-parent-watch-privileges (one commit, 8f1610a22, on
main31cbb55d7). I have no merged PRs, so this is an issue with the change rather than a PR; happy for anyone to carry it. Related: #5493.AI-assisted: yes (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-15T22:26:09Z.
I opened PR #6599 with the focused privilege removal before
DeniedParentWatch. The Windows-only translation unit compiles with MinGW GCC 12 under-Wall -Wextra -Werror; conventions, eligibility and intake pass. I could not run the elevated Windows test locally; the PR records the 3/3 Windows result from this issue.Imported from boykopovar/AnyPS5. Originally posted by frankea on 2026-10-15T22:27:09Z.
The change is now on a branch as well: https://github.com/frankea/AnyPS5/tree/fix/kqueue-denied-parent-watch-privileges (one commit, 8f1610a22, on
main31cbb55d7; the same diff as above).Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-15T23:13:24Z.
Thanks for publishing the branch. PR #6599 already carries the same 17-line change and keeps Adam Franke as the human co-author on MarcZX100-authored commit
083f1cc9; the manual overlap review is also posted there. I do not see a separate implementation to submit.Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-17T03:21:00Z.
@johnmaia, since
guest_kqueueaborts with 0xc0000409 on main on your machine: two open PRs look like they fix two separate causes of this abort, and the evidence suggests both are needed. #6599 handles an elevated token where backup privileges bypass the deny entry; #6173 handles a user name that equals the computer name. Could you runctest -R "^guest_kqueue$" --repeat until-fail:5 --output-on-failureon main with both merged, and note whether the shell was elevated and whether your user name matches the computer name? One run on a machine that fails on main is the proof we need before merging.