Skip to content

Commit 12346b7

Browse files
committed
Permissions 775 instead of 777
1 parent 3e1ceec commit 12346b7

9 files changed

+15
-15
lines changed

php/_basic_tasks.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
$test = FALSE;
1818
// $test = TRUE;
1919

20-
$permissions = 0777;
20+
$permissions = 0775;
2121

2222
$file_path = '_settings.php';
2323
if (!file_exists($file_path)) {
@@ -3709,7 +3709,7 @@ function save_midiport($thisfilename,$acceptFilters,$passFilters,$outFilters) {
37093709
if(isset($passFilters[$i])) fwrite($file,"MIDIpassFilter\t".$i."\t".$passFilters[$i]."\n");
37103710
}
37113711
fclose($file);
3712-
chmod($thisfilename,0777);
3712+
chmod($thisfilename,0775);
37133713
return true;
37143714
}
37153715
return false;
@@ -3987,7 +3987,7 @@ function create_variables($script_variables) {
39873987
function copyDirectory($src,$dst) {
39883988
if (!is_dir($src)) return false;
39893989
// Create the destination directory if it doesn't exist
3990-
if (!is_dir($dst)) mkdir($dst, 0777, true);
3990+
if (!is_dir($dst)) mkdir($dst, 0775, true);
39913991
$dir = opendir($src);
39923992
while (false !== ($file = readdir($dir))) {
39933993
if ($file != '.' && $file != '..') {

php/_createfile.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
// Creating files in the "temp" folder
44
// This script is called by the createFile() Javascript in "produce.php"
55
// It is helpful to create a "_stop" file when the STOP button is clicked
6-
// session_write_close(); // Close the session for writing but keep it alive
76

87
set_time_limit(0);
98
$path_to_file = $_GET['path_to_file'] ?? '';
@@ -14,6 +13,7 @@
1413
if(!empty($pid)) file_put_contents($path_to_file,"pid = ".$pid);
1514
else file_put_contents($path_to_file,"ok"); // Probably better not to create empty files
1615
fclose($handle);
16+
chmod($path_to_file,0777);
1717
exec('sync'); // This makes it easier for the console to find the file, see the stop() function in ConsoleMain.c
1818
}
1919
// Attempt to kill the console!, doesn't work

php/_tonal_analysis.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1253,7 +1253,7 @@ function show_relations_on_image($i_item,$matching_list,$mode,$direction,$scalen
12531253
$thick_max = 8; $thick = array();
12541254
if(!is_dir($save_codes_dir)) {
12551255
mkdir($save_codes_dir);
1256-
chmod($save_codes_dir,0777);
1256+
chmod($save_codes_dir,0775);
12571257
}
12581258
if($mode == "harmonic") {
12591259
$direction = "both";

php/data.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -1344,10 +1344,10 @@
13441344
while($count > 0);
13451345
if(!file_exists($output)) {
13461346
echo "<p><font color=\"red\">Created folder:</font><font color=\"blue\"> ".$output."</font><br />";
1347-
if (!mkdir($output,0777, true))
1347+
if(!mkdir($output,0775, true))
13481348
error_log("Failed to create directory '{$temp_dir}' with error: " . error_get_last()['message']);
13491349
else
1350-
chmod($output,0777); // Double-check permissions
1350+
chmod($output,0775); // Double-check permissions
13511351
}
13521352
$default_output_name = str_replace("-da.",'',$filename);
13531353
$default_output_name = str_replace(".bpda",'',$default_output_name);

php/grammar.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -253,10 +253,10 @@
253253
while($count > 0);
254254
if(!file_exists($output)) {
255255
echo "<p><font color=\"red\">Created folder:</font><font color=\"blue\"> ".$output."</font><br />";
256-
if (!mkdir($output,0777, true))
256+
if(!mkdir($output,0775, true))
257257
error_log("Failed to create directory '{$temp_dir}' with error: " . error_get_last()['message']);
258258
else
259-
chmod($output,0777); // Double-check permissions
259+
chmod($output,0775); // Double-check permissions
260260
}
261261
echo link_to_help();
262262

php/index.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
}
6666
else {
6767
mkdir($dir.SLASH.$foldername);
68-
chmod($dir.SLASH.$foldername,0777);
68+
chmod($dir.SLASH.$foldername,0775);
6969
$new_file = $foldername;
7070
}
7171
}

php/produce.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -733,7 +733,7 @@
733733
if($handle) fwrite($handle,"</body>\n");
734734
if($handle) fclose($handle);
735735
}
736-
else echo "<p>No message produced… Bug in the console?";
736+
else echo "<p>No message produced…";
737737
if($trace_csound <> '' AND file_exists($trace_csound)) {
738738
$window_name = $grammar_name."_".rand(0,99)."_result";
739739
echo "&nbsp;<input style=\"color:DarkBlue; background-color:yellow; font-size:large;\" onclick=\"window.open('".$trace_csound."','".$window_name."','width=800,height=600,left=100'); return false;\" type=\"submit\" value=\"Show Csound trace\">";

php/script.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
$script_variables = $temp_dir.$temp_folder.SLASH."script_variables.php";
2929
// echo "script_variables = ".$script_variables."<br />";
3030
$dirPath = realpath("..")."/temp_bolprocessor/".$temp_folder;
31-
if (!file_exists($dirPath)) {
32-
mkdir($dirPath, 0777, true);
31+
if(!file_exists($dirPath)) {
32+
mkdir($dirPath, 0775, true);
3333
}
3434
create_variables($script_variables);
3535
require_once($script_variables);

php/script_exec.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
$script_variables = realpath("..") ."/temp_bolprocessor/".$temp_folder."/script_variables.php";
2222
$dirPath = realpath("..")."/temp_bolprocessor/".$temp_folder;
2323
if (!file_exists($dirPath)) {
24-
mkdir($dirPath, 0777, true);
24+
mkdir($dirPath, 0775, true);
2525
}
2626
create_variables($script_variables);
2727

@@ -182,7 +182,7 @@ function run_script($dir,$dirPath,$this_script_file,$script_variables,$note_conv
182182
echo "<p><b>Running script ".$newfile."</b></p>";
183183
$new_script_variables = str_replace($this_script_file,$newfile,$script_variables);
184184
$newdirPath = str_replace($this_script_file,$newfile,$dirPath);
185-
if(!file_exists($newdirPath)) mkdir($newdirPath, 0777, true);
185+
if(!file_exists($newdirPath)) mkdir($newdirPath, 0775, true);
186186
create_variables($new_script_variables);
187187
run_script($dir,$newdirPath,$newfile,$new_script_variables,$note_convention,$grammar,$output_format);
188188
echo "<p><b>Back to script ".$this_script_file."</b></p>";

0 commit comments

Comments
 (0)