FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix: HOME fallback for custom container user by anisaoshafi · Pull Request #88 · localstack/lambda-runtime-init · GitHub

fix: HOME fallback for custom container user - #88

Merged
anisaoshafi merged 2 commits into
localstackfrom
drg-715
Mar 31, 2026
Merged

fix: HOME fallback for custom container user#88
anisaoshafi merged 2 commits into
localstackfrom
drg-715

Conversation

anisaoshafi commented Mar 30, 2026
edited
Loading

Copy link
Copy Markdown

Context

When a container starts with --user=1000:1000, AddUser is never called so there is no /etc/passwd entry. Combined with UnsetLsEnvs stripping HOME, Node's os.homedir() and AWS SDK config loading throw ENOENT.

Changes

EnsureHome() runs once at startup after UnsetLsEnvs. If user.Current() fails (no passwd entry), it sets HOME=/tmp. The normal root-start flow is unaffected.

Testing

See test-homedir.md (will be removed) for a manual end-to-end test using a Node.js 22 function that calls os.homedir() with --user=1000:1000.

Towards DRG-715

Comment thread test-homedir.md Outdated
anisaoshafi marked this pull request as ready for review March 31, 2026 14:03

dfangl left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I think this is a sensible workaround! Where possible, we should try to actually set the right user id and home directory (sbx_user1051), however in cases where we cannot influence the user, it makes sense to have this fallback.

anisaoshafi merged commit 3335deb into localstack Mar 31, 2026
3 of 4 checks passed
anisaoshafi deleted the drg-715 branch March 31, 2026 14:32
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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL