elementary/mode/access - set file create mode before create temp file.
authorChunEon Park <hermet@hermet.pe.kr>
Wed, 9 Jan 2013 09:17:33 +0000 (09:17 +0000)
committerChunEon Park <hermet@hermet.pe.kr>
Wed, 9 Jan 2013 09:17:33 +0000 (09:17 +0000)
SVN revision: 82446

legacy/elementary/src/modules/access_output/mod.c

index 3956a40..91e5bb2 100644 (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;
      }