[PR #4835] [MERGED] Resource packs: zip entries never leave the overlay folder #5882

Closed
opened 2026-11-03 05:15:39 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: main ← Head: fix/pack-path-audit


📝 Commits (1)

  • 11eecf5 Resource packs: zip entries never leave the overlay folder

📊 Changes

1 file changed (+76 additions, -1 deletions)

View changed files

📝 crates/horizon-client-render/src/packs.rs (+76 -1)

📄 Description

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

Resource packs: a zip pack's entry names are now checked before the overlay builder writes them.

The overlay builder joined each zip entry's name to its output folder as it was. Entries whose names have empty, . or .. parts, : or NUL are now left out (no real resource has them: vanilla resource paths are [a-z0-9/._-]). Overlay directories from pack.mcmeta are also held to one plain folder, as vanilla's OverlayMetadataSection validator does.

  • crates/horizon-client-render/src/packs.rs: stays_inside, used by pack_files (zip entries) and overlays_of.
  • Tests: zip_entries_never_leave_the_overlay (fails on main, passes here), extra cases in overlays_and_filters.

Players see no change with ordinary packs. No label: a fix.

pr_ready (tools/pr_ready.py on ludovics-mac-mini, against origin/main at 3c1d4b39c, 1 min 41 s)

Check Result
Scope ✅ 1 files, +76 −1
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 481 passed (47 s)
rustfmt ✅ (5 s)
clippy ✅ (12 s)
tests: horizon-client-render ✅ 651 passed (7 s)
doc tests ✅ 0 passed (2 s)
Parity ➖ 114 affected, to run in CI (no vanilla data here)

🤖 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/4835 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/31/2026 **Status:** ✅ Merged **Merged:** 10/31/2026 **Merged by:** [@Online5277](https://github.com/Online5277) **Base:** `main` ← **Head:** `fix/pack-path-audit` --- ### 📝 Commits (1) - [`11eecf5`](https://github.com/horizon-rust/horizon/commit/11eecf5a6a90e4e412da9da4cf966d26e5cecd0c) Resource packs: zip entries never leave the overlay folder ### 📊 Changes **1 file changed** (+76 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/packs.rs` (+76 -1) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. Resource packs: a zip pack's entry names are now checked before the overlay builder writes them. The overlay builder joined each zip entry's name to its output folder as it was. Entries whose names have empty, `.` or `..` parts, `:` or NUL are now left out (no real resource has them: vanilla resource paths are `[a-z0-9/._-]`). Overlay directories from `pack.mcmeta` are also held to one plain folder, as vanilla's `OverlayMetadataSection` validator does. - `crates/horizon-client-render/src/packs.rs`: `stays_inside`, used by `pack_files` (zip entries) and `overlays_of`. - Tests: `zip_entries_never_leave_the_overlay` (fails on main, passes here), extra cases in `overlays_and_filters`. Players see no change with ordinary packs. No label: a fix. **pr_ready** (`tools/pr_ready.py` on ludovics-mac-mini, against origin/main at 3c1d4b39c, 1 min 41 s) | Check | Result | | --- | --- | | Scope | ✅ 1 files, +76 −1 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 481 passed (47 s) | | rustfmt | ✅ (5 s) | | clippy | ✅ (12 s) | | tests: horizon-client-render | ✅ 651 passed (7 s) | | doc tests | ✅ 0 passed (2 s) | | Parity | ➖ 114 affected, to run in CI (no vanilla data here) | 🤖 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 05:15:39 +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#5882
No description provided.