[BUGFIX] Avoid race conditions in typo3temp/Cache 50/40650/2
authorBernhard Kraft <kraft@webconsulting.at>
Thu, 25 Jun 2015 15:41:44 +0000 (17:41 +0200)
committerAndreas Fernandez <typo3@scripting-base.de>
Thu, 25 Jun 2015 15:46:45 +0000 (17:46 +0200)
commit53d22b54fe92f83cc41d66faa44f12ed811ee4e7
treebe75774bd9c78f4e7faf42282f8af14c20456a77
parented1948dbcd19d7693307568bf65fabfb2c3939e5
[BUGFIX] Avoid race conditions in typo3temp/Cache

Race conditions can occur when the cache in typo3temp/Cache gets
cleared, for example by using the Install Tool "Clear all caches"
button. The cache is currently cleared using GeneralUtility::rmdir()
which does a directory traversal and unlinks all contained files.
Instead GeneralUtility::flushDirectory() should get used. This method
renames the directory into a temp-dir name and then removes the temp-dir
using GeneralUtility:rmdir().

Change-Id: I23f31da4e7b1730edee9007e713a51d4b39c6f1c
Resolves: #67238
Releases: master, 6.2
Reviewed-on: http://review.typo3.org/40650
Reviewed-by: Alexander Opitz <opitz.alexander@googlemail.com>
Tested-by: Alexander Opitz <opitz.alexander@googlemail.com>
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Tested-by: Andreas Fernandez <typo3@scripting-base.de>
typo3/sysext/core/Classes/Utility/GeneralUtility.php
typo3/sysext/install/Classes/Service/ClearCacheService.php