fix(native): drive links stored as rootfs paths reach the game library mount (#2522)

* fix(native): drive links stored as rootfs paths reach the game library mount

* fix(native): relative drive links reach the game library mount

* fix(native): keep the path after a relative drive link as written

* fix(native): relative links that climb past the rootfs root stop at the guest root

Proton copies default_pfx/dosdevices/z: into each prefix with readlink and
symlink. The relinked target climbs as many folders as default_pfx is deep,
which is one more than a Steam prefix, so natively the kernel left the rootfs
and Z: pointed at the app's files folder. Proot stops ".." at the guest root;
the hook now does the same for links it resolves.

* fix(native): resolve drive links in prefixes stored in bind sources outside the rootfs

* fix(native): detect equal-length mount conversion for bound prefixes
This commit is contained in:
MaxsTechReview authored and GitHub committed 2026-11-13 18:09:15 -05:00
1 parent bc929c08b2
commit 6d1a0d9fd0
3 files changed
+353 -8

No files matched your search

+2 -2
View File
@@ -700,7 +700,7 @@ char *getcwd(char *buf, size_t size) {
char *res = orig_getcwd ? orig_getcwd(buf, size) : NULL;
if (res) {
size_t len = strlen(res);
guest_path_of_mount_source(res, len, buf ? size : len + 1);
guest_path_of_mount_source(res, len, buf ? size : len + 1, NULL);
}
return res;
}
@@ -749,7 +749,7 @@ char *realpath(const char *path, char *resolved_path) {
}
}
}
if (res) guest_path_of_mount_source(res, strlen(res), resolved_path ? PATH_MAX : strlen(res) + 1);
if (res) guest_path_of_mount_source(res, strlen(res), resolved_path ? PATH_MAX : strlen(res) + 1, NULL);
return res;
}