summaryrefslogtreecommitdiff
path: root/cmd/podman
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2020-12-15 06:35:41 -0500
committerDaniel J Walsh <dwalsh@redhat.com>2020-12-15 06:35:43 -0500
commitd5e05a4b92955e479b4d2bf29f8c2cfeae517861 (patch)
tree173fcd1ccb7fc818e2c6500394cf37b865f732d1 /cmd/podman
parent999d40d2c76992cfd2d8c0827b7b0d00c4a2a661 (diff)
downloadpodman-d5e05a4b92955e479b4d2bf29f8c2cfeae517861.tar.gz
podman-d5e05a4b92955e479b4d2bf29f8c2cfeae517861.tar.bz2
podman-d5e05a4b92955e479b4d2bf29f8c2cfeae517861.zip
Allow users to specify TMPDIR in containers.conf
Currently we hard code TMPDIR environment variable to /var/tmp if it is not set in the Environment. This causes TMPDIR environment variable to be ignored if set in containers.conf. This change now uses the host environment TMPDIR, followed by containers.conf and then hard codes TMPDIR, if it was not set. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'cmd/podman')
-rw-r--r--cmd/podman/main.go5
-rw-r--r--cmd/podman/root.go4
2 files changed, 4 insertions, 5 deletions
diff --git a/cmd/podman/main.go b/cmd/podman/main.go
index c3aaf84a8..f076d13f3 100644
--- a/cmd/podman/main.go
+++ b/cmd/podman/main.go
@@ -31,11 +31,6 @@ func main() {
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")
- }
-
rootCmd = parseCommands()
Execute()
diff --git a/cmd/podman/root.go b/cmd/podman/root.go
index 0830a62a5..1f613a4c5 100644
--- a/cmd/podman/root.go
+++ b/cmd/podman/root.go
@@ -178,6 +178,10 @@ func persistentPreRunE(cmd *cobra.Command, args []string) error {
return err
}
}
+ // 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 !registry.IsRemote() {
if cmd.Flag("cpu-profile").Changed {