feat(libkernel_sys): create symlink targets with parent-directory components #10625
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/10625"
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 Dom3005 on 2026-10-24T13:31:09Z.
What
symlinkthrewparent-directory targetsfor any target with a..component, such as../file.txtor... FreeBSD 11.4 stores the target unchanged and itsnameiresolves the..later, from the directory that holds the link.Here the link is a host symbolic link, so the host follows it, not the guest path resolver. A
..target is therefore created only when both reach the same place:..leaves must exist and not be a symbolic link, so the host's physical..gives the same directory as the resolver's lexical one;Anything else still throws, with a message that names the reason: a
..that climbs out of a mount such as/savedata0, or a..past a directory reached through a symbolic link. Absolute targets still throw as well; they would need a host path stored in the link and a translation back inreadlink. The checks run after the existingEEXIST,ENOENTandENOTDIRchecks on the new name, so those errors come first, as in FreeBSD'skern_symlinkat.A new
symlinkentry indocs/dev/debt/libkernel_sys.mddescribes the rule and what still throws.Tested
Windows 11 26200, WinLibs MinGW-w64 GCC 15.2.0 r7, CMake + Ninja, Release,
-DBUILD_TESTING=ON, Developer Mode on (so the link success cases run), onmain6cd36e6517.guest_kernel_sysgets cases that:../file.txt,deeper/../../file.txtand.., checkreadlinkreturns each target unchanged, and read the file through the link;../missing/x;deeper/../upinside an aliased mount and read through it.a/../bwith a missinga,a/../../xand/absstill throw.The symlink-prefix and mount-escape paths are still unimplemented and not pinned by tests, per review.
main(f02a94df4e) and dropping those two throw cases,guest_kernel_syspasses again. With the original change,guest_kernel_syspassed 3 of 3, and the 82 tests matchingkernel_sys|filesystem|symlink|readlink|lstat|stat|rename|link|chmod|access|open|pathpass. The full build has 0 failed steps.main'sExport.cppwith the new test:guest_kernel_sysaborts withsymlink: parent-directory targets not implemented.python tools/check_conventions.py --base upstream/mainpasses.tools/pr_overlap.pyreports only #9442, which adds a declaration on the same line ofGuestKernelSys.cpp. None of the other open PRs that touchlibkernel_sys/Export.cppchangesymlink.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)mainmerged in at61316594bc)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-24T13:41:02Z.
Review: APPROVED
Reviewed exact head
69a7bd2c19dd68c1b269705ef33bfbf35609452c. The change permits relative..targets only when the host’s physical traversal agrees with the guest path resolution: every directory being left exists and is not a symlink, and the resulting host path matches the resolved guest target. It keeps absolute targets and paths that escape mount aliases or traverse symlink directories unsupported. The added tests cover preserved readlink text, file reads through valid parent targets, dangling targets, a symlinked path component, mount escape, and an in-mount parent traversal. I checked the reported #9442 overlap: it only adds a separate declaration in the shared test file.git diff --check upstream/main...HEADandpython3 tools/check_conventions.py --base upstream/main --head HEADpass. Hosted eligibility, conventions, intake, labels, and report pass; hosted product jobs were skipped. The Windows 11 filesystem/CTest results in the PR description are author-reported; I did not independently run Windows. I found no blocking issue in this implementation.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-24T13:49:16Z.
Review: CHANGES_REQUESTED
Follow-up on the new overlap warning at exact head
69a7bd2c19dd68c1b269705ef33bfbf35609452c: I manually compared #9442 and #10625.git merge-tree --write-tree upstream/pr/9442 upstream/pr/10625reports a content conflict incore/libs/tests/GuestKernelSys.cppat the adjacent prototype block: #9442 adds thelchflags_nid_postfixdeclaration, while this PR addsAddPathAlias_nid_no_patchandRemovePathAlias_nid_no_patchthere. The declarations are independent and can be retained together, but the authors still need an agreed merge order and the dependent PR should recordDepends on: #Nper CONTRIBUTING. The current checklist saysDepends on: none.Please coordinate with #9442's author and update the dependency/order note. My earlier approval covered the symlink implementation; this follow-up requests changes only for the unresolved shared-file merge coordination.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-24T15:28:29Z.
Review: APPROVED
Re-reviewed exact head
69a7bd2c19dd68c1b269705ef33bfbf35609452c. The overlap issue is now handled: the author proposed #9442 first, updated the checklist toDepends on: #9442, and will retain both declaration blocks on rebase. The symlink path checks and test coverage remain as previously reviewed. Currentgit diff --check, repository conventions and merge-tree checks pass; hosted eligibility, intake, conventions, labels and report pass, while product jobs are skipped. The Windows test results are author-reported and were not independently reproduced here.