Config: a path with < > " | ? * is refused at once, naming the setting (#2808) #2859

Open
github-bot wants to merge 1 commit from github-bot/gh-2859 into main AGit
Owner

@⁠breachato on GitHub · 2026-11-29 18:15 UTC · original
breachato:config-reject-placeholder-brackets → main · +64 −1 · 1 files · 1 commits · open

[pr-fix]

Fixes #2808

What it changes

In #2808 a player set VICTORY_CACHE_DIR=<C:\Users\...\cache>, with the < > of a placeholder copied along. Config accepted it, and the start failed only later, at the first folder made under the cache:

Error: creating <C:\Users\...\cache>\images/native-2560x1440-upscaler-quality-sdr: The filename, directory name, or volume label syntax is incorrect. (os error 123)

That doesn't say which setting is wrong; the maintainer had to explain it in the issue.

Config::resolve now checks the cache, data, page-file and game folders, wherever they came from (environment, victory.toml, VICTORY_HOME), for the characters Windows never allows in a path (< > " | ? *). It stops with an error that names the setting, for example:

the cache folder (VICTORY_CACHE_DIR, [paths].cache_dir or VICTORY_HOME) is <C:\...\cache>, which has '<' in it; Windows does not allow that in a path: if it was copied from an example such as <your folder>, leave out the < and >

A \?\ or \.\ prefix is allowed (its ? and . are not counted). : and \ are left alone, since they are part of normal Windows paths.

How it was tested

  • cargo test -p victory-core --lib --locked config: 20 passed, including two new tests: placeholder brackets in VICTORY_CACHE_DIR are refused, naming the variable and giving the hint; a ? in [paths].game_dir is refused without the bracket hint; verbatim prefixes pass.
  • cargo clippy -p victory-core --all-targets --locked -- -D warnings: clean.
  • No game run needed: run.rs gets every cache and data folder through Config (cache_subdir, data_subdir), and nothing else reads VICTORY_CACHE_DIR directly.
  • cargo test passed for the crates it touches: yes

How to try it

In PowerShell, then start the game as usual:

$env:VICTORY_CACHE_DIR = '<C:\Temp\cache>'

main gets as far as making the first folder under the cache and stops with os error 123; this branch stops at once and names VICTORY_CACHE_DIR. Without a title: cargo test -p victory-core --lib --locked config.

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches. Related: none for #2808 or path validation in config.rs.

Assisted by Claude.

**@⁠breachato** on GitHub · 2026-11-29 18:15 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2859) `breachato:config-reject-placeholder-brackets` → `main` · +64 −1 · 1 files · 1 commits · open [pr-fix] Fixes #2808 ## What it changes In #2808 a player set `VICTORY_CACHE_DIR=<C:\Users\...\cache>`, with the `<` `>` of a placeholder copied along. `Config` accepted it, and the start failed only later, at the first folder made under the cache: ``` Error: creating <C:\Users\...\cache>\images/native-2560x1440-upscaler-quality-sdr: The filename, directory name, or volume label syntax is incorrect. (os error 123) ``` That doesn't say which setting is wrong; the maintainer had to explain it in the issue. `Config::resolve` now checks the cache, data, page-file and game folders, wherever they came from (environment, `victory.toml`, `VICTORY_HOME`), for the characters Windows never allows in a path (`< > " | ? *`). It stops with an error that names the setting, for example: ``` the cache folder (VICTORY_CACHE_DIR, [paths].cache_dir or VICTORY_HOME) is <C:\...\cache>, which has '<' in it; Windows does not allow that in a path: if it was copied from an example such as <your folder>, leave out the < and > ``` A `\?\` or `\.\` prefix is allowed (its `?` and `.` are not counted). `:` and `\` are left alone, since they are part of normal Windows paths. ## How it was tested - `cargo test -p victory-core --lib --locked config`: 20 passed, including two new tests: placeholder brackets in `VICTORY_CACHE_DIR` are refused, naming the variable and giving the hint; a `?` in `[paths].game_dir` is refused without the bracket hint; verbatim prefixes pass. - `cargo clippy -p victory-core --all-targets --locked -- -D warnings`: clean. - No game run needed: `run.rs` gets every cache and data folder through `Config` (`cache_subdir`, `data_subdir`), and nothing else reads `VICTORY_CACHE_DIR` directly. - `cargo test` passed for the crates it touches: yes ## How to try it In PowerShell, then start the game as usual: ``` $env:VICTORY_CACHE_DIR = '<C:\Temp\cache>' ``` `main` gets as far as making the first folder under the cache and stops with `os error 123`; this branch stops at once and names `VICTORY_CACHE_DIR`. Without a title: `cargo test -p victory-core --lib --locked config`. ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. Related: none for #2808 or path validation in `config.rs`. Assisted by Claude.
A player set VICTORY_CACHE_DIR=<C:\...\cache>, the brackets copied from
an example. Config took it, and the start failed later at the first
folder made under it: 'creating <...>\images/...: The filename, directory
name, or volume label syntax is incorrect. (os error 123)', which does
not say which setting is wrong. Config::resolve now checks the cache,
data, page-file and game folders for the characters Windows never
allows in a path and names the setting; for < or > it says to leave the
brackets out. A verbatim (\?\) or device (\.\) prefix is not counted.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-29 18:17:57 +00:00
github-bot force-pushed github-bot/gh-2859 from ff5aff647d to 9af2cf7273 2026-11-30 18:47:12 +00:00 Compare
github-bot force-pushed github-bot/gh-2859 from 9af2cf7273 to 8fe1f8c01d 2026-12-01 14:00:21 +00:00 Compare
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/2859/head:github-bot/gh-2859'
git switch 'github-bot/gh-2859'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2859'
git switch 'github-bot/gh-2859'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2859'
git switch 'github-bot/gh-2859'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2859'
git switch 'main'
git merge --squash 'github-bot/gh-2859'
git switch 'main'
git merge --ff-only 'github-bot/gh-2859'
git switch 'main'
git merge 'github-bot/gh-2859'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/trustno1-coder--VIctory-NVIDIA!2859
No description provided.