note 105150 added to function.umask
| From: | neon at neonjs dot com | Date: | Sat, 30 Jul 2011 14:19:44 +0000 |
| Subject: | note 105150 added to function.umask | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-182018@lists.php.net to get a copy of this message | ||
In case you don't understand why you need to "Avoid using this function in multithreaded
webservers":
It's because this function changes the umask at the process level, rather than only for PHP or
for the current script. If there are multiple simultaneous threads running in the process in which
your PHP script is running, the change will apply to all of those threads at the same time hence why
this is not safe for multithreaded use.
I understand that if you are using the PHP module and Apache's prefork MPM, which is not
multi-threaded, then you at least won't get race-condition problems such as this. However, it
is still worth noting that the umask setting, if not re-set, will persist for the life of that
process even if the process is re-used to serve future PHP or non-PHP requests.
----
Server IP: 69.147.83.197
Probable Submitter: 124.170.31.52
----
Manual Page -- http://www.php.net/manual/en/function.umask.php
Edit -- https://master.php.net/note/edit/105150
Del: integrated -- https://master.php.net/note/delete/105150/integrated
Del: useless -- https://master.php.net/note/delete/105150/useless
Del: bad code -- https://master.php.net/note/delete/105150/bad+code
Del: spam -- https://master.php.net/note/delete/105150/spam
Del: non-english -- https://master.php.net/note/delete/105150/non-english
Del: in docs -- https://master.php.net/note/delete/105150/in+docs
Del: other reasons-- https://master.php.net/note/delete/105150
Reject -- https://master.php.net/note/reject/105150
Search -- https://master.php.net/manage/user-notes.php