summaryrefslogtreecommitdiff
path: root/libpod
diff options
context:
space:
mode:
authorDivyansh Kamboj <kambojdivyansh2000@gmail.com>2019-05-16 20:57:39 +0530
committerDivyansh Kamboj <kambojdivyansh2000@gmail.com>2019-05-19 06:51:30 +0530
commitee3381f8f2471513dd258dcb64568b57ad4e30d5 (patch)
treec32e794337fb3a4ab30c2aa28c186761cb45fd7e /libpod
parent00ecbfc1315a62940202574fb45f2ae2f4c48b63 (diff)
downloadpodman-ee3381f8f2471513dd258dcb64568b57ad4e30d5.tar.gz
podman-ee3381f8f2471513dd258dcb64568b57ad4e30d5.tar.bz2
podman-ee3381f8f2471513dd258dcb64568b57ad4e30d5.zip
Minor fix splitting env vars in podman-commit
`string.Split()` splits into slice of size greater than 2 which may result in loss of environment variables fixes #3132 Signed-off-by: Divyansh Kamboj <kambojdivyansh2000@gmail.com>
Diffstat (limited to 'libpod')
-rw-r--r--libpod/container_commit.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/libpod/container_commit.go b/libpod/container_commit.go
index ae04f67bb..739fcd80e 100644
--- a/libpod/container_commit.go
+++ b/libpod/container_commit.go
@@ -99,7 +99,7 @@ func (c *Container) Commit(ctx context.Context, destImage string, options Contai
// Should we store the ENV we actually want in the spec separately?
if c.config.Spec.Process != nil {
for _, e := range c.config.Spec.Process.Env {
- splitEnv := strings.Split(e, "=")
+ splitEnv := strings.SplitN(e, "=", 2)
importBuilder.SetEnv(splitEnv[0], splitEnv[1])
}
}