Skip to content
Snippets Groups Projects
Commit f2d0cf85 authored by Christian Kuhn's avatar Christian Kuhn
Browse files

[BUGFIX] Simplify Apcu cache backend identifier calculation

APCu cache backend is a shared memory per user and
typically bound to the executing posix user-id.
Calculating different cache identifiers per user
is useless since those won't share the same shm.

Resolves: #96232
Releases: master, 11.5, 10.4
Change-Id: If6b6a744828d06d55f2c9b5656aef48193da7384
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/72510


Tested-by: default avatarcore-ci <typo3@b13.com>
Tested-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
parent bae97b8e
Branches
Tags
No related merge requests found
......@@ -95,22 +95,10 @@ class ApcuBackend extends AbstractBackend implements TaggableBackendInterface
public function setCache(FrontendInterface $cache)
{
parent::setCache($cache);
$processUser = $this->getCurrentUserData();
$pathHash = md5(Environment::getProjectPath() . $processUser['name'] . $this->context . $cache->getIdentifier());
$pathHash = md5(Environment::getProjectPath() . $this->context . $cache->getIdentifier());
$this->setIdentifierPrefix('TYPO3_' . $pathHash);
}
/**
* Returns the current user data with posix_getpwuid or a default structure when
* posix_getpwuid is not available.
*
* @return array
*/
protected function getCurrentUserData()
{
return extension_loaded('posix') ? posix_getpwuid(posix_geteuid()) : ['name' => 'default'];
}
/**
* Saves data in the cache.
*
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment