[TYPO3-core] RFC: #17289: Form protection tokens get lost because of a race condition when persisting tokens

Steffen Kamper info at sk-typo3.de
Tue Jan 25 11:14:17 CET 2011


Hi Helmut,

+1 by reading and testing, also with
//$lockObject = $this->acquireLock();


One small, please change this function to:
protected function acquireLock() {
		$identifier = 'persistTokens' . $this->backendUser->id;
		$success = FALSE;	// If locking fails, return with false and continue 
without locking
		try {
			$lockObject = t3lib_div::makeInstance('t3lib_lock', $identifier, 
'simple');
			$lockObject->setEnableLogging(FALSE);
			$success = $lockObject->acquire();
		} catch (Exception $e) {
			t3lib_div::sysLog('Locking: Failed to acquire lock: 
'.$e->getMessage(), 't3lib_formprotection_BackendFormProtection', 
t3lib_div::SYSLOG_SEVERITY_ERROR);
		}

		return $success ? $lockObject : FALSE;
	}

$success is set before and FALSE is CGLed

vg Steffen


More information about the TYPO3-team-core mailing list