From dadfb0d7a56e00934a89b78c09923f9f79866f2b Mon Sep 17 00:00:00 2001 From: Masamune3210 <1053504+Masamune3210@users.noreply.github.com> Date: Sun, 30 Aug 2026 20:38:48 -0500 Subject: [PATCH 1/2] unpkg: handle canonicalization failures on mounted filesystems --- rpcs3/Crypto/unpkg.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/rpcs3/Crypto/unpkg.cpp b/rpcs3/Crypto/unpkg.cpp index da503bc85f71..3cdf5f8bda30 100644 --- a/rpcs3/Crypto/unpkg.cpp +++ b/rpcs3/Crypto/unpkg.cpp @@ -952,11 +952,20 @@ bool package_reader::fill_data(std::map& all_instal default: { // TODO: check for valid utf8 characters - const std::string true_path = std::filesystem::weakly_canonical(path).string(); + std::error_code ec; + std::filesystem::path normalized_path = std::filesystem::weakly_canonical(path, ec); + + if (ec) + { + pkg_log.warning("Failed to canonicalize package path '%s' (%s); falling back to lexical normalization.", path, ec.message()); + normalized_path = std::filesystem::path(path).lexically_normal(); + } + + const std::string true_path = normalized_path.string(); if (true_path.empty()) { num_failures++; - pkg_log.error("Failed to get weakly_canonical path for '%s'", path); + pkg_log.error("Failed to normalize package path for '%s'", path); break; } From 86991867233371105cd5e01429051afff9a1320d Mon Sep 17 00:00:00 2001 From: Masamune3210 <1053504+Masamune3210@users.noreply.github.com> Date: Mon, 31 Aug 2026 00:17:24 -0500 Subject: [PATCH 2/2] unpkg: use lexical path normalization for package entries --- rpcs3/Crypto/unpkg.cpp | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/rpcs3/Crypto/unpkg.cpp b/rpcs3/Crypto/unpkg.cpp index 3cdf5f8bda30..4edd0a2d7558 100644 --- a/rpcs3/Crypto/unpkg.cpp +++ b/rpcs3/Crypto/unpkg.cpp @@ -952,16 +952,7 @@ bool package_reader::fill_data(std::map& all_instal default: { // TODO: check for valid utf8 characters - std::error_code ec; - std::filesystem::path normalized_path = std::filesystem::weakly_canonical(path, ec); - - if (ec) - { - pkg_log.warning("Failed to canonicalize package path '%s' (%s); falling back to lexical normalization.", path, ec.message()); - normalized_path = std::filesystem::path(path).lexically_normal(); - } - - const std::string true_path = normalized_path.string(); + const std::string true_path = std::filesystem::path(path).lexically_normal().string(); if (true_path.empty()) { num_failures++;