On 29/10/2005, "Andrew Alderwick" <[EMAIL PROTECTED]> wrote:
>On 29/10/2005, "Ondra Kudlik" <[EMAIL PROTECTED]> wrote:
>>Sat, Oct 29, 2005 ve 11:21:54PM +0100, Andrew Alderwick napsal:
>>> [...] Am I missing something?
>>
>>Yeah :) Apache user has sufficient privileges, but...
>>[...]
>
>Thanks for that, Ondra! I see now.
>
>[...]
>
>+ // we must set umask, because it override mkdir mode
>+ if (!fs_exists($partial_path)) {
>+ $oldumask = umask(0077);
>+ $mkdir_okay = mkdir($partial_path, 0700);
>+ umask($oldumask); // set it back
>+ if (!$mkdir_okay) return false;
>+ }
Even better (mitigates problems with multithreaded web servers, and
avoids use of another temp variable):
+ if (!fs_exists($partial_path)) {
+ if (!mkdir($partial_path, 0700)) return false;
+ chmod($partial_path, 0700);
+ }
Andy
-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
Ilohamail-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ilohamail-devel