forked from enlightenment/efl
eina: fix potential security issue.
This also follow the behavior of eina_file_mkstemp. Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
This commit is contained in:
parent
5bb1c52e3a
commit
2aa2b63907
|
@ -85,8 +85,13 @@ eina_environment_tmp_get(void)
|
||||||
|
|
||||||
return tmp;
|
return tmp;
|
||||||
#else
|
#else
|
||||||
|
# if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
|
||||||
|
if (getuid() == geteuid())
|
||||||
|
# endif
|
||||||
|
{
|
||||||
tmp = getenv("TMPDIR");
|
tmp = getenv("TMPDIR");
|
||||||
if (!tmp) tmp = getenv("XDG_RUNTIME_DIR");
|
if (!tmp) tmp = getenv("XDG_RUNTIME_DIR");
|
||||||
|
}
|
||||||
if (!tmp) tmp = "/tmp";
|
if (!tmp) tmp = "/tmp";
|
||||||
|
|
||||||
return tmp;
|
return tmp;
|
||||||
|
|
Loading…
Reference in New Issue