Skip to content
Browse files

MDL-30621 more dataroot protection

  • Loading branch information...
1 parent abf82af commit f9c5bd923412e7eb7451f9d0298474407d57a36d @skodak skodak committed Dec 12, 2011
Showing with 4 additions and 0 deletions.
  1. +4 −0 lib/setuplib.php
View
4 lib/setuplib.php
@@ -1196,6 +1196,8 @@ function make_temp_directory($directory, $exceptiononerror = true) {
if ($CFG->tempdir !== "$CFG->dataroot/temp") {
check_dir_exists($CFG->tempdir, true, true);
protect_directory($CFG->tempdir);
+ } else {
+ protect_directory($CFG->dataroot);
}
return make_writable_directory("$CFG->tempdir/$directory", $exceptiononerror);
}
@@ -1212,6 +1214,8 @@ function make_cache_directory($directory, $exceptiononerror = true) {
if ($CFG->cachedir !== "$CFG->dataroot/cache") {
check_dir_exists($CFG->cachedir, true, true);
protect_directory($CFG->cachedir);
+ } else {
+ protect_directory($CFG->dataroot);
}
return make_writable_directory("$CFG->cachedir/$directory", $exceptiononerror);
}

0 comments on commit f9c5bd9

Please sign in to comment.
Something went wrong with that request. Please try again.