From 772af18205eacf95ae55a4167f7f48e917bcd5e1 Mon Sep 17 00:00:00 2001 From: Daniel J Walsh Date: Thu, 5 Sep 2019 10:30:54 -0400 Subject: 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 --- cmd/podman/main.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'cmd/podman') 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 { -- cgit v1.2.3-54-g00ecf