From: moodler Date: Sun, 19 Jan 2003 05:54:08 +0000 (+0000) Subject: If we create a directory, then chmod it to protect the contents. X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=fe2874294cb8840b0b238ff71ffebf362be77b7f;p=moodle.git If we create a directory, then chmod it to protect the contents. --- diff --git a/lib/moodlelib.php b/lib/moodlelib.php index e45d4fa638..cf5708e4fd 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -751,11 +751,13 @@ function make_upload_directory($directory) { global $CFG; $currdir = $CFG->dataroot; + if (!file_exists($currdir)) { if (! mkdir($currdir, 0750)) { notify("ERROR: You need to create the directory $currdir with web server write access"); return false; } + chmod($currdir,0750); } $dirarray = explode("/", $directory); @@ -767,6 +769,7 @@ function make_upload_directory($directory) { notify("ERROR: Could not find or create a directory ($currdir)"); return false; } + chmod($currdir,0750); } }