feat(libSceUserService): take the user name from ANYPS5_USER_NAME #9345
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/9345"
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 Techx3 on 2026-10-21T18:59:29Z.
What
sceUserServiceGetUserNamereportsANYPS5_USER_NAMEwhen it is set and not empty, so a launcher can show its own user's name in games. Unset or empty keepsPlayer. A name longer than 16 bytes throws with the variable's name, likeANYPS5_LANGUAGE. Documented indocs/user/USAGE.mdanddocs/dev/ENVIRONMENT.md;GuestUserServiceUserNamecovers set, empty, UTF-8, 16 and 17 bytes, and the short buffer with a name set.Tested
Linux, g++: built
libSceUserService/Export.cppwithcore/libs/tests/GuestUserServiceUserName.cpp; the test passes, and fails againstmain. Not checked in a title that shows the user name.tools/check_conventions.py --base origin/mainpasses.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 ycbuzi on 2026-10-21T22:41:56Z.
Windows run of
753030c31cmerged ontomaina6dcea9279(6dd107b324, clean), the platform the description lists as not tested. Windows 11 Home 10.0.26200, MinGW-w64 GCC 15.2.0 (ucrt-posix-seh r7), Release,BUILD_TESTING=ON.Built
libSceUserServiceandguest_user_service_user_name_testswith no errors or warnings.guest_user_service_user_namefails on Windows: the new length check throws insidelibSceUserService.prx, and the test'scatchnever receives it:Exit code
0xc0000409. On MinGW the libraries are built with-fno-asynchronous-unwind-tables, so a test that catches an exception from one needsconfigure_windows_unwind;guest_user_service_testsin the sameCMakeLists.txthas it,guest_user_service_user_name_testsdoes not. With this one line added after itstarget_link_libraries(merge 0499f95b39), the test passes on both repeats ofctest --repeat until-fail:2:Not run: a title.
Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-22T04:41:18Z.
Linux data point for
753030c31c(WSL2, Ubuntu 24.04, kernel 6.18 - a virtualised kernel, not bare-metal Linux; GCC 13.3, Release,BUILD_TESTING=ON), this head merged ontomaindf2569d2c5(clean merge). I builtguest_user_service_user_name_testsand ran the executable directly (exit code, not throughctest):main, withcore/libs/prx/libSceUserService/Export.cpp and UserService.hppreset tomain): it aborts (SIGABRT, exit code 134).Not tested: macOS, Windows, the rest of the test suite.
AI-assisted (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by harisibrar1 on 2026-10-22T13:42:54Z.
Review: COMMENTED
Checked against main
8b3e39832a(sceUserServiceGetUserNamestill copies"Player";ANYPS5_LANGUAGEinSystemService.hppas the pattern) and a local Windows probe of the UCRTgetenv:Jos\xc3\xa9), but on Windowsstd::getenvreturns the value in the ANSI code page. On my Windows 11 machine (ACP 1252), withANYPS5_USER_NAMEset from PowerShell, ucrtbase'sgetenvreturnedJos\xe9forJosé(not valid UTF-8),?????forユーザー名, and 9 bytes forÉÉÉÉÉÉÉÉÉ, which passes the 16-byte check though the UTF-8 name is 18 bytes._putenv_s, which round-trips the same narrow bytes, so it can't see this._wgetenvon Windows (ANYPS5_INPUT_CONFIGinInputMapping.cpp,ANYPS5_SHADER_CACHE_DIRinShaderDiskCache.cpp). Doing the same here and converting to UTF-8 before the length check would make the 16-byte limit and the USAGE.md wording hold on Windows.Reviewed with AI assistance (Claude Code); the checks above were run locally on my machine.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-17T05:28:21Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this; the points below are optional.
What I ran
753030c31c4abfe0529dd0ed573ca0af9eb341e3, basemain. No build and no test run in this review.repo_read.py) forANYPS5_USER_NAME,ANYPS5_LANGUAGEand the new function.UserService.hppandGuestUserServiceUserName.cppin full; the changed function inExport.cpp(lines 128–143); the changed sections ofdocs/dev/ENVIRONMENT.mdanddocs/user/USAGE.md.Results
GuestUserServiceUserNametesttools/check_conventions.pyANYPS5_LANGUAGEFindings
Blocking
None.
Non-blocking
docs/user/USAGE.md:239says a longer name "stops the game at its first user name query". A query with a buffer under 17 bytes returnsUSER_SERVICE_ERROR_BUFFER_TOO_SHORTbefore the variable is read (core/libs/prx/libSceUserService/Export.cpp:139), so the error waits for a query with a buffer of 17 bytes or more. Consider saying so in the sentence.Sources
sceUserServiceGetUserNameUserServiceUserNameANYPS5_LANGUAGEpatternNot verified
GuestUserServiceUserNametest, and the Windows_putenv_sbranch. These are the author's reports only.tools/check_conventions.py, the claim that no other open PR implements these functions, and the title that shows the name (the author also says that one was not checked).docs/dev/ENVIRONMENT.mdanddocs/user/USAGE.mdwere read, not the full files.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T12:02:53Z.
Review: COMMENTED
Compiled the changed UserService implementation with
GuestUserServiceUserNameagainst the existing Linux PRXs. It passed the default, ASCII and UTF-8 overrides, length boundary, and too-short destination cases.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.