forked from enlightenment/efl
parent
cc89eb2af9
commit
67a8feeb08
|
@ -225,6 +225,7 @@ main(int argc, char **argv)
|
||||||
int i;
|
int i;
|
||||||
char file[PATH_MAX] = { '\0' };
|
char file[PATH_MAX] = { '\0' };
|
||||||
char util_file[PATH_MAX] = { '\0' };
|
char util_file[PATH_MAX] = { '\0' };
|
||||||
|
mode_t um;
|
||||||
|
|
||||||
if (!eina_init()) goto eina_error;
|
if (!eina_init()) goto eina_error;
|
||||||
_efreet_desktop_cache_log_dom =
|
_efreet_desktop_cache_log_dom =
|
||||||
|
@ -296,14 +297,20 @@ main(int argc, char **argv)
|
||||||
|
|
||||||
/* create cache */
|
/* create cache */
|
||||||
snprintf(file, sizeof(file), "%s.XXXXXX", efreet_desktop_cache_file());
|
snprintf(file, sizeof(file), "%s.XXXXXX", efreet_desktop_cache_file());
|
||||||
|
/* set secure umask for temporary files */
|
||||||
|
um = umask(0077);
|
||||||
tmpfd = mkstemp(file);
|
tmpfd = mkstemp(file);
|
||||||
|
umask(um);
|
||||||
if (tmpfd < 0) goto error;
|
if (tmpfd < 0) goto error;
|
||||||
close(tmpfd);
|
close(tmpfd);
|
||||||
ef = eet_open(file, EET_FILE_MODE_READ_WRITE);
|
ef = eet_open(file, EET_FILE_MODE_READ_WRITE);
|
||||||
if (!ef) goto error;
|
if (!ef) goto error;
|
||||||
|
|
||||||
snprintf(util_file, sizeof(util_file), "%s.XXXXXX", efreet_desktop_util_cache_file());
|
snprintf(util_file, sizeof(util_file), "%s.XXXXXX", efreet_desktop_util_cache_file());
|
||||||
|
/* set secure umask for temporary files */
|
||||||
|
um = umask(0077);
|
||||||
tmpfd = mkstemp(util_file);
|
tmpfd = mkstemp(util_file);
|
||||||
|
umask(um);
|
||||||
if (tmpfd < 0) goto error;
|
if (tmpfd < 0) goto error;
|
||||||
close(tmpfd);
|
close(tmpfd);
|
||||||
util_ef = eet_open(util_file, EET_FILE_MODE_READ_WRITE);
|
util_ef = eet_open(util_file, EET_FILE_MODE_READ_WRITE);
|
||||||
|
|
Loading…
Reference in New Issue