Skip to content
Extraits de code Groupes Projets
Valider a852b0e8 rédigé par robocoder's avatar robocoder
Parcourir les fichiers
git-svn-id: http://dev.piwik.org/svn/trunk@3779 59fd770c-687e-43c8-a1e3-f5a4ff64c105
parent 9b584db3
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -64,9 +64,10 @@ class PhpSecInfo_Test_Core_Upload_Tmp_Dir extends PhpSecInfo_Test_Core ...@@ -64,9 +64,10 @@ class PhpSecInfo_Test_Core_Upload_Tmp_Dir extends PhpSecInfo_Test_Core
*/ */
function _execTest() { function _execTest() {
$perms = fileperms($this->current_value); $perms = @fileperms($this->current_value);
if ($perms === false) {
if ($this->current_value return PHPSECINFO_TEST_RESULT_WARN;
} else if ($this->current_value
&& !preg_match("|".PHPSECINFO_TEST_COMMON_TMPDIR."/?|", $this->current_value) && !preg_match("|".PHPSECINFO_TEST_COMMON_TMPDIR."/?|", $this->current_value)
&& ! ($perms & 0x0004) && ! ($perms & 0x0004)
&& ! ($perms & 0x0002) ) { && ! ($perms & 0x0002) ) {
...@@ -79,7 +80,6 @@ class PhpSecInfo_Test_Core_Upload_Tmp_Dir extends PhpSecInfo_Test_Core ...@@ -79,7 +80,6 @@ class PhpSecInfo_Test_Core_Upload_Tmp_Dir extends PhpSecInfo_Test_Core
return PHPSECINFO_TEST_RESULT_NOTICE; return PHPSECINFO_TEST_RESULT_NOTICE;
} }
/** /**
* Set the messages specific to this test * Set the messages specific to this test
* *
...@@ -90,10 +90,11 @@ class PhpSecInfo_Test_Core_Upload_Tmp_Dir extends PhpSecInfo_Test_Core ...@@ -90,10 +90,11 @@ class PhpSecInfo_Test_Core_Upload_Tmp_Dir extends PhpSecInfo_Test_Core
$this->setMessageForResult(PHPSECINFO_TEST_RESULT_NOTRUN, 'en', 'Test not run -- currently disabled on Windows OSes'); $this->setMessageForResult(PHPSECINFO_TEST_RESULT_NOTRUN, 'en', 'Test not run -- currently disabled on Windows OSes');
$this->setMessageForResult(PHPSECINFO_TEST_RESULT_OK, 'en', 'upload_tmp_dir is enabled, which is the $this->setMessageForResult(PHPSECINFO_TEST_RESULT_OK, 'en', 'upload_tmp_dir is enabled, which is the
recommended setting. Make sure your upload_tmp_dir path is not world-readable'); recommended setting. Make sure your upload_tmp_dir path is not world-readable');
$this->setMessageForResult(PHPSECINFO_TEST_RESULT_WARN, 'en', 'unable to retrieve file permissions on upload_tmp_dir');
$this->setMessageForResult(PHPSECINFO_TEST_RESULT_NOTICE, 'en', 'upload_tmp_dir is disabled, or is set to a $this->setMessageForResult(PHPSECINFO_TEST_RESULT_NOTICE, 'en', 'upload_tmp_dir is disabled, or is set to a
common world-writable directory. This typically allows other users on this server common world-writable directory. This typically allows other users on this server
to access temporary copies of files uploaded via your PHP scripts. You should set to access temporary copies of files uploaded via your PHP scripts. You should set
upload_tmp_dir to a non-world-readable directory'); upload_tmp_dir to a non-world-readable directory');
} }
} }
\ No newline at end of file
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter