Refactor process identity to support unified fakeroot mode#114
Open
doanbaotrung wants to merge 1 commit into
Open
Refactor process identity to support unified fakeroot mode#114doanbaotrung wants to merge 1 commit into
doanbaotrung wants to merge 1 commit into
Conversation
Collaborator
Author
|
Fix #103 |
jserv
reviewed
Jul 1, 2026
| @echo " LD $@" | ||
| $(Q)$(CC) $(CFLAGS) -o $@ $^ | ||
|
|
||
|
|
jserv
requested changes
Jul 1, 2026
jserv
left a comment
Contributor
There was a problem hiding this comment.
Mention the default value (false) of fakeroot mode and its limitations in git commit messages.
Replace the raw numeric UID/GID overrides (ELFUSE_GUEST_UID and ELFUSE_GUEST_GID) with a unified --fakeroot CLI switch and ELFUSE_FAKEROOT=1 environment variable. This change aligns the process identity surface with the existing fakeroot-style chown-overlay. When fakeroot mode is enabled: - The emulated process UID, EUID, SUID, GID, EGID, and SGID are set to 0 (root). - sc_capget() returns full capability sets, with the high capability word masked to LINUX_CAP_LAST_CAP to prevent impossible capabilities. - sys_getgroups() returns a single supplementary group (GID 0). Fakeroot mode defaults to false (disabled). In this default state, the guest process runs with an unprivileged emulated identity (UID/GID 1000). Limitations of fakeroot mode: - It only emulates root status on the guest-identity surface (getuid, geteuid, capget, getgroups, etc.) and virtual file attributes inside the guest (chown-overlay). - It does NOT grant real host-level root privileges, nor does it bypass macOS sandboxing, file system permissions, or other host-level security constraints. Also increase child_argv size in forkipc.c to 16 to prevent overflow when propagating optional flags, and update host and guest tests to adapt to the fakeroot behavior.
Collaborator
Author
|
Updated |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refactor process identity to support unified fakeroot mode
Replace the raw numeric UID/GID overrides (ELFUSE_GUEST_UID and
ELFUSE_GUEST_GID) with a unified --fakeroot CLI switch and
ELFUSE_FAKEROOT=1 environment variable.
This change aligns the process identity surface with the existing
fakeroot-style chown-overlay. When fakeroot mode is enabled:
to 0 (root).
word masked to LINUX_CAP_LAST_CAP to prevent impossible capabilities.
Fakeroot mode defaults to false (disabled). In this default state, the
guest process runs with an unprivileged emulated identity (UID/GID 1000).
Limitations of fakeroot mode:
geteuid, capget, getgroups, etc.) and virtual file attributes inside
the guest (chown-overlay).
macOS sandboxing, file system permissions, or other host-level security
constraints.
Also increase child_argv size in forkipc.c to 16 to prevent overflow
when propagating optional flags, and update host and guest tests to
adapt to the fakeroot behavior.
Summary by cubic
Introduce a unified fakeroot mode that emulates root identity and capabilities, replacing numeric UID/GID overrides. This lets package managers and other root-checking tools run without host sudo.
New Features
--fakerootflag andELFUSE_FAKEROOT=1env enable root emulation (default off).capgetreports full sets (masked toLINUX_CAP_LAST_CAP);getgroupsreturns[0].--fakeroot.Refactors
ELFUSE_GUEST_UID/ELFUSE_GUEST_GID; AUX vector and/proc/*/statusnow read fromproc_get_*.test-identity-override-hostand hooked intomake check.Written for commit 4a5626e. Summary will update on new commits.