Return the user's umask, caching the result. FIXME: If the destination's parent directory has has a default ACL, some operating systems (e.g., GNU/Linux's "POSIX" ACLs) use that ACL's mask rather than the process umask. Currently, the callers of cached_umask incorrectly assume that this situation cannot occur. */
| 2885 | ACL's mask rather than the process umask. Currently, the callers |
| 2886 | of cached_umask incorrectly assume that this situation cannot occur. */ |
| 2887 | extern mode_t |
| 2888 | cached_umask (void) |
| 2889 | { |
| 2890 | static mode_t mask; |
| 2891 | static bool cached; |
| 2892 | if (!cached) |
| 2893 | { |
| 2894 | cached = true; |
| 2895 | mask = umask (0); |
| 2896 | umask (mask); |
| 2897 | } |
| 2898 | return mask; |
| 2899 | } |
no outgoing calls
no test coverage detected