feat(libkernel): implement getuid, geteuid, getgid, getegid and issetugid #1650

Merged
Pedroj-64 merged 1 commit from upstream-pr/1650 into main 2026-10-09 21:04:28 +00:00
Pedroj-64 commented 2026-10-08 15:39:10 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Pedroj-64 on 2026-10-08T15:39:10Z.


What

Part of #1578. getuid, geteuid, getgid and getegid are absent imports that block 20 to 23 of the 34 relinking catalog titles, and issetugid blocks 15; none had an open PR.

They return 0, the root identity of a jailbroken process, and issetugid returns 0 (credentials never changed). The host user and group are not exposed to the guest. The values are not verified on a console, so they are recorded in TechnicalDebt.md; the NIDs resolve by name (getpid is exported the same way).

Tested

Linux: full build, libkernel.prx exports the five symbols; tools/check_conventions.py --base upstream/main passes. No title run.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw; no silent stubs added
  • No notes, investigation .md files or images added to the repository
  • New third-party code is a submodule built from source (none added)
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4789237058 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1650). Originally posted by [Pedroj-64](https://github.com/Pedroj-64) on 2026-10-08T15:39:10Z. --- ### What Part of #1578. `getuid`, `geteuid`, `getgid` and `getegid` are absent imports that block 20 to 23 of the 34 relinking catalog titles, and `issetugid` blocks 15; none had an open PR. They return 0, the root identity of a jailbroken process, and `issetugid` returns 0 (credentials never changed). The host user and group are not exposed to the guest. The values are not verified on a console, so they are recorded in `TechnicalDebt.md`; the NIDs resolve by name (`getpid` is exported the same way). ### Tested Linux: full build, `libkernel.prx` exports the five symbols; `tools/check_conventions.py --base upstream/main` passes. No title run. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except technical debt - [x] Unimplemented paths throw; no silent stubs added - [x] No notes, investigation `.md` files or images added to the repository - [x] New third-party code is a submodule built from source (none added) - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] AI-assisted: yes
github-actions[bot] commented 2026-10-08 17:08:25 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-08T17:08:25Z.


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.

Pull request Conflicting files (lines on main) Same exports Same new files
#1875 docs/dev/TechnicalDebt.md L40
#1876 docs/dev/TechnicalDebt.md L40
#1947 docs/dev/TechnicalDebt.md L40
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6065081221 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1650#issuecomment-6065081221). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-08T17:08:25Z. --- <!-- pr-overlap --> 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**. | Pull request | Conflicting files (lines on `main`) | Same exports | Same new files | |---|---|---|---| | #1875 | `docs/dev/TechnicalDebt.md` [L40](https://github.com/boykopovar/AnyPS5/blob/f145139676a48306681d3a4d5fabf83938759daf/docs/dev/TechnicalDebt.md#L40) | | | | #1876 | `docs/dev/TechnicalDebt.md` [L40](https://github.com/boykopovar/AnyPS5/blob/f145139676a48306681d3a4d5fabf83938759daf/docs/dev/TechnicalDebt.md#L40) | | | | #1947 | `docs/dev/TechnicalDebt.md` [L40](https://github.com/boykopovar/AnyPS5/blob/f145139676a48306681d3a4d5fabf83938759daf/docs/dev/TechnicalDebt.md#L40) | | |
github-actions[bot] commented 2026-10-08 21:26:21 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-08T21:26:21Z.


Progress report (4b005b2 → a294b80)

📈 System libraries: 84.78% (+0.02%, +5 implemented functions)

✅ 5 implemented
Library Name
libkernel getegid_nid_postfix
libkernel geteuid_nid_postfix
libkernel getgid_nid_postfix
libkernel getuid_nid_postfix
libkernel issetugid_nid_postfix
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6069364731 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1650#issuecomment-6069364731). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-08T21:26:21Z. --- <!-- progress-report --> ### Progress report (4b005b2 → a294b80) 📈 **System libraries**: 84.78% (+0.02%, +5 implemented functions) <details> <summary>✅ 5 implemented</summary> | Library | Name | | - | - | | libkernel | `getegid_nid_postfix` | | libkernel | `geteuid_nid_postfix` | | libkernel | `getgid_nid_postfix` | | libkernel | `getuid_nid_postfix` | | libkernel | `issetugid_nid_postfix` | </details>
CouchRiv commented 2026-10-09 04:42:41 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by CouchRiv on 2026-10-09T04:42:41Z.


Two homebrew catalog titles stop on these at load on Linux main f1451396 (catalog release, relinked with relinker --registry, run in a sandbox): PPSA99003 ProsperoTV 01.000.030 on geteuid (tvpHe5kBO4E) and PPSA99002 ProsperoLight 01.000.090 on getegid (72rYuYoDTWk).

PPSA99003: /work/runtime/app.elf: symbol lookup error: /work/runtime/app.elf: undefined symbol: tvpHe5kBO4E
PPSA99002: /work/runtime/app.elf: symbol lookup error: /work/runtime/app.elf: undefined symbol: 72rYuYoDTWk

Of the 38 catalog apps we ran, 26 import geteuid and 23 import getegid; the others stop on something else first on main.

Edit: with this PR merged onto f1451396 (same sandbox), both apps get past these: ProsperoTV's next stop is HTxb6gmexa0 (seteuid, #1748) and ProsperoLight's is 4oKwKmeOKjM (setegid, #1748). All five functions of this PR resolve in both load traces (39 -> 33 and 50 -> 45 unresolved imports), nothing new appears.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6074414831 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1650#issuecomment-6074414831). Originally posted by [CouchRiv](https://github.com/CouchRiv) on 2026-10-09T04:42:41Z. --- Two homebrew catalog titles stop on these at load on Linux `main` f1451396 (catalog release, relinked with `relinker --registry`, run in a sandbox): PPSA99003 ProsperoTV 01.000.030 on `geteuid` (`tvpHe5kBO4E`) and PPSA99002 ProsperoLight 01.000.090 on `getegid` (`72rYuYoDTWk`). ``` PPSA99003: /work/runtime/app.elf: symbol lookup error: /work/runtime/app.elf: undefined symbol: tvpHe5kBO4E PPSA99002: /work/runtime/app.elf: symbol lookup error: /work/runtime/app.elf: undefined symbol: 72rYuYoDTWk ``` Of the 38 catalog apps we ran, 26 import `geteuid` and 23 import `getegid`; the others stop on something else first on `main`. Edit: with this PR merged onto f1451396 (same sandbox), both apps get past these: ProsperoTV's next stop is `HTxb6gmexa0` (`seteuid`, #1748) and ProsperoLight's is `4oKwKmeOKjM` (`setegid`, #1748). All five functions of this PR resolve in both load traces (39 -> 33 and 50 -> 45 unresolved imports), nothing new appears.
Pedroj-64 commented 2026-10-09 11:58:08 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Pedroj-64 on 2026-10-09T11:58:08Z.


Thanks for testing it with the catalog titles. The remaining failures (seteuid/setegid) are covered by #1748, so there are no pending changes here.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6080388560 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1650#issuecomment-6080388560). Originally posted by [Pedroj-64](https://github.com/Pedroj-64) on 2026-10-09T11:58:08Z. --- Thanks for testing it with the catalog titles. The remaining failures (`seteuid`/`setegid`) are covered by #1748, so there are no pending changes here.
popcoder565 commented 2026-10-09 15:45:46 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by popcoder565 on 2026-10-09T15:45:46Z.


Native Windows run, since no Windows results were posted. Setup: Windows 10 (19045), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release. Head a294b80d, merged onto main d70b8998 in one build with 38 other PRs that had no Windows run.

  • This PR has no test of its own. It builds, and the full suite passes.
  • Full ctest in that build: 519 of 519. That needed local fixes to three other PRs in the batch that don't build or pass on Windows: #1611, #1796 and #1824 (reported there).

No title was run.

🤖 Addressed by Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6084260921 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1650#issuecomment-6084260921). Originally posted by [popcoder565](https://github.com/popcoder565) on 2026-10-09T15:45:46Z. --- Native Windows run, since no Windows results were posted. Setup: Windows 10 (19045), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release. Head `a294b80d`, merged onto `main` d70b8998 in one build with 38 other PRs that had no Windows run. - This PR has no test of its own. It builds, and the full suite passes. - Full ctest in that build: 519 of 519. That needed local fixes to three other PRs in the batch that don't build or pass on Windows: #1611, #1796 and #1824 (reported there). No title was run. _🤖 Addressed by [Claude Code](https://claude.com/claude-code)_
Pedroj-64 commented 2026-10-09 15:58:28 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Pedroj-64 on 2026-10-09T15:58:28Z.


Thanks @popcoder565 for the Windows run: it builds and the full suite passes. There are no pending changes here.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6084474880 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1650#issuecomment-6084474880). Originally posted by [Pedroj-64](https://github.com/Pedroj-64) on 2026-10-09T15:58:28Z. --- Thanks @popcoder565 for the Windows run: it builds and the full suite passes. There are no pending changes here.
adriadam10 commented 2026-10-09 21:04:25 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-09T21:04:25Z.


Checked: build + full ctest (518/518) on top of current main, CI green on the head, no other open PR implements these exports. The returned values (0, root identity; issetugid 0) are unverified on a console and are recorded in TechnicalDebt.md under "Unknown function info"; shadPS4 returns 1 for getuid but only as a PS4 stub. Merging.

Please add a small guest test in a follow-up PR that pins the five return values, so a later change to them shows up in ctest.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6089231780 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1650#issuecomment-6089231780). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-09T21:04:25Z. --- Checked: build + full ctest (518/518) on top of current main, CI green on the head, no other open PR implements these exports. The returned values (0, root identity; `issetugid` 0) are unverified on a console and are recorded in `TechnicalDebt.md` under "Unknown function info"; shadPS4 returns 1 for `getuid` but only as a PS4 stub. Merging. Please add a small guest test in a follow-up PR that pins the five return values, so a later change to them shows up in ctest.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!1650
No description provided.