MDL-40642 set more restrictive umask and use proper permission for new dirs and files

This commit is contained in:
Petr Škoda
2013-07-19 09:18:44 +02:00
parent ffc3f5308b
commit eb459f7192
25 changed files with 52 additions and 15 deletions
+3
View File
@@ -582,6 +582,8 @@ function clam_handle_infected_file($file, $userid=0, $basiconly=false) {
* @return boolean
*/
function clam_replace_infected_file($file) {
global $CFG;
$newcontents = get_string('virusplaceholder');
if (!$f = fopen($file, 'w')) {
return false;
@@ -589,6 +591,7 @@ function clam_replace_infected_file($file) {
if (!fwrite($f, $newcontents)) {
return false;
}
@chmod($file, $CFG->filepermissions);
return true;
}