Browse Source

Added sticky GID permissions (#1615)

Mafoo 9 years ago
parent
commit
b4019b3dae
2 changed files with 4 additions and 4 deletions
  1. 3 3
      core/install/resources/classes/install_switch.php
  2. 1 1
      resources/functions.php

+ 3 - 3
core/install/resources/classes/install_switch.php

@@ -99,7 +99,7 @@ include "root.php";
 
 
 			//make sure the conf directory exists
 			//make sure the conf directory exists
 				if (!is_dir($this->global_settings->switch_conf_dir())) {
 				if (!is_dir($this->global_settings->switch_conf_dir())) {
-					if (!mkdir($this->global_settings->switch_conf_dir(), 0774, true)) {
+					if (!mkdir($this->global_settings->switch_conf_dir(), 2774, true)) {
 						throw new Exception("Failed to create the switch conf directory '".$this->global_settings->switch_conf_dir()."'. ");
 						throw new Exception("Failed to create the switch conf directory '".$this->global_settings->switch_conf_dir()."'. ");
 					}
 					}
 				}
 				}
@@ -117,9 +117,9 @@ include "root.php";
 					unset($src_dir, $dst_dir);
 					unset($src_dir, $dst_dir);
 				}
 				}
 				$fax_dir = join( DIRECTORY_SEPARATOR, array($this->global_settings->switch_storage_dir(), 'fax'));
 				$fax_dir = join( DIRECTORY_SEPARATOR, array($this->global_settings->switch_storage_dir(), 'fax'));
-				if (!is_readable($fax_dir)) { mkdir($fax_dir,0777,true); }
+				if (!is_readable($fax_dir)) { mkdir($fax_dir,2777,true); }
 				$voicemail_dir = join( DIRECTORY_SEPARATOR, array($this->global_settings->switch_storage_dir(), 'voicemail'));
 				$voicemail_dir = join( DIRECTORY_SEPARATOR, array($this->global_settings->switch_storage_dir(), 'voicemail'));
-				if (!is_readable($voicemail_dir)) { mkdir($voicemail_dir,0777,true); }
+				if (!is_readable($voicemail_dir)) { mkdir($voicemail_dir,2777,true); }
 
 
 			//write the xml_cdr.conf.xml file
 			//write the xml_cdr.conf.xml file
 				if (file_exists($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/app/xml_cdr")) {
 				if (file_exists($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/app/xml_cdr")) {

+ 1 - 1
resources/functions.php

@@ -175,7 +175,7 @@
 					throw new Exception("recursive_copy() source directory '".$src."' does not exist.");
 					throw new Exception("recursive_copy() source directory '".$src."' does not exist.");
 				}
 				}
 				if (!is_dir($dst)) {
 				if (!is_dir($dst)) {
-					if (!mkdir($dst)) {
+					if (!mkdir($dst,2770,true)) {
 						throw new Exception("recursive_copy() failed to create destination directory '".$dst."'");
 						throw new Exception("recursive_copy() failed to create destination directory '".$dst."'");
 					}
 					}
 				}
 				}