Repository navigation
fix: refuse uninstall of games outside a library folder - #303
Merged
Merged
Conversation
Manually imported executables record their parent folder as the installation root, which can be a shared folder such as ~/Applications. Uninstall now only deletes folders directly inside a registered library; other games must be removed from the library instead. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DGbCKVdcUfJfjZ93bYY9p3
3 of 4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed?
Data-loss finding from the review: a manual import records the executable's parent folder as
installation_root, and uninstall recursively deleted it with no ownership check (e.g.~/Applications,~/.local/bin,D:\Games).checked_targetingame_uninstall.rsnow requires the root to be a direct child of a registered library ingame_libraries; otherwise uninstall is refused with a message pointing to "Rimuovi dalla libreria" plus manual deletion.get_game_uninstall_target(the dialog shows the error on open) anduninstall_game.remove_game) is reused.Trade-off: a manually imported game in its own dedicated folder outside any library is also refused, preferred over a fragile "other executables in the folder" heuristic.
Not changed: transfer still moves a manual import's whole parent folder (
game_transfer.rs:119-136); left for a follow-up to avoid overlapping with #300. No textual conflicts with #300.Validation
cargo test game_uninstall11 passed; clippy and fmt clean.folder_outside_a_library_is_rejected(shared folder with a second AppImage survives),root_containing_a_library_is_rejected(missing test from the report).Generated by Claude Code