Skip to content

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

Merged
adriadam10 merged 1 commit into
boykopovar:mainfrom
Pedroj-64:feat/libkernel-uid-gid
Oct 9, 2026
Merged

adriadam10 merged 1 commit into
boykopovar:mainfrom
Pedroj-64:feat/libkernel-uid-gid

Conversation

@Pedroj-64

Copy link
Copy Markdown
Contributor

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

@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

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

@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown

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

@CouchRiv

CouchRiv commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Two homebrew catalog titles stop on these at load on Linux main f145139 (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 f145139 (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

Pedroj-64 commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor Author

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

Copy link
Copy Markdown
Contributor

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 d70b899 in one build with 38 other PRs that had no Windows run.

No title was run.

🤖 Addressed by Claude Code

@Pedroj-64

Pedroj-64 commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor Author

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

@adriadam10

Copy link
Copy Markdown
Collaborator

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.

@adriadam10
adriadam10 merged commit 27cb335 into boykopovar:main Oct 9, 2026
7 checks passed
@Amirtheshwaran Amirtheshwaran mentioned this pull request Oct 10, 2026
6 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants