src/Psecio/Iniscan/Rule/CheckSessionPath.php
protected function evaluateFile(array $ini)
	{
		$savePath = $this->findValue('session.save_path', $ini);

		if ($savePath === '/tmp') {
			$this->setDescription('Custom path not set, default (/tmp) is world writeable');
			$this->fail();
			return false;
		}

		if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
			$this->na();
			$this->setDescription('Cannot check Windows permissions. Please verify them manually');
			return true;
		}

		$perms = substr(sprintf('%o', fileperms($savePath)), - 3);
		if ($perms == 777) {
			$this->fail();
			$this->setDescription('Path '.$savePath.' is world writeable');
			return false;
		} else {
			$this->pass();
			return true;
		}
	}
protected function evaluateFile(array $ini)
	{
		$savePath = $this->findValue('session.save_path', $ini);

		if ($savePath === '/tmp') {
			$this->setDescription('Custom path not set, default (/tmp) is world writeable');
			$this->fail();
			return false;
		}

		if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
			$this->na();
			$this->setDescription('Cannot check Windows permissions. Please verify them manually');
			return true;
		}

		$perms = substr(sprintf('%o', fileperms($savePath)), - 3);
		if ($perms == 777) {
			$this->fail();
			$this->setDescription('Path '.$savePath.' is world writeable');
			return false;
		} else {
			$this->pass();
			return true;
		}
	}
protected function evaluateFile ( array $ ini ) { $ savePath = $ this -> findValue ( 'session.save_path' , $ ini ) ; if ( $ savePath === '/tmp' ) { $ this -> setDescription ( 'Custom path not set, default (/tmp) is world writeable' ) ; $ this -> fail ( ) ; return false ; } if ( strtoupper ( substr ( PHP_OS , 0 , 3 ) ) === 'WIN' ) { $ this -> na ( ) ; $ this -> setDescription ( 'Cannot check Windows permissions. Please verify them manually' ) ; return true ; } $ perms = substr ( sprintf ( '%o' , fileperms ( $ savePath ) ) , - 3 ) ; if ( $ perms == 777 ) { $ this -> fail ( ) ; $ this -> setDescription ( 'Path ' . $ savePath . ' is world writeable' ) ; return false ; } else { $ this -> pass ( ) ; return true ; } }
Evaluate the session handling for file-based systems

@param array $ini Configuration settings (from php.ini)
@return boolean Pass/fail of evaluation
Evaluate the session handling for file - based systems