]> source.dussan.org Git - nextcloud-server.git/commitdiff
use a non-recursive chmod on the datadir
authorRobin Appelman <icewind@owncloud.com>
Mon, 17 Mar 2014 11:53:26 +0000 (12:53 +0100)
committerRobin Appelman <icewind@owncloud.com>
Mon, 17 Mar 2014 11:53:55 +0000 (12:53 +0100)
lib/private/helper.php
lib/private/util.php

index 0b1a26bbecdfba70088ca199defe21af623f1108..f0129f7c84d0875bce6ecdc5d58d607f96315d27 100644 (file)
@@ -343,35 +343,6 @@ class OC_Helper {
                return $bytes;
        }
 
-       /**
-        * @brief Recursive editing of file permissions
-        * @param string $path path to file or folder
-        * @param int $filemode unix style file permissions
-        * @return bool
-        */
-       static function chmodr($path, $filemode) {
-               if (!is_dir($path))
-                       return chmod($path, $filemode);
-               $dh = opendir($path);
-               if(is_resource($dh)) {
-                       while (($file = readdir($dh)) !== false) {
-                               if ($file != '.' && $file != '..') {
-                                       $fullpath = $path . '/' . $file;
-                                       if (is_link($fullpath))
-                                               return false;
-                                       elseif (!is_dir($fullpath) && !@chmod($fullpath, $filemode))
-                                               return false; elseif (!self::chmodr($fullpath, $filemode))
-                                               return false;
-                               }
-                       }
-                       closedir($dh);
-               }
-               if (@chmod($path, $filemode))
-                       return true;
-               else
-                       return false;
-       }
-
        /**
         * @brief Recursive copying of folders
         * @param string $src source folder
index 920161949ae417752a013ed20a157cc910e47704..fc78566e45652615091210b7f159d6f7c7e3dcfa 100755 (executable)
@@ -526,7 +526,7 @@ class OC_Util {
                                .' cannot be listed by other users.';
                        $perms = substr(decoct(@fileperms($dataDirectory)), -3);
                        if (substr($perms, -1) != '0') {
-                               OC_Helper::chmodr($dataDirectory, 0770);
+                               chmod($dataDirectory, 0770);
                                clearstatcache();
                                $perms = substr(decoct(@fileperms($dataDirectory)), -3);
                                if (substr($perms, 2, 1) != '0') {