Skip to content

Commit

Permalink
Allow users to specify TMPDIR in containers.conf
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
rhatdan committed Dec 15, 2020
1 parent 999d40d commit d5e05a4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 0 additions & 5 deletions cmd/podman/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
4 changes: 4 additions & 0 deletions cmd/podman/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit d5e05a4

Please sign in to comment.