Skip to content

Commit

Permalink
fcrypt: consider TMP, TEMP, TEMPDIR for finding the temporary directory
Browse files Browse the repository at this point in the history
See ElektraInitiative#1973 for further details.
  • Loading branch information
petermax2 authored and omnidan committed Jun 18, 2018
1 parent 854e31d commit b33d24c
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/plugins/fcrypt/fcrypt.c
Expand Up @@ -78,6 +78,24 @@ static char * getTemporaryFileName (KeySet * conf, const char * file, int * fd)
tmpDir = getenv ("TMPDIR");
}

if (!tmpDir)
{
// check the environment; returns NULL if no match is found
tmpDir = getenv ("TMP");
}

if (!tmpDir)
{
// check the environment; returns NULL if no match is found
tmpDir = getenv ("TEMP");
}

if (!tmpDir)
{
// check the environment; returns NULL if no match is found
tmpDir = getenv ("TEMPDIR");
}

if (!tmpDir)
{
// fallback
Expand Down

0 comments on commit b33d24c

Please sign in to comment.