fix(libkernel): report absolute Windows symbolic links #7111
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/7111"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by mazen320 on 2026-10-17T12:04:38Z.
What
lstatandreadlinkaborted when a Windows symbolic link was absolute, because only a relative reparse point was accepted. An absolute link now reports the text Windows stored for it. A reparse point that is not a symbolic link still throws.Tested
Windows 11, WinLibs GCC 15.2.0, Release.
guest_filesystemandguest_kernel_syspassed. Those tests create an absolute symbolic link and checklstatandreadlink.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-17T12:17:01Z.
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
main)core/libs/prx/libkernel/File/src/NativeStat.cppL54-56Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
core/libs/prx/libkernel/File/src/NativeStat.cppcore/libs/prx/libkernel_sys/Export.cppcore/libs/tests/GuestFilesystem.cppcore/libs/tests/GuestKernelSys.cppcore/libs/prx/libkernel/File/src/NativeStat.cppcore/libs/prx/libkernel_sys/Export.cppcore/libs/prx/libkernel_sys/Export.cppcore/libs/prx/libkernel/File/src/NativeStat.cppcore/libs/prx/libkernel/File/src/NativeStat.cppcore/libs/prx/libkernel_sys/Export.cppcore/libs/prx/libkernel/File/src/NativeStat.cppcore/libs/prx/libkernel_sys/Export.cppcore/libs/tests/GuestKernelSys.cppImported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-17T12:29:02Z.
@mazen320 the code reads well, but full CI on
6ad392dadfails the new Windows check inguest_kernel_sys. Linux skips these cases, so the Windows job is the only one that exercises them. Main passes the same test.From the Windows job (run 39031823008):
Line 294 is the new absolute-link length check:
readlink_nid_postfix(root / "absolute") == absoluteTarget.size(). SoCreateSymbolicLinkWsucceeded, butreadlinkreturned a different length thanstd::filesystem::absolute(original).generic_string().One guess, unconfirmed: the runner's temp directory is an 8.3 short path (
C:\Users\RUNNER~1\...).std::filesystem::absolutekeeps the short form, while the target you return may be the expanded long form, or vice versa (a\\?\prefix or drive-letter case would also do it). Printing both strings on failure would show which one it is. Comparing against the canonical/long path of the target, or the exact string you passed toCreateSymbolicLinkW, should make the check stable.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-17T16:17:25Z.
I opened #7202 to prepare Windows native paths for
lstatwhen the host path exceedsMAX_PATH. It touches the sameDoLstatcall sites as this PR, while your change broadens the reparse-point reader to absolute symlinks. The behavior is compatible, but the patches overlap inNativeStat.cpp. Are you comfortable with #7111 merging first? I can rebase #7202 on it afterward; neither change depends semantically on the other.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-17T16:21:51Z.
I see the follow-up commits now compare the absolute target by the file it names and use a larger sentinel buffer, which removes the exact-length assumption that failed in the earlier Windows run. The remaining
absoluteTarget.find('?')check will also expose an NT namespace prefix if the reparse print name contains one; if the rerun still fails, printing the returned target alongside the input passed toCreateSymbolicLinkWshould distinguish that from a short-name/canonicalization difference. I haven't run this on Windows, so this is source review rather than a new runtime result.Imported from boykopovar/AnyPS5. Originally posted by mazen320 on 2026-10-18T09:00:10Z.
Yes. #7273 now depends on this and uses these helpers for directory junctions. Merging this first is what we want.