mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-27 07:44:04 +02:00
Do not validate the mode of the setup.token
Relying on the mode of the configuration directory must be sufficient.
This commit is contained in:
parent
daaf242145
commit
2bd9d27e05
@ -38,10 +38,6 @@ class TokenValidator extends Zend_Validate_Abstract
|
|||||||
mt('setup', 'Cannot validate token, file "%s" is empty. Please define a token.'),
|
mt('setup', 'Cannot validate token, file "%s" is empty. Please define a token.'),
|
||||||
$tokenPath
|
$tokenPath
|
||||||
),
|
),
|
||||||
'TOKEN_FILE_PUBLIC' => sprintf(
|
|
||||||
mt('setup', 'Cannot validate token, file "%s" must only be accessible by the webserver\'s user.'),
|
|
||||||
$tokenPath
|
|
||||||
),
|
|
||||||
'TOKEN_INVALID' => mt('setup', 'Invalid token supplied.')
|
'TOKEN_INVALID' => mt('setup', 'Invalid token supplied.')
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -56,12 +52,6 @@ class TokenValidator extends Zend_Validate_Abstract
|
|||||||
*/
|
*/
|
||||||
public function isValid($value, $context = null)
|
public function isValid($value, $context = null)
|
||||||
{
|
{
|
||||||
$tokenStats = @stat($this->tokenPath);
|
|
||||||
if (($tokenStats['mode'] & 4) === 4) {
|
|
||||||
$this->_error('TOKEN_FILE_PUBLIC');
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$file = new File($this->tokenPath);
|
$file = new File($this->tokenPath);
|
||||||
$expectedToken = trim($file->fgets());
|
$expectedToken = trim($file->fgets());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user