fix(libkernel_sys): implement fchown #8531
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/8531"
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 PayloadAnim on 2026-10-20T15:18:21Z.
What
Implement
fchownusing the host call on Linux. Guest owner and group ID0remain unchanged because the guest runs as root while the host process may not. On Windows, validate the descriptor and returnEOPNOTSUPPfor ownership changes the host cannot represent. Update the technical debt note with these platform limits.Tested
Windows:
cmake --build build --target libkernel_syscompleted successfully.python3 tools/check_conventions.py --base origin/mainandrtk git diff --checkpassed. The overlap script could not run becauseghis unavailable; an open PR search found #8457, which also concernsfchown.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-20T15:19:15Z.
Progress report (
d073fe6→ed66166)📈 System libraries: 64.02% (+0.01%, +1 implemented functions)
✅ 1 implemented
fchown_nid_postfixImported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-20T15:32:21Z.
Some 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_sys/Export.cppcore/libs/prx/libkernel_sys/Export.cppcore/libs/prx/libkernel_sys/Export.cppdocs/dev/debt/libkernel_sys.mdcore/libs/prx/libkernel_sys/Export.cppcore/libs/prx/libkernel_sys/Export.cppdocs/dev/debt/libkernel_sys.mdcore/libs/prx/libkernel_sys/Export.cppdocs/dev/debt/libkernel_sys.mdcore/libs/prx/libkernel_sys/Export.cppcore/libs/prx/libkernel_sys/Export.cppdocs/dev/debt/libkernel_sys.mdcore/libs/prx/libkernel_sys/Export.cppcore/libs/prx/libkernel_sys/Export.cppdocs/dev/debt/libkernel_sys.mdcore/libs/prx/libkernel_sys/Export.cppdocs/dev/debt/libkernel_sys.mdcore/libs/prx/libkernel_sys/Export.cppcore/libs/prx/libkernel_sys/Export.cppcore/libs/prx/libkernel_sys/Export.cppdocs/dev/debt/libkernel_sys.mdcore/libs/prx/libkernel_sys/Export.cppdocs/dev/debt/libkernel_sys.mddocs/dev/debt/libkernel_sys.mdcore/libs/prx/libkernel_sys/Export.cppdocs/dev/debt/libkernel_sys.mddocs/dev/debt/libkernel_sys.mddocs/dev/debt/libkernel_sys.mdcore/libs/prx/libkernel_sys/Export.cppdocs/dev/debt/libkernel_sys.mdcore/libs/prx/libkernel_sys/Export.cppdocs/dev/debt/libkernel_sys.mdcore/libs/prx/libkernel_sys/Export.cppdocs/dev/debt/libkernel_sys.mddocs/dev/debt/libkernel_sys.mddocs/dev/debt/libkernel_sys.mdcore/libs/prx/libkernel_sys/Export.cppdocs/dev/debt/libkernel_sys.mdcore/libs/prx/libkernel_sys/Export.cppdocs/dev/debt/libkernel_sys.mdcore/libs/prx/libkernel_sys/Export.cppdocs/dev/debt/libkernel_sys.mdcore/libs/prx/libkernel_sys/Export.cppcore/libs/prx/libkernel_sys/Export.cppcore/libs/prx/libkernel_sys/Export.cppdocs/dev/debt/libkernel_sys.mddocs/dev/debt/libkernel_sys.mdcore/libs/prx/libkernel_sys/Export.cppcore/libs/prx/libkernel_sys/Export.cppImported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-20T23:08:53Z.
@xxLnolan Thanks. #8457 changes the same lines and got the same question, so I'll keep it consistent:
EOPNOTSUPPfor another owner isn't what the console would say. The guest runs as root here (getuidreturns 0), and FreeBSD lets root change ownership, so the reference answer is success, which we can't honour because ownership isn't modelled. In that case the rule is to keep throwing (asmaindoes) rather than return an invented error.fchownmixes two ID spaces: the console's IDs mean nothing on the host. As a normal user it fails with a hostEPERM, and run as root it would really change the owner of the user's files. It also makes Linux and Windows answer the same call differently.What I'd keep from this change is checking the descriptor before the owner (
EBADFfirst, as FreeBSD does). If you have a measurement from a PS5 title process showing the actual result for another owner, that would let us implement it properly.Pull request closed