[PR #5198] [MERGED] Resource packs: a home folder behind a link takes its packs #6132

Closed
opened 2026-11-03 06:13:32 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/5198
Author: @ludovic111
Created: 10/31/2026
Status: ✅ Merged
Merged: 10/31/2026
Merged by: @ludovic111

Base: main ← Head: fix/resourcepacks-linked-home


📝 Commits (1)

  • 3f7e92d Resource packs: a home folder behind a link takes its packs

📊 Changes

3 files changed (+84 additions, -22 deletions)

View changed files

📝 crates/horizon-port-pack/src/resourcepacks.rs (+38 -14)
📝 crates/horizon-port-pack/src/resourcepacks/tests.rs (+45 -5)
📝 launcher/src/modpacks.rs (+1 -3)

📄 Description

🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself.

A player whose launcher home sits behind a link gets no resource packs from an imported modpack. On Fedora Silverblue/Kinoite /home is a link to /var/home, and on macOS /var is a link to /private/var. resourcepacks::directory refused a link anywhere in a destination's ancestry, all the way up to /, so installing every pack failed ("not an ordinary directory") and they were left out.

This builds on @gravitacia's check (#4579), revised by @levzzz5154 (b49925118). It keeps what that check protects: packs never get written out of their folder through a link. Only where the check starts changes:

  • directory(base, path) now takes the folder that owns the packs: the import's work folder or the profile home. Links at or above base belong to the player's own layout and are accepted (base is canonicalized).
  • Every step from base down to path must be an ordinary directory, as before. A link there (for example home/resourcepacks → elsewhere) is still refused, and nothing is created through it.
  • The canonical path must stay inside the canonical base.

Tests: a_home_behind_a_link_takes_its_packs (import and install under a linked home → var-home) and a_link_below_the_base_is_refused (a resourcepacks link out of the home is refused and nothing is written outside). The existing symlinks_at_source_and_destination_are_rejected still passes. #5094's test-only workaround (resolving the temp dir) is reverted, so the 7 resource-pack tests and the launcher's modpacks test run under macOS's linked /var again, and they pass.

pr_ready (tools/pr_ready.py --quick on ludovics-mac-mini, against origin/main at 976e3f385, 8 min 48 s)

Check Result
Scope ⚠️ 3 files, +84 −22; mixes game, launcher
Cargo.lock ✅ unchanged
Public tree ✅ (1 s)
Python tests ✅ 495 passed (3 min 12 s)
rustfmt ✅ (23 s)
clippy ✅ (2 min 2 s)
tests: horizon-port-pack ✅ 99 passed (4 s)
doc tests ✅ 0 passed
content root tests ➖ content root untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ✅ (1 s)
launcher clippy ✅ (1 min 1 s)
launcher tests ✅ 316 passed (1 min 48 s)
Parity ➖ 1 affected, to run in CI (--quick): lan_integration
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

🤖 Generated with Claude Code


🔄 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/5198 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/31/2026 **Status:** ✅ Merged **Merged:** 10/31/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/resourcepacks-linked-home` --- ### 📝 Commits (1) - [`3f7e92d`](https://github.com/horizon-rust/horizon/commit/3f7e92d6abbb7940104ff27927816561e5a83edd) Resource packs: a home folder behind a link takes its packs ### 📊 Changes **3 files changed** (+84 additions, -22 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-port-pack/src/resourcepacks.rs` (+38 -14) 📝 `crates/horizon-port-pack/src/resourcepacks/tests.rs` (+45 -5) 📝 `launcher/src/modpacks.rs` (+1 -3) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. A player whose launcher home sits behind a link gets no resource packs from an imported modpack. On Fedora Silverblue/Kinoite `/home` is a link to `/var/home`, and on macOS `/var` is a link to `/private/var`. `resourcepacks::directory` refused a link anywhere in a destination's ancestry, all the way up to `/`, so installing every pack failed ("not an ordinary directory") and they were left out. This builds on @gravitacia's check (#4579), revised by @levzzz5154 (b49925118). It keeps what that check protects: packs never get written out of their folder through a link. Only where the check starts changes: - `directory(base, path)` now takes the folder that owns the packs: the import's work folder or the profile home. Links at or above `base` belong to the player's own layout and are accepted (`base` is canonicalized). - Every step from `base` down to `path` must be an ordinary directory, as before. A link there (for example `home/resourcepacks` → elsewhere) is still refused, and nothing is created through it. - The canonical `path` must stay inside the canonical `base`. Tests: `a_home_behind_a_link_takes_its_packs` (import and install under a linked `home` → `var-home`) and `a_link_below_the_base_is_refused` (a `resourcepacks` link out of the home is refused and nothing is written outside). The existing `symlinks_at_source_and_destination_are_rejected` still passes. #5094's test-only workaround (resolving the temp dir) is reverted, so the 7 resource-pack tests and the launcher's `modpacks` test run under macOS's linked `/var` again, and they pass. **pr_ready** (`tools/pr_ready.py --quick` on ludovics-mac-mini, against origin/main at 976e3f385, 8 min 48 s) | Check | Result | | --- | --- | | Scope | ⚠️ 3 files, +84 −22; mixes game, launcher | | Cargo.lock | ✅ unchanged | | Public tree | ✅ (1 s) | | Python tests | ✅ 495 passed (3 min 12 s) | | rustfmt | ✅ (23 s) | | clippy | ✅ (2 min 2 s) | | tests: horizon-port-pack | ✅ 99 passed (4 s) | | doc tests | ✅ 0 passed | | content root tests | ➖ content root untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ✅ (1 s) | | launcher clippy | ✅ (1 min 1 s) | | launcher tests | ✅ 316 passed (1 min 48 s) | | Parity | ➖ 1 affected, to run in CI (--quick): lan_integration | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:13:32 +07:00
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#6132
No description provided.