fix(tests): drop backup privileges for denied parent watch #6629

Closed
srgtcauliflour wants to merge 1 commit from upstream-pr/6629 into main
srgtcauliflour commented 2026-10-15 23:48:05 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by srgtcauliflour on 2026-10-15T23:48:05Z.


What

Fixes #6597.

Fixes the Windows guest_kqueue DeniedParentWatch test failing when run with elevated privileges.

Windows backup and restore privileges can bypass the restrictive directory permissions used by the test. The fix removes these privileges before the permission check.

Only Windows-specific test code is changed. Production emulator behaviour is unaffected.

Full credit to @frankea for diagnosing the issue, developing the original patch and performing initial validation in #6597. This PR carries their proposed fix forward.

Tested

Independent validation is still required before merging.

  • Confirmed the fix was committed and verified the privilege-removal call in the committed source.
  • @frankea reported 3/3 successful elevated Windows 11 test runs with the original patch.
  • @frankea reported a successful conventions check on their original branch.

Not independently tested for this PR:

  • Windows compilation and runtime tests.
  • Non-elevated Windows execution.
  • Linux regression tests.
  • Full project build and test suite.
  • Conventions checker on this PR branch.

The original contributor's results do not constitute independent validation of this submission.

Checklist

  • Based on upstream main source; no overlapping open PR identified during review
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • No changes to unimplemented paths or silent stubs
  • No investigation notes, Markdown files or images added
  • No new third-party dependencies
  • Generic behaviour, not title-specific
  • Depends on: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes (ChatGPT; original patch also disclosed as AI-assisted in #6597)

Validation remains pending. The PR author is responsible for the submitted changes.

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4881337744 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6629). Originally posted by [srgtcauliflour](https://github.com/srgtcauliflour) on 2026-10-15T23:48:05Z. --- ### What Fixes #6597. Fixes the Windows `guest_kqueue` `DeniedParentWatch` test failing when run with elevated privileges. Windows backup and restore privileges can bypass the restrictive directory permissions used by the test. The fix removes these privileges before the permission check. Only Windows-specific test code is changed. Production emulator behaviour is unaffected. Full credit to @frankea for diagnosing the issue, developing the original patch and performing initial validation in #6597. This PR carries their proposed fix forward. ### Tested **Independent validation is still required before merging.** - Confirmed the fix was committed and verified the privilege-removal call in the committed source. - @frankea reported 3/3 successful elevated Windows 11 test runs with the original patch. - @frankea reported a successful conventions check on their original branch. Not independently tested for this PR: - Windows compilation and runtime tests. - Non-elevated Windows execution. - Linux regression tests. - Full project build and test suite. - Conventions checker on this PR branch. The original contributor's results do not constitute independent validation of this submission. ### Checklist - [x] Based on upstream `main` source; no overlapping open PR identified during review - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except technical debt - [x] No changes to unimplemented paths or silent stubs - [x] No investigation notes, Markdown files or images added - [x] No new third-party dependencies - [x] Generic behaviour, not title-specific - [x] Depends on: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes (ChatGPT; original patch also disclosed as AI-assisted in #6597) **Validation remains pending.** The PR author is responsible for the submitted changes.
MarcZX10 commented 2026-10-15 23:51:34 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-15T23:51:34Z.


Thanks for carrying the fix forward and crediting @frankea. I noticed this branch is currently DIRTY against main, and its diff adds all 622 lines of GuestKqueue.cpp; current main already has the 605-line file, and #6599 applies the same privilege change as a 17-line addition. The conventions check is also currently failing on this PR. Rebasing onto current main should make the intended delta and checks easier to review.

For coordination, #6599 is open with the same DropBackupPrivileges() change. It has a MinGW GCC 12 warning-clean compile; @harmsluis has since reported 3/3 non-elevated Windows runs on both main and #6599, while the elevated 3/3 result is the original report in #6597. I’m leaving both PRs open; once your branch is rebased, we can compare the final diffs and let the maintainers choose which submission to land.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6204713808 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6629#issuecomment-6204713808). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-15T23:51:34Z. --- Thanks for carrying the fix forward and crediting @frankea. I noticed this branch is currently `DIRTY` against `main`, and its diff adds all 622 lines of `GuestKqueue.cpp`; current `main` already has the 605-line file, and #6599 applies the same privilege change as a 17-line addition. The conventions check is also currently failing on this PR. Rebasing onto current `main` should make the intended delta and checks easier to review. For coordination, #6599 is open with the same `DropBackupPrivileges()` change. It has a MinGW GCC 12 warning-clean compile; @harmsluis has since reported 3/3 non-elevated Windows runs on both main and #6599, while the elevated 3/3 result is the original report in #6597. I’m leaving both PRs open; once your branch is rebased, we can compare the final diffs and let the maintainers choose which submission to land.
MarcZX10 commented 2026-10-16 00:12:48 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-16T00:12:48Z.


This change is identical to the privilege helper already in my open PR #6599 (same GuestKqueue.cpp diff). #6599 has since received independent Windows 11 non-elevated validation (3/3 passes), and I fixed its Windows test PATH setup. Please coordinate with #6599/maintainers on which PR should carry the fix so the duplicate does not need separate review; I am not asking for priority. The elevated 3/3 report remains in issue #6597.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6204997678 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6629#issuecomment-6204997678). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-16T00:12:48Z. --- This change is identical to the privilege helper already in my open PR #6599 (same `GuestKqueue.cpp` diff). #6599 has since received independent Windows 11 non-elevated validation (3/3 passes), and I fixed its Windows test PATH setup. Please coordinate with #6599/maintainers on which PR should carry the fix so the duplicate does not need separate review; I am not asking for priority. The elevated 3/3 report remains in issue #6597.
github-actions[bot] commented 2026-10-16 00:59:44 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-16T00:59:44Z.


Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 6044 core/libs/tests/GuestKqueue.cpp
PR 6510 core/libs/tests/GuestKqueue.cpp
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6205593765 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6629#issuecomment-6205593765). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-16T00:59:44Z. --- <!-- pr-overlap --> Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap. | Pull request | Shared files not compared | |---|---| | [PR 6044](https://www.github.com/boykopovar/AnyPS5/pull/6044) | `core/libs/tests/GuestKqueue.cpp` | | [PR 6510](https://www.github.com/boykopovar/AnyPS5/pull/6510) | `core/libs/tests/GuestKqueue.cpp` |
oneandonlydean commented 2026-10-17 00:03:16 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-17T00:03:16Z.


Closing in favour of #6599, which was opened first with the same patch for #6597. If something here is missing from it, say so on #6599.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6227031951 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6629#issuecomment-6227031951). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-17T00:03:16Z. --- Closing in favour of #6599, which was opened first with the same patch for #6597. If something here is missing from it, say so on #6599.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!6629
No description provided.