tweak(path-util): addendum to #4482 (#4486)

* tweak(path-util): addendum to #4482

These changes improve on those introduced in #4482 in two ways:

- The serialization logic for `SafeRelativeUtf8UnixPathBuf` now more
  closely mirrors the deserialization checks, reducing the chance that a
  generated path will fail to deserialize. While unlikely in practice,
  catching such theoretical cases earlier improves the experience for
  users and developers.
- After deeper testing on a clean Windows 10 VM, I found that reserved
  device names can have both an extension and an alternate data stream
  appended, not just one or the other. These changes handle that case
  more gracefully.

* chore: fix typos, add tests

* fix(path-util): extend `SafeRelativeUtf8UnixPathBuf` contract to allow `.` components

While quite useless, they were accepted by previous app versions, the
`.mrpack` specification does not forbid them, and they do not pose
security issues, so accept them for backwards compatibility.
This commit is contained in:
Alejandro González
2025-10-04 18:10:01 +02:00
committed by GitHub
parent ab6e9dd5d7
commit 98269842f3
2 changed files with 79 additions and 43 deletions

View File

@@ -4,7 +4,7 @@ edition.workspace = true
[dependencies]
typed-path.workspace = true
serde = { workspace = true, features = ["derive"] }
serde.workspace = true
derive_more = { workspace = true, features = ["display", "deref"] }
itertools.workspace = true