diff options
author | Daniel J Walsh <dwalsh@redhat.com> | 2019-09-05 10:30:54 -0400 |
---|---|---|
committer | Daniel J Walsh <dwalsh@redhat.com> | 2019-09-05 10:31:25 -0400 |
commit | 772af18205eacf95ae55a4167f7f48e917bcd5e1 (patch) | |
tree | 7cea1ab4a4fc375df57d88ca0606ad684533a9f6 /cmd/podman/main.go | |
parent | f1a3e02aea68a37f85cb924c934be1bcc4131d7d (diff) | |
download | podman-772af18205eacf95ae55a4167f7f48e917bcd5e1.tar.gz podman-772af18205eacf95ae55a4167f7f48e917bcd5e1.tar.bz2 podman-772af18205eacf95ae55a4167f7f48e917bcd5e1.zip |
Set TMPDIR to /var/tmp by default
We have had some issues with users squashing large images or pulling large
content from github, that could trigger crashes based on the size of /tmp.
Docker had an issue with this back in 2016. https://github.com/golang/go/issues/14021
The discussion there was to change the default to /var/tmp.
This change will only effect systems that do not set the TMPDIR environment variable.
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'cmd/podman/main.go')
-rw-r--r-- | cmd/podman/main.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/cmd/podman/main.go b/cmd/podman/main.go index dc44a9110..2b808b2bc 100644 --- a/cmd/podman/main.go +++ b/cmd/podman/main.go @@ -145,6 +145,10 @@ func main() { if reexec.Init() { return } + // Hard code TMPDIR functions to use /var/tmp, if user did not override + if _, ok := os.LookupEnv("TMPDIR"); !ok { + os.Setenv("TMPDIR", "/var/tmp") + } if err := rootCmd.Execute(); err != nil { outputError(err) } else { |