XGameSave: an unreadable legacy blob can be dropped during migration #242

Open
opened 2026-11-26 03:39:11 +00:00 by github-bot · 0 comments
Owner

@⁠Bennet0k on GitHub · 2026-11-24 22:59 UTC · original

Source

Reproduction. In a writable temporary legacy save directory, create two regular blobs with valid encoded names, Data and Header. Make Header unreadable to the test process and confirm that reading it returns PermissionDenied. Calling the migration code commits v1 with only Data and removes the old directory. This was reproduced by executing the migration helpers from 2119b0e with synthetic files on Linux. No retail save was used.

Proposed fix. Replace the lossy iterator chain with a loop that propagates directory-entry errors and read errors for recognized blob names before committing. Keep skipping unrelated names and preserve the optional display metadata behavior. Leave the legacy directory intact on failure so a later call can retry. With this change in the standalone Rust harness, the failed attempt leaves both files in place, and restoring read permission migrates both blobs on retry.

Found in an AI-assisted audit of 2119b0e.

**@⁠Bennet0k** on GitHub · 2026-11-24 22:59 UTC · [original](https://github.com/fxceless/victory-fork/issues/242) [Source](https://github.com/fxceless/victory-fork/blob/2119b0e44c53aa9648307b0c5c73590290305b1f/crates/victory-hle/src/modules/xgamesave.rs#L300-L322) **Reproduction.** In a writable temporary legacy save directory, create two regular blobs with valid encoded names, `Data` and `Header`. Make `Header` unreadable to the test process and confirm that reading it returns `PermissionDenied`. Calling the migration code commits v1 with only `Data` and removes the old directory. This was reproduced by executing the migration helpers from `2119b0e` with synthetic files on Linux. No retail save was used. **Proposed fix.** Replace the lossy iterator chain with a loop that propagates directory-entry errors and read errors for recognized blob names before committing. Keep skipping unrelated names and preserve the optional display metadata behavior. Leave the legacy directory intact on failure so a later call can retry. With this change in the standalone Rust harness, the failed attempt leaves both files in place, and restoring read permission migrates both blobs on retry. Found in an AI-assisted audit of `2119b0e`.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:39:11 +00:00
This discussion has been locked. Commenting is limited to contributors.
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/fxceless--victory-fork#242
No description provided.