fcrypt: consider TMP, TEMP, TEMPDIR for finding the temporary directory
See for further details.
@@ -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
