elementary/mode/access - set file create mode before create temp file.

SVN revision: 82446
This commit is contained in:
ChunEon Park 2013-01-09 09:17:33 +00:00
parent 081f9f8006
commit db9cad3932
1 changed files with 3 additions and 0 deletions

View File

@ -63,9 +63,12 @@ out_read(const char *txt)
if (!tmpf)
{
char buf[PATH_MAX];
mode_t cur_umask;
snprintf(buf, sizeof(buf), "/tmp/.elm-speak-XXXXXX");
cur_umask = umask(S_IRWXO | S_IRWXG);
tmpfd = mkstemp(buf);
umask(cur_umask);
if (tmpfd >= 0) tmpf = strdup(buf);
else return;
}