Allow users to set TMPDIR environment

Some users have small /var/tmp directories and need to be able to specify a different location
for temporary files, which includes more space.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
Daniel J Walsh
2020-03-06 07:39:32 -05:00
parent f07e18f05c
commit cb51707f91
7 changed files with 23 additions and 5 deletions

View File

@ -600,3 +600,12 @@ func HomeDir() (string, error) {
}
return home, nil
}
func Tmpdir() string {
tmpdir := os.Getenv("TMPDIR")
if tmpdir == "" {
tmpdir = "/var/tmp"
}
return tmpdir
}