Issue Bug Closed

#38135Apc Cache backend has side effects

Daniel Poetzinger 06/17/12, 14:03 updated 10/02/18, 12:17

Description

If two caches use the APC cache backend, one cache can write and get entries from the other by just using the same key!

Patch:

--- a/t3lib/cache/backend/class.t3lib_cache_backend_apcbackend.php
+++ b/t3lib/cache/backend/class.t3lib_cache_backend_apcbackend.php
@@ -87,7 +87,7 @@ class t3lib_cache_backend_ApcBackend extends t3lib_cache_backend_AbstractBackend
        public function setCache(t3lib_cache_frontend_Frontend $cache) {
                parent::setCache($cache);
                $processUser = extension_loaded('posix') ? posix_getpwuid(posix_geteuid()) : array('name' => 'default');
-               $pathHash = t3lib_div::shortMD5(PATH_site . $processUser['name'] . $this->context, 12);
+               $pathHash = t3lib_div::shortMD5(PATH_site . $processUser['name'] . $this->context . $cache->getIdentifier(), 12);
                $this->identifierPrefix = 'TYPO3_' . $pathHash;
        }

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.