victory play: a start below Medium integrity says why it cannot write, and the icacls fix (#706) #3215

Open
kibagami-nc wants to merge 1 commit from upstream-pr/3215 into main
kibagami-nc commented 2026-11-29 20:46:01 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by kibagami-nc on 2026-11-29T20:46:01Z.


From #706.

What happens

On some PCs, victory play stops at its start:

creating C:\Users\…\AppData\Local\victory\logs: Access is denied. (os error 5)

That happens even though cmd in the same session can create that folder. In #706 it looked random and was blamed on the antivirus. @akabkgod found the cause:

  • The cause: victory.exe carried a Low integrity label, inherited from the folder it was extracted into (icacls victory.exe showed Mandatory Label\Low Mandatory Level:(I)(NW)).
  • Why that blocks: Windows starts a program at the lower of the user's level and its file's label. At Low, a process cannot write a Medium folder, and %LOCALAPPDATA%\victory is one.
  • The fix: icacls victory.exe /setintegritylevel M made the logger write on the next start.

The change

A start below Medium now prints, beside the existing memory warning and before the home folder is created:

victory.exe runs at Low integrity, below Windows' usual Medium: it cannot write its settings, logs or
caches under %LOCALAPPDATA%\victory ("access denied"). The level comes from victory.exe's own file, which
is labelled Low when it was extracted into a folder that is.
Fix: in victory.exe's folder, run  icacls victory.exe /setintegritylevel M  and start it again.
  • The level: integrity_level reads it from the process token's mandatory label (OpenProcessToken, GetTokenInformation(TokenIntegrityLevel), the SID's last sub-authority).
  • The text: integrity_warning turns the level into the text, and says nothing at Medium and above, or when the level can't be read.
  • Cargo.toml: apps/victory asks windows-sys for Win32_Security and Win32_System_Threading too. Cargo.lock doesn't change.

Nothing changes at Medium or High, which is every ordinary start.

Tests

  • New: play::tests::a_start_below_medium_integrity_is_warned_with_the_fix:
    • Low and Untrusted are warned, with the icacls line;
    • Medium, High, System and an unread level are not;
    • the test process's own level can be read.
  • cargo test -p victory --locked: 80, 1 and 2 passed.
  • cargo clippy -p victory --all-targets: nothing in play.rs.

Not run here at Low itself: no PC here has a Low-labelled copy.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5554940119 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3215). Originally posted by [kibagami-nc](https://github.com/kibagami-nc) on 2026-11-29T20:46:01Z. --- From #706. ## What happens On some PCs, `victory play` stops at its start: ``` creating C:\Users\…\AppData\Local\victory\logs: Access is denied. (os error 5) ``` That happens even though `cmd` in the same session can create that folder. In #706 it looked random and was blamed on the antivirus. @akabkgod found the cause: - **The cause:** `victory.exe` carried a Low integrity label, inherited from the folder it was extracted into (`icacls victory.exe` showed `Mandatory Label\Low Mandatory Level:(I)(NW)`). - **Why that blocks:** Windows starts a program at the lower of the user's level and its file's label. At Low, a process cannot write a Medium folder, and `%LOCALAPPDATA%\victory` is one. - **The fix:** `icacls victory.exe /setintegritylevel M` made the logger write on the next start. ## The change A start below Medium now prints, beside the existing memory warning and before the home folder is created: ``` victory.exe runs at Low integrity, below Windows' usual Medium: it cannot write its settings, logs or caches under %LOCALAPPDATA%\victory ("access denied"). The level comes from victory.exe's own file, which is labelled Low when it was extracted into a folder that is. Fix: in victory.exe's folder, run icacls victory.exe /setintegritylevel M and start it again. ``` - **The level:** `integrity_level` reads it from the process token's mandatory label (`OpenProcessToken`, `GetTokenInformation(TokenIntegrityLevel)`, the SID's last sub-authority). - **The text:** `integrity_warning` turns the level into the text, and says nothing at Medium and above, or when the level can't be read. - **Cargo.toml:** `apps/victory` asks `windows-sys` for `Win32_Security` and `Win32_System_Threading` too. `Cargo.lock` doesn't change. Nothing changes at Medium or High, which is every ordinary start. ## Tests - **New:** `play::tests::a_start_below_medium_integrity_is_warned_with_the_fix`: - Low and Untrusted are warned, with the `icacls` line; - Medium, High, System and an unread level are not; - the test process's own level can be read. - `cargo test -p victory --locked`: 80, 1 and 2 passed. - `cargo clippy -p victory --all-targets`: nothing in `play.rs`. Not run here at Low itself: no PC here has a Low-labelled copy.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/3215:upstream-pr/3215'
git switch 'upstream-pr/3215'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/3215'
git switch 'upstream-pr/3215'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/3215'
git switch 'upstream-pr/3215'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/3215'
git switch 'main'
git merge --squash 'upstream-pr/3215'
git switch 'main'
git merge --ff-only 'upstream-pr/3215'
git switch 'main'
git merge 'upstream-pr/3215'
git push origin 'main'
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
trustno1-coder/VIctory-NVIDIA!3215
No description provided.