fix(libc): count a backslash as a name character for NAME_MAX, as FreeBSD 11.4 does #22042
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/22042"
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 brajankw on 2026-11-17T03:06:05Z.
What
The guest path resolver reset the component length at a backslash, as at a slash, so a 301-byte name containing one passed the
NAME_MAXcheck. FreeBSD 11.4'snameitreats a backslash as an ordinary name character (theGuest path namesentry indocs/dev/debt/libc.md, whichGuestPathNameLength.cpppinned with "FreeBSD would refuse the 301-byte name").Resolve(General.cpp); such a name now fails withENAMETOOLONG. The resolver still turns a backslash into a slash before the host call, which the debt entry keeps as the remaining gap.GuestPathNameLength.cpp: 200 +\+ 100 bytes fails withENAMETOOLONG; 127 +\+ 127 (255 bytes) does not.Tested
Linux (Debian 13, GCC 14.2.0, Release), on
mainec7369ecb8.ctest -R '^guest_path_name_length$': passed.main'sGeneral.cppand this branch's test,guest_path_name_lengthfails at the 301-byte check (ENOENTinstead ofENAMETOOLONG).ctest(5896 tests,-j 12) with this branch and my other twelve branches of this round merged ontomain521fb7fec4: 5880 passed. The 16 failures are the set that fails onmainin the same environment: sixagc_drivercases (agc_driver_image_table_packed_guardspasses when run on its own) and ten that need a.gitdirectory, network or a passwd entry for the user.python3 tools/check_conventions.py --base origin/main: passed.python3 tools/pr_overlap.py --branch: failed closed on #20315, which conflicts withmain; its diff does not touch the name-length loop.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 PrivacyOnion on 2026-11-17T03:09:23Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
c6be8027de:tools/check_conventions.pypassed.guest_path_name_length_testsbuilt cleanly.guest_path_name_length):core/libs/prx/libc/src/General.cppreverted tomainand the new tests kept, the suite fails: Restoring the change makes it pass again.Looks Good To Me
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-21T12:50:28Z.
Review: COMMENTED
Reviewed — comments
The code change matches the stated length-check behavior; the new debt note describes a backslash inconsistently, and I could not run the reported checks.
What I ran
Reviewed head
c6be8027decc238433c9e30fca8dad4ce345cbffusing the supplied reader. No shell or test execution was available.Results
Findings
Blocking
None.
Non-blocking
docs/dev/debt/changes/fix-libc-path-backslash-name-length.md:3says a backslash counts as a path separator, while its following paragraph and the code change say it counts as a name character. Please correct the heading to describe the intended behavior.Sources
General.cppat the reviewed headGuestPathNameLength.cppat the reviewed headfix-libc-path-backslash-name-length.mdat the reviewed headNot verified
I read all files listed as reviewed:
core/libs/prx/libc/src/General.cpp,core/libs/tests/GuestPathNameLength.cpp, anddocs/dev/debt/changes/fix-libc-path-backslash-name-length.md. No files were excluded by the manifest. I did not run the test, convention, or overlap checks, and did not verify behavior on Windows, macOS, or a console. The description's reported Linux tests and negative control were not independently verified.To get this to a good state
Nothing is required. The optional documentation wording correction is noted above.
Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T11:23:50Z.
Review: COMMENTED
Built the submitted path checking code and ran the exact
GuestPathNameLengthfixture on Linux. It passed the new backslash cases, including the accepted 255-byte name and an overlong name containing the same character.AI-assisted: yes.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.