Overview
| Artifact ID: | a458a28f2b6f7662b675e9a526995d066f6d9fd9d44e8e7f38963d5572e5192c |
|---|---|
| Ticket: | cd609219f5522f3191a68a84deb51a968dfb8cac
directory creation temporarily changes the umask |
| User & Date: | christian.nassau on 2023-04-06 10:43:17 |
Changes
- icomment:
Note that in a multi-threaded application this code can be highly problematic: if two threads simultaneously try to create a directory, both might be stepping through these lines at the same time. If it happens in this sequence the processes' umask will end up permanently set to "0": <blockquote> <pre> thread 1 | thread 2 mode = umask(0); | | mode = umask(0); umask(mode) | | umask(mode) </pre> </blockquote> If a multithreaded process spawns a pool of threads which all try to create the same directory on startup that might not be an unlikely coincidence. - login: "christian.nassau"
- mimetype: "text/html"