diff options
author | Valentin Rothberg <rothberg@redhat.com> | 2021-02-16 14:15:21 +0100 |
---|---|---|
committer | Matthew Heon <mheon@redhat.com> | 2021-02-18 10:29:31 -0500 |
commit | 32350c758ddfef52a53e7d74d4a68785bc54aaef (patch) | |
tree | c99d24ba13d7b8add08b58071cae9dcfe7601656 /libpod | |
parent | bddbe989e3cd19158c1dbc86a92629b70fa4c9e9 (diff) | |
download | podman-32350c758ddfef52a53e7d74d4a68785bc54aaef.tar.gz podman-32350c758ddfef52a53e7d74d4a68785bc54aaef.tar.bz2 podman-32350c758ddfef52a53e7d74d4a68785bc54aaef.zip |
do not set empty $HOME
Make sure to not set an empty $HOME for containers and let it default to
"/".
https://github.com/containers/crun/pull/599 is required to fully
address #9378.
Partially-Fixes: #9378
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
<MH: Fixed cherry-pick conflicts>
Signed-off-by: Matthew Heon <mheon@redhat.com>
Diffstat (limited to 'libpod')
-rw-r--r-- | libpod/container_internal_linux.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libpod/container_internal_linux.go b/libpod/container_internal_linux.go index 952cc42d1..8a55f01b1 100644 --- a/libpod/container_internal_linux.go +++ b/libpod/container_internal_linux.go @@ -457,7 +457,7 @@ func (c *Container) generateSpec(ctx context.Context) (*spec.Spec, error) { break } } - if !hasHomeSet { + if !hasHomeSet && execUser.Home != "" { c.config.Spec.Process.Env = append(c.config.Spec.Process.Env, fmt.Sprintf("HOME=%s", execUser.Home)) } |