Skip to content

Fall back to lexical normalization on canonicalization failure - #19366

Merged
elad335 merged 2 commits into
RPCS3:masterfrom
Masamune3210:fix-rclone-pkginstall
Aug 31, 2026
Merged

Fall back to lexical normalization on canonicalization failure#19366
elad335 merged 2 commits into
RPCS3:masterfrom
Masamune3210:fix-rclone-pkginstall

Conversation

@Masamune3210

Copy link
Copy Markdown
Contributor

Some filesystems, like rclone's mounts in my case, don't support canonicalization, which causes Windows to return a "no recognized filesystem" error and cause the emulator to crash. Falling back to lexical normalization allows such filesystems to be used.

LLM was used to aid in finding the issue and spitballing a solution, change was tested on both rclone mount and local filesystem with both working correctly

@Masamune3210
Masamune3210 force-pushed the fix-rclone-pkginstall branch from d2d533c to dadfb0d Compare August 31, 2026 02:19
@elad335

elad335 commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

use lexically_normal() exclusively, not as a fallback.

@Masamune3210

Copy link
Copy Markdown
Contributor Author

Ok, I'll swap it out to just do that every time, the only reason I added it as a fallback is I figured canonical was being intentionally used

@Megamouse

Copy link
Copy Markdown
Contributor

I think weakly_canonical was used to resolve symlinks. Not sure though

@Masamune3210

Copy link
Copy Markdown
Contributor Author

Just let me know which is wanted, I'll go ahead and make the change just in case and I can just revert it back if the fallback is actually the wanted behavior after all

@elad335

elad335 commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

RPCS3 does not support symlinks inside game folders and emulation folders in any way. The code here simplifies the PKG provided paths which their folder structure is within the bounds of the installation folder, which must not have symlinks.

@Masamune3210

Copy link
Copy Markdown
Contributor Author

What was the reason for using canonicalization then, if I may ask? It's mostly just used for symlink resolution and avoiding things like the double dot parent dir for avoiding things like transversal attacks unless I'm missing something

@elad335

elad335 commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

This was long ago, I think I added it back then thinking it was sufficient for this purpose.

@elad335
elad335 enabled auto-merge (rebase) August 31, 2026 06:40
@Masamune3210

Copy link
Copy Markdown
Contributor Author

Makes sense, I know this bug's been around for a bit, I've just finally gotten tired of installing pkgs to local storage and moving them manually into place lol

@elad335
elad335 merged commit d9799c7 into RPCS3:master Aug 31, 2026
10 checks passed
@Masamune3210
Masamune3210 deleted the fix-rclone-pkginstall branch September 2, 2026 23:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants