Skip to content

unshare: do not cache HomeDir() when HOME is set#789

Merged
Luap99 merged 1 commit intocontainers:mainfrom
giuseppe:unshare-always-honor-HOME
Apr 24, 2026
Merged

unshare: do not cache HomeDir() when HOME is set#789
Luap99 merged 1 commit intocontainers:mainfrom
giuseppe:unshare-always-honor-HOME

Conversation

@giuseppe
Copy link
Copy Markdown
Member

Only cache the user.LookupId() fallback path, not the $HOME environment variable check. This allows tests that set a custom $HOME per test to work correctly, while still preserving the performance optimization for the slow NSS/LDAP lookup path.

Closes: #787

@github-actions github-actions Bot added the storage Related to "storage" package label Apr 24, 2026
Copy link
Copy Markdown
Member

@Luap99 Luap99 left a comment

Choose a reason for hiding this comment

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

LGTM, thanks

Comment thread storage/pkg/unshare/unshare.go Outdated
Only cache the user.LookupId() fallback path, not the $HOME
environment variable check.  This allows tests that set a custom
$HOME per test to work correctly, while still preserving the
performance optimization for the slow NSS/LDAP lookup path.

Closes: containers#787

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
@giuseppe giuseppe force-pushed the unshare-always-honor-HOME branch from c14faf6 to 522f9ce Compare April 24, 2026 17:34
@Luap99 Luap99 merged commit fe473a8 into containers:main Apr 24, 2026
37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

storage Related to "storage" package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

storage: unshare should not cache the HOME dir.

3 participants