[BUGFIX] Install Tool: Warning: touch() Utime failed: Permission denied 77/23477/3
authorErnesto Baschny <ernst@cron-it.de>
Thu, 29 Aug 2013 17:18:29 +0000 (19:18 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Fri, 30 Aug 2013 09:24:35 +0000 (11:24 +0200)
Despite getting rid of this warning, extending the lifetime of this file
gets more robust by a second method, which is recreating it (which should
be possible even if the file is not owned by the PHP process).

Resolves: #51542
Releases: 6.2
Change-Id: Icb7805ee1f6a08654c3f11eb317a2ad3cadbad76
Reviewed-on: https://review.typo3.org/23477
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
typo3/sysext/install/Classes/Service/EnableFileService.php

index fd6c0e1..b438ef4 100644 (file)
@@ -44,7 +44,12 @@ class EnableFileService {
         */
        static public function createInstallToolEnableFile() {
                $installEnableFilePath = self::getInstallToolEnableFilePath();
-               $result = touch($installEnableFilePath);
+               if (!is_file($installEnableFilePath)) {
+                       $result = touch($installEnableFilePath);
+               } else {
+                       $result = TRUE;
+                       self::extendInstallToolEnableFileLifetime();
+               }
                \TYPO3\CMS\Core\Utility\GeneralUtility::fixPermissions($installEnableFilePath);
                return $result;
        }
@@ -91,7 +96,11 @@ class EnableFileService {
                $enableFile = self::getInstallToolEnableFilePath();
                // Extend the age of the ENABLE_INSTALL_TOOL file by one hour
                if (is_file($enableFile)) {
-                       touch($enableFile);
+                       $couldTouch = @touch($enableFile);
+                       if (!$couldTouch) {
+                               self::removeInstallToolEnableFile();
+                               self::createInstallToolEnableFile();
+                       }
                }
        }