Fixed file reference for owner check during WCFSetup
authorAlexander Ebert <ebert@woltlab.com>
Sun, 2 Jun 2013 17:40:33 +0000 (19:40 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Sun, 2 Jun 2013 17:40:33 +0000 (19:40 +0200)
wcfsetup/install.php
wcfsetup/install/files/lib/util/FileUtil.class.php

index 21a79c6e35ee135e16572172c3d8861db427441e..18a96940d35ffc0f05dc29dcaab5b77ff63f2f6e 100644 (file)
@@ -3,10 +3,11 @@
  * This script tries to find the temp folder and unzip all setup files into.
  *
  * @author     Marcel Werk
- * @copyright  2001-2011 WoltLab GmbH
+ * @copyright  2001-2013 WoltLab GmbH
  * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
  */
 // define constants
+define('INSTALL_SCRIPT', __FILE__);
 define('INSTALL_SCRIPT_DIR', dirname(__FILE__).'/');
 define('SETUP_FILE', INSTALL_SCRIPT_DIR . 'WCFSetup.tar.gz');
 define('NO_IMPORTS', 1);
index 084990f3b66eb78f40d54128b7f03f4117e71ad0..5761c1816776fea89d787f47967a4b8c56fd6a5e 100644 (file)
@@ -497,7 +497,7 @@ final class FileUtil {
                
                if (self::$mode === null) {
                        // WCFSetup
-                       if (defined('NO_IMPORTS')) {
+                       if (defined('INSTALL_SCRIPT')) {
                                // do not use PHP_OS here, as this represents the system it was built on != running on
                                if (strpos(php_uname(), 'Windows') !== false) {
                                        self::$mode = '0777';
@@ -512,7 +512,7 @@ final class FileUtil {
                                        // as this file (uploaded through FTP), we can safely grant write
                                        // permissions exclusively to the owner rather than everyone
                                        if (file_exists($tmpFilename)) {
-                                               $scriptOwner = fileowner(__FILE__);
+                                               $scriptOwner = fileowner(INSTALL_SCRIPT);
                                                $fileOwner = fileowner($tmpFilename);
                                                        
                                                if ($scriptOwner === $fileOwner) {
@@ -525,7 +525,7 @@ final class FileUtil {
                        }
                        else {
                                // mirror permissions of WCF.class.php
-                               if (!file_exists(WCF_DIR . 'lib/system/WCF.class.php')) {
+                               if (!file_exists()) {
                                        throw new SystemException("Unable to find 'wcf/lib/system/WCF.class.php'.");
                                }