Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • Thanks. How would a C program, like Vim or Emacs, do it? It seems to me if they call m=umask(0) for the return value and then call umask(m) again to reset the mask they setup a race. Commented Nov 1, 2017 at 10:36
  • @jww, what race? The process umask can only be changed by the process itself. Commented Nov 1, 2017 at 10:37
  • Thanks again. It did not occur to me it was a per-process mask, and not a per-user-mask (even though the Posix page used the word "process" twice). Yeah, it looks like the Linux task_struct has a field for umask in its fs_struct. Also see Processes in the kernel docs. Commented Nov 1, 2017 at 11:55
  • "And if the web server is not configured to not serve hidden files..." - I was less concerned about this. My web server's owners are root:apache or root:www, so its enough for me to ensure the file permissions are correct. Apache won't be able to read and serve a 0600 file. Commented Nov 1, 2017 at 11:59
  • Are you the same fellow associated with Shell Shock? If so, good find. Commented Nov 1, 2017 at 12:29