From: Andrew A. <an...@al...> - 2005-10-29 22:59:15
|
On 29/10/2005, "Ondra Kudlik" <ke...@or...> 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 + $oldumask =3D umask(0077); + if (!fs_exists($partial_path) && !mkdir($partial_path, 0700)) { + umask($oldumask); // set it back + return false; + } + umask($oldumask); // set it back I only have an objection to setting the umask unnecessarily when $partial_path exists. Maybe the following would be more efficient: + // we must set umask, because it override mkdir mode + if (!fs_exists($partial_path)) { + $oldumask =3D umask(0077); + $mkdir_okay =3D mkdir($partial_path, 0700); + umask($oldumask); // set it back + if (!$mkdir_okay) return false; + } Cheers Andy |