Bug 8462: Directories are created with overly permissive settings.
Sol: the /shared directory mode permission was changed to 770 and the files got 660 mode now.
This commit is contained in:
@@ -303,7 +303,7 @@ class G
|
|||||||
/**
|
/**
|
||||||
* ************* path functions ****************
|
* ************* path functions ****************
|
||||||
*/
|
*/
|
||||||
public function mk_dir ($strPath, $rights = 0777)
|
public function mk_dir ($strPath, $rights = 0770)
|
||||||
{
|
{
|
||||||
$folder_path = array ($strPath);
|
$folder_path = array ($strPath);
|
||||||
$oldumask = umask( 0 );
|
$oldumask = umask( 0 );
|
||||||
@@ -2600,7 +2600,7 @@ class G
|
|||||||
* @param integer $permission
|
* @param integer $permission
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function uploadFile ($file, $path, $nameToSave, $permission = 0666)
|
public function uploadFile ($file, $path, $nameToSave, $permission = 0660)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
if ($file == '') {
|
if ($file == '') {
|
||||||
@@ -4801,6 +4801,11 @@ class G
|
|||||||
|
|
||||||
if (@file_put_contents( $file, $content ) === false) {
|
if (@file_put_contents( $file, $content ) === false) {
|
||||||
throw new Exception( "G::update_php_ini() -> can't update file: $file" );
|
throw new Exception( "G::update_php_ini() -> can't update file: $file" );
|
||||||
|
} else {
|
||||||
|
//first a raw permission check
|
||||||
|
if(fileperms($file) != 33200) {
|
||||||
|
chmod ($file, 0660);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user