eden/src/common/fs
Feng Chen c3f1e6562b
[common/fs] Preserve Windows roots during path sanitization (#4437)
Commit 5b4c29b123 made SanitizePath rebuild paths from split components after resolving traversal. That reconstruction retained only one leading separator, collapsing UNC paths and breaking network-backed directories.

Parse the path root separately from normal components. Preserve UNC prefixes, drive-absolute and drive-relative forms, and extended UNC/device namespaces while normalizing separators and dot components.

Treat the UNC server/share portion as part of the root so parent traversal cannot escape into another share. Also preserve root-only results such as / and C:\\ instead of stripping their final separator.

- [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions).
- [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md)
- [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability.

-------------------

Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4437
Reviewed-by: lizzie <lizzie@eden-emu.dev>
Reviewed-by: CamilleLaVey <camillelavey99@gmail.com>
2026-09-16 22:12:01 +02:00
..
file.cpp [*] basic in-house cpp linting (#4039) 2026-06-04 05:49:07 +02:00
file.h [common] rework BitField and BitUtil, use concepts whenever possible (#4076) 2026-07-09 03:47:04 +02:00
fs.cpp [fs] use recursive_directory_iterator since MSVC CRT no longer should bug out (#3670) 2026-07-07 20:26:10 +02:00
fs.h general: Convert source file copyright comments over to SPDX 2022-04-23 05:55:32 -04:00
fs_android.cpp common: fs: Expand android macros 2024-02-08 14:13:46 -05:00
fs_android.h common: fs: Expand android macros 2024-02-08 14:13:46 -05:00
fs_paths.h [vulkan, android] Add feature of post-processing shaders on Android (#4348) 2026-09-10 15:14:02 +02:00
fs_types.h [desktop] fix save data location, orphaned profiles finder (#2678) 2025-10-07 01:32:09 +02:00
fs_util.cpp [common] remove ranges polyfill (#2546) 2025-09-24 19:29:48 +02:00
fs_util.h general: Convert source file copyright comments over to SPDX 2022-04-23 05:55:32 -04:00
path_util.cpp [common/fs] Preserve Windows roots during path sanitization (#4437) 2026-09-16 22:12:01 +02:00
path_util.h [common/fs] Preserve Windows roots during path sanitization (#4437) 2026-09-16 22:12:01 +02:00
ryujinx_compat.cpp [desktop, fs] main_window separation; fix Ryujinx save data link issues (#2929) 2025-11-09 18:07:38 +01:00
ryujinx_compat.h [desktop, fs] main_window separation; fix Ryujinx save data link issues (#2929) 2025-11-09 18:07:38 +01:00
symlink.cpp [desktop, fs] main_window separation; fix Ryujinx save data link issues (#2929) 2025-11-09 18:07:38 +01:00
symlink.h [desktop, fs] main_window separation; fix Ryujinx save data link issues (#2929) 2025-11-09 18:07:38 +01:00