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 61478af3a6 and
then in e105abc99e.
This commit is contained in:
Jean-Philippe Andre 2014-10-30 18:23:49 +09:00
parent fc54d85251
commit 03cc403228
1 changed files with 4 additions and 2 deletions

View File

@ -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();