summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2014-10-30 18:23:49 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2014-10-30 18:23:49 +0900
commit03cc40322880bac36a23dab3070bc51041a1ffdc (patch)
tree0cfc0b7fbb75061d9566d97d061b38fe7caa5489
parentfc54d8525101908a2547d8e6c1800950b4286bf9 (diff)
downloadefl-03cc40322880bac36a23dab3070bc51041a1ffdc.tar.gz
Eina file: Fix calls to getenv
There seems to be an intent to check that UID==EUID before calling getenv to get the temp directory. But that was lost in commits 61478af3a6c4f9263 and then in e105abc99e717b84723ab35258375e27f17f8e82.
-rw-r--r--src/lib/eina/eina_file_common.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/eina/eina_file_common.c b/src/lib/eina/eina_file_common.c
index 5c2b87a3ca..3e5b615c79 100644
--- a/src/lib/eina/eina_file_common.c
+++ b/src/lib/eina/eina_file_common.c
@@ -908,8 +908,10 @@ eina_file_mkstemp(const char *templatename, Eina_Tmpstr **path)
#if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
if (getuid() == geteuid())
#endif
- tmpdir = getenv("TMPDIR");
- if (!tmpdir) tmpdir = getenv("XDG_RUNTIME_DIR");
+ {
+ tmpdir = getenv("TMPDIR");
+ if (!tmpdir) tmpdir = getenv("XDG_RUNTIME_DIR");
+ }
if (!tmpdir) tmpdir = "/tmp";
#else
tmpdir = (char *)evil_tmpdir_get();