summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivan@redhat.com>2021-01-11 13:48:02 +0100
committerGiuseppe Scrivano <gscrivan@redhat.com>2021-01-11 13:48:04 +0100
commitae9dab94457b0b35dd11db5ccb6258d8145e4d5d (patch)
tree2c6ee62d8addd15d03e5f0c61a50f5c30c93d36a
parent41613bdb96953c9cea8a8fd46da211bd42660944 (diff)
downloadpodman-ae9dab94457b0b35dd11db5ccb6258d8145e4d5d.tar.gz
podman-ae9dab94457b0b35dd11db5ccb6258d8145e4d5d.tar.bz2
podman-ae9dab94457b0b35dd11db5ccb6258d8145e4d5d.zip
oci: keep LC_ env variables to conmon
it is necessary for conmon to deal with the correct locale, otherwise it uses C as a fallback. Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1893567 Requires: https://github.com/containers/conmon/pull/215 Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
-rw-r--r--libpod/oci_conmon_linux.go7
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")))