From: Sebastian Dransfeld Date: Wed, 16 Oct 2013 02:56:51 +0000 (+0200) Subject: eina: And guard the right function with umask X-Git-Tag: submit/devel/efl/20131029.075644~53 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0b26b1bd8950b0e385a2f96c3a123d0dee1b67b4;p=platform%2Fupstream%2Fefl.git eina: And guard the right function with umask Thanks Cedric. --- diff --git a/src/lib/eina/eina_file_common.c b/src/lib/eina/eina_file_common.c index 9a222c2..3a68345 100644 --- a/src/lib/eina/eina_file_common.c +++ b/src/lib/eina/eina_file_common.c @@ -878,15 +878,16 @@ eina_file_mkstemp(const char *templatename, Eina_Tmpstr **path) tmpdir = (char *)evil_tmpdir_get(); #endif /* ! HAVE_EVIL */ + snprintf(buffer, PATH_MAX, "%s/%s", tmpdir, templatename); + /* * Make sure temp file is created with secure permissions, * http://man7.org/linux/man-pages/man3/mkstemp.3.html#NOTES */ old_umask = umask(0077); - snprintf(buffer, PATH_MAX, "%s/%s", tmpdir, templatename); + fd = mkstemp(buffer); umask(old_umask); - fd = mkstemp(buffer); if (path) *path = eina_tmpstr_add(buffer); if (fd < 0) return -1;