[BUGFIX] Avoid fatal when flushed directory is a symlink 74/59374/3
authorHelmut Hummel <typo3@helhum.io>
Tue, 8 Jan 2019 14:33:08 +0000 (15:33 +0100)
committerMathias Brodala <mbrodala@pagemachine.de>
Wed, 9 Jan 2019 15:28:19 +0000 (16:28 +0100)
commit14af177968808026c464bf0f532bb5339dde7872
tree45515cdd93d3f94d203cd4d3db294e8119727a10
parent938d1e25b2675967fe122dbb03d2175cf928f119
[BUGFIX] Avoid fatal when flushed directory is a symlink

\TYPO3\CMS\Core\Utility\GeneralUtility::flushDirectory tries to
rename the given directory to be able to atomically flush the
contents of the directory. This however fails, when the given
folder is a symlink.

We now catch this case by checking whether the given directory
is a symlink and resolve it with realpath.

While this does not cover all possible cases, it improves the
case where the folder containing the symlink is also writable.

Resolves: #87367
Releases: master, 9.5, 8.7
Change-Id: Ic812a5eaa86cca4d81aee31b4a3fbdce052994a0
Reviewed-on: https://review.typo3.org/59374
Tested-by: TYPO3com <noreply@typo3.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Fabien Udriot <fabien.udriot@ecodev.ch>
Tested-by: Fabien Udriot <fabien.udriot@ecodev.ch>
Reviewed-by: Mathias Brodala <mbrodala@pagemachine.de>
Tested-by: Mathias Brodala <mbrodala@pagemachine.de>
typo3/sysext/core/Classes/Utility/GeneralUtility.php