Skip to content

Support dynamic guest identity (UID/GID) configuration via environment variables#109

Open
doanbaotrung wants to merge 1 commit into
sysprog21:mainfrom
open-sources-port:feature/dynamic_uid_gid
Open

Support dynamic guest identity (UID/GID) configuration via environment variables#109
doanbaotrung wants to merge 1 commit into
sysprog21:mainfrom
open-sources-port:feature/dynamic_uid_gid

Conversation

@doanbaotrung

@doanbaotrung doanbaotrung commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

Allow users to dynamically configure the simulated guest
UID and GID at runtime via environment variables, for
example: ELFUSE_GUEST_UID and ELFUSE_GUEST_GID.

If these variables are present in the host process
environment, elfuse should parse them and override
the default guest UID/GID.

Fixes #103


Summary by cubic

Add runtime overrides for the simulated guest UID/GID via ELFUSE_GUEST_UID and ELFUSE_GUEST_GID. The values propagate to auxv and procfs so programs see the correct identity.

  • New Features
    • Parse and validate env vars in proc_identity_init(); ignore invalid/out-of-range inputs; fall back to GUEST_UID/GUEST_GID when unset.
    • Auxv AT_UID/AT_EUID/AT_GID/AT_EGID and /proc/self/{status,task/*/status} now use proc_get_* (real/effective/saved-set plus the fourth field) so all four IDs reflect overrides.
    • Added test-identity-override-host; built and executed as part of make check.

Written for commit a9f59ab. Summary will update on new commits.

Review in cubic

@doanbaotrung doanbaotrung force-pushed the feature/dynamic_uid_gid branch from af6f40e to 8a7c0d3 Compare June 23, 2026 07:54
@doanbaotrung doanbaotrung requested a review from jserv June 23, 2026 07:54

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 issues found and verified against the latest diff

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread src/syscall/proc-identity.c Outdated
Comment thread src/syscall/proc-identity.c Outdated
Comment thread src/runtime/procemu.c Outdated
environment variables

Allow users to dynamically configure the simulated guest
UID and GID at runtime via environment variables, for
example: ELFUSE_GUEST_UID and ELFUSE_GUEST_GID.

If these variables are present in the host process
environment, elfuse should parse them and override
the default guest UID/GID.
@doanbaotrung doanbaotrung force-pushed the feature/dynamic_uid_gid branch from 8a7c0d3 to a9f59ab Compare June 23, 2026 08:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support dynamic guest identity (UID/GID) configuration via environment variables

1 participant