Repository navigation
Conversation
10 tasks done
xXPBSXx
force-pushed
the
fix/rename-dot-component-v2
branch
from
October 13, 2026 09:34
a60be13 to
0b741ec
Compare
This was referenced Oct 13, 2026
This was referenced Oct 13, 2026
xXPBSXx
force-pushed
the
fix/rename-dot-component-v2
branch
from
October 13, 2026 14:19
0b741ec to
f4fccf5
Compare
…EINVAL rename and sceKernelRename resolved "dir/." to "dir" and renamed the directory. FreeBSD 11.4's lookup fails a last component of "." for DELETE and RENAME with EINVAL, for the source and the destination alike. Check the guest string before it is resolved: a last component of "." (also under trailing slashes) fails with EINVAL when its parent exists, ENOENT when it does not and ENOTDIR when it is not a directory. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
xXPBSXx
force-pushed
the
fix/rename-dot-component-v2
branch
from
October 13, 2026 15:28
f4fccf5 to
a0ad44f
Compare
|
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.
|
12 tasks done
10 tasks done
10 tasks done
11 tasks done
…he rename dot component differences Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Collaborator
|
Closing: no title is known to reach this. With the queue at 700+ open PRs, please hold off on new PRs that don't name a title needing the change until it's down. If a title stops on this on current main, reopen with the title ID and the log line. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
renameandsceKernelRenameresolved a path such asdir/.todirbefore renaming, sorename("dir/.", "other")moved the directorydir. FreeBSD 11.4's lookup (vfs_lookup.c) fails a last path component of.for theDELETEandRENAMEoperations withEINVAL(22), for the source and the destination alike:rename("dir/.", x),rename(x, "dir/."),rename(".", x)andrename(x, ".")all fail.A small header,
RenameDot.hpp, checks the guest string before it is resolved (resolving removes the.): a last component of.or..(also under trailing slashes,dir/./) fails withEINVALwhen its parent directory exists,ENOENTwhen the parent does not andENOTDIRwhen it is not a directory.rename(libc) andsceKernelRename(libkernel) call it for both arguments. A last component of..is refused the same way:vfs_lookup.cfailsISDOTDOTtogether withISLASTCNforDELETEandRENAMEwithEINVAL. The same lookup rule applies in FreeBSD tormdir("dir/."),unlink("dir/.")and the same calls with..; those are not changed here (the guest still resolves the dot component away and acts ondiror its parent) and stay open. Both open points are in the new TechnicalDebt entry for libc (docs/dev/debt/libc.md).Order of the checks: the header looks at both arguments before any host access, so
rename("missing", "dir/.")answersEINVALhere. FreeBSD'skern_renameatlooks the source up first (nameiwithDELETE) and the destination afterwards (nameiwithRENAME), so there the source error comes first:ENOENTfor a missing source (read inrelease/11.4.0). This difference and the backslash separator are in the TechnicalDebt entry for libc (next commit).No title evidence: found by calling
renamewith dot components in a failure-path probe. This is FreeBSD conformance; the effect on a title would be a directory moved by a call that should have failed.Overlap (
git merge-treeand the overlap bot againstmainb4d76ba60): the bot lists #4681 and #5009 (docs/dev/debt/libc.mdL57) and #5091 and #5144 (core/libs/prx/libkernel/CMakeLists.txtL270); this PR's TechnicalDebt entry now follows therealpathentry and its test registration sits beforeguest_fstatfs, away from those lines, and the merge is clean. #4938 changes neighbouring code inRename.cpp,Stdio.cppandFilesystemError.hpp; this PR leavesFilesystemError.hppalone and adds its own header. #4532 is merged.FinalPathComponentIsDot_nid_no_patchinGeneral.cpp(used byremoveand the stat calls) already finds a final.for/and\; this header does not reuse it because it also has to refuse..and to tell a missing parent (ENOENT) and a parent that is not a directory (ENOTDIR) fromEINVAL, and it treats/and\the same way. #5265 (new tests registered in the same part ofcore/libs/prx/libkernel/CMakeLists.txt) conflicts with this PR in that file (git merge-treeof the two heads, re-checked; #5325 and #5326 are closed); whichever lands second rebases the test registration. #5377 (runsceKernelRenamethrough the checksrenameuses) rewrites the body ofsceKernelRenameinStdio.cppinto one call toRenameGuestPath_nid_no_patch, the function in which this PR also refuses.and..; the two conflict in the lines ofsceKernelRename(git merge-treeof the two heads, re-checked; each is clean againstmain30f961266). Taking #5377's version ofsceKernelRenamekeeps this PR's behaviour, because the check inRenameGuestPath_nid_no_patchthen coverssceKernelRenameas well, andguest_rename_dotstill tests that path; whichever lands second rebases.Tested
Windows 10 (19045), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release, first run, in a combined build on
mainb4d76ba60(rebased afterwards; the re-run with the current head is the bullet "Re-run on 14 October 2026" below):guest_rename_dot(new) passes:renamefromdir/.,dir/./,dir/..anddir/../, todir/.anddir/.., of.and..and onto.fail withEINVAL, a missing parent givesENOENT,sceKernelRenamereturnsEINVALfordir/.,dir/..and a destination ofdir/.,dir\.anddir\..are refused too (the guest resolver turns a backslash into a separator), nothing is moved by the failed calls, and an ordinaryrename/sceKernelRenamestill works.rename from dir/. must fail with EINVAL (22) (errno 2)).rename from dir\. must fail with EINVAL (22), the guest resolver turns the backslash into a separator (errno 2)).guest_filesystem,guest_kernel_rename,guest_file_vector,guest_directory*and the path tests pass.python tools/check_conventions.py --base upstream/mainpasses.-j4), the head5220be761(a0ad44f13plus a commit that only changesdocs/dev/debt/libc.md) merged ontomaind1670009f:guest_rename_dotpasses (0.11 s, ctest); withRename.cppandStdio.cpptaken back tomainand the new test kept it fails (rename from dir/. must fail with EINVAL (22) (errno 2), exit code0xc0000409). Group run with the code heada0ad44f13on the samemain, the targets built as well: onmainaloneguest_filesystem,guest_file_vector,guest_memory,guest_kernel_sys,guest_signalsandguest_directory_bufferpass (6 of 6); with the head and its test 7 of 7 pass, 0 failed. This replaces the earlier combined-build figures. Not run: the socket tests, Linux, a console, a title.Checklist
main; no other open PR implements the same functions (overlap described above)NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt (docs/dev/debt/libc.md).mdfiles or images added to the repositoryAI-assisted (Claude Code).
🤖 Generated with Claude Code