Ignoring chmod() errors
authorAlexander Ebert <ebert@woltlab.com>
Sun, 2 Jun 2013 18:28:10 +0000 (20:28 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Sun, 2 Jun 2013 18:28:10 +0000 (20:28 +0200)
wcfsetup/install.php
wcfsetup/install/files/lib/util/FileUtil.class.php

index 18a96940d35ffc0f05dc29dcaab5b77ff63f2f6e..eb2f14e40ad31e3996966b9f65e159ef84545155 100644 (file)
@@ -336,14 +336,14 @@ class BasicFileUtil {
                $startIndex = 0;
                if (is_dir($filename)) {
                        if (self::$mode == 0644) {
-                               chmod($filename, 0755);
+                               @chmod($filename, 0755);
                        }
                        else {
-                               chmod($filename, 0777);
+                               @chmod($filename, 0777);
                        }
                }
                else {
-                       chmod($filename, self::$mode);
+                       @chmod($filename, self::$mode);
                }
                
                if (!is_writable($filename)) {
index c661f79c11b0a63db1a2cfe64b0bae14295d68ce..c4f7de9012dbb0bc88ca8145a10f63b456c9a9af 100644 (file)
@@ -504,21 +504,21 @@ final class FileUtil {
                                }
                                else {
                                        self::$mode = '0666';
-                               
+                                       
                                        $tmpFilename = '__permissions_'.sha1(time()).'.txt';
                                        @touch($tmpFilename);
-                               
+                                       
                                        // create a new file and check the file owner, if it is the same
                                        // 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(INSTALL_SCRIPT);
                                                $fileOwner = fileowner($tmpFilename);
-                                                       
+                                               
                                                if ($scriptOwner === $fileOwner) {
                                                        self::$mode = '0644';
                                                }
-                                                       
+                                               
                                                @unlink($tmpFilename);
                                        }
                                }
@@ -535,14 +535,14 @@ final class FileUtil {
                
                if (is_dir($filename)) {
                        if (self::$mode == '0644') {
-                               chmod($filename, 0755);
+                               @chmod($filename, 0755);
                        }
                        else {
-                               chmod($filename, 0777);
+                               @chmod($filename, 0777);
                        }
                }
                else {
-                       chmod($filename, octdec(self::$mode));
+                       @chmod($filename, octdec(self::$mode));
                }
                
                if (!is_writable($filename)) {