MDL-40642 set more restrictive umask and use proper permission for new dirs and files
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user