diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-01-11 09:49:34 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-11 09:49:34 -0500 |
commit | d2503ae99b773db7b9dbdf3abf3be0160ac78399 (patch) | |
tree | 437c577fcca51c0c1b769f0ae5ddec72b6b312d6 | |
parent | 3b987a7e4e0965d1971ffd300e05522567600288 (diff) | |
parent | ae9dab94457b0b35dd11db5ccb6258d8145e4d5d (diff) | |
download | podman-d2503ae99b773db7b9dbdf3abf3be0160ac78399.tar.gz podman-d2503ae99b773db7b9dbdf3abf3be0160ac78399.tar.bz2 podman-d2503ae99b773db7b9dbdf3abf3be0160ac78399.zip |
Merge pull request #8935 from giuseppe/conmon-keep-LC_
oci: keep LC_ env variables to conmon
-rw-r--r-- | libpod/oci_conmon_linux.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libpod/oci_conmon_linux.go b/libpod/oci_conmon_linux.go index 6b5da439a..16b9f0eac 100644 --- a/libpod/oci_conmon_linux.go +++ b/libpod/oci_conmon_linux.go @@ -1308,7 +1308,12 @@ func prepareProcessExec(c *Container, options *ExecOptions, env []string, sessio // configureConmonEnv gets the environment values to add to conmon's exec struct // TODO this may want to be less hardcoded/more configurable in the future func (r *ConmonOCIRuntime) configureConmonEnv(ctr *Container, runtimeDir string) ([]string, []*os.File) { - env := make([]string, 0, 6) + var env []string + for _, e := range os.Environ() { + if strings.HasPrefix(e, "LC_") { + env = append(env, e) + } + } env = append(env, fmt.Sprintf("XDG_RUNTIME_DIR=%s", runtimeDir)) env = append(env, fmt.Sprintf("_CONTAINERS_USERNS_CONFIGURED=%s", os.Getenv("_CONTAINERS_USERNS_CONFIGURED"))) env = append(env, fmt.Sprintf("_CONTAINERS_ROOTLESS_UID=%s", os.Getenv("_CONTAINERS_ROOTLESS_UID"))) |