[PR #7544] Worlds: a folder that holds a symbolic link is not opened #7659

Open
opened 2026-11-03 07:21:34 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/7544
Author: @MSedgeMC
Created: 11/2/2026
Status: 🔄 Open

Base: main ← Head: fix/world-symlink-open


📝 Commits (3)

  • 6a30771 fix: a world folder holding a symbolic link is not opened
  • f6f34fc test: opening a world with a link reports the symlink warning
  • f4fc2c7 port_map: LevelStorageSource.validateAndCreateAccess is ported

📊 Changes

4 files changed (+104 additions, -1 deletions)

View changed files

📝 crates/horizon-client/src/title.rs (+29 -0)
📝 crates/horizon-client/src/title/tests.rs (+50 -0)
📝 crates/horizon-client/src/title/world_management.rs (+24 -0)
📝 tools/port_map/rest-025.tsv (+1 -1)

📄 Description

LevelStorageSource.validateAndCreateAccess asks the world-directory validator about the folder before it makes an access: worldDirValidator.validateDirectory(path, true) (bytecode 6–15), and a non-empty list throws ContentValidationException (25–34) instead of returning the LevelStorageAccess. WorldOpenFlows.createWorldAccess turns that exception into NoticeWithLinkScreen.createWorldSymlinkWarningScreen (symlink_warning.title.world / symlink_warning.message.world) and returns null, so no access — and so no session lock — is ever made over the world.

What Horizon lacked

Opening a world (Title::play) took the session lock and loaded it, links or not: only backup (write_tree_skipping) and delete looked for links. A save folder carrying a link into the rest of the disk opened as normal.

world_management::symlinks walks the folder the way DirectoryValidator does — never following a link, reporting links to folders and to files alike — and Title::play refuses the world with the symlink warning before the lock.

Proven: title::tests::a_world_folder_holding_a_link_is_not_opened (#[cfg(unix)]) builds a save with World/link -> outside and clicks Play Selected World. Without the check in play the click returns Play { folder: "World" } (assertion: left Play { folder: "World" }, right None); with it the action is None, the mode is Mode::Error { alert: Some(Alert::Symlink), .. }, and SessionLock::acquire on the refused world still succeeds, so this instance does not hold it. The test also pins that a clean save reports no links. All 65 title::tests pass.

Not proven: the refusal is shown through the existing alert (Mode::Error with the warning's title and message), not as NoticeWithLinkScreen with its "More information" link button and its narration line — those are not implemented. Vanilla also validates when a world is created (LevelStorageSource.createAccess); only the open path is covered here.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/7544 **Author:** [@MSedgeMC](https://github.com/MSedgeMC) **Created:** 11/2/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/world-symlink-open` --- ### 📝 Commits (3) - [`6a30771`](https://github.com/horizon-rust/horizon/commit/6a30771613a55e365f96a2afe682338c74fb4daa) fix: a world folder holding a symbolic link is not opened - [`f6f34fc`](https://github.com/horizon-rust/horizon/commit/f6f34fcd53283b1454de2d2ad90dedce20110b87) test: opening a world with a link reports the symlink warning - [`f4fc2c7`](https://github.com/horizon-rust/horizon/commit/f4fc2c78389558c56600debad4f576d69c1cc919) port_map: LevelStorageSource.validateAndCreateAccess is ported ### 📊 Changes **4 files changed** (+104 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/title.rs` (+29 -0) 📝 `crates/horizon-client/src/title/tests.rs` (+50 -0) 📝 `crates/horizon-client/src/title/world_management.rs` (+24 -0) 📝 `tools/port_map/rest-025.tsv` (+1 -1) </details> ### 📄 Description `LevelStorageSource.validateAndCreateAccess` asks the world-directory validator about the folder before it makes an access: `worldDirValidator.validateDirectory(path, true)` (bytecode 6–15), and a non-empty list throws `ContentValidationException` (25–34) instead of returning the `LevelStorageAccess`. `WorldOpenFlows.createWorldAccess` turns that exception into `NoticeWithLinkScreen.createWorldSymlinkWarningScreen` (`symlink_warning.title.world` / `symlink_warning.message.world`) and returns null, so no access — and so no session lock — is ever made over the world. **What Horizon lacked** Opening a world (`Title::play`) took the session lock and loaded it, links or not: only backup (`write_tree_skipping`) and delete looked for links. A save folder carrying a link into the rest of the disk opened as normal. `world_management::symlinks` walks the folder the way `DirectoryValidator` does — never following a link, reporting links to folders and to files alike — and `Title::play` refuses the world with the symlink warning before the lock. **Proven:** `title::tests::a_world_folder_holding_a_link_is_not_opened` (`#[cfg(unix)]`) builds a save with `World/link -> outside` and clicks Play Selected World. Without the check in `play` the click returns `Play { folder: "World" }` (assertion: left `Play { folder: "World" }`, right `None`); with it the action is `None`, the mode is `Mode::Error { alert: Some(Alert::Symlink), .. }`, and `SessionLock::acquire` on the refused world still succeeds, so this instance does not hold it. The test also pins that a clean save reports no links. All 65 `title::tests` pass. **Not proven:** the refusal is shown through the existing alert (`Mode::Error` with the warning's title and message), not as `NoticeWithLinkScreen` with its "More information" link button and its narration line — those are not implemented. Vanilla also validates when a world is *created* (`LevelStorageSource.createAccess`); only the open path is covered here. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
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
horizon-rust/horizon#7659
No description provided.