[Pkg-owncloud-commits] [owncloud] 94/134: use a non-recursive chmod on the datadir
David Prévot
taffit at moszumanska.debian.org
Fri Apr 18 21:44:05 UTC 2014
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository owncloud.
commit a591160c323b4dceca774a52d0c9d814cd39cd6e
Author: Robin Appelman <icewind at owncloud.com>
Date: Mon Mar 17 12:53:26 2014 +0100
use a non-recursive chmod on the datadir
---
lib/private/helper.php | 29 -----------------------------
lib/private/util.php | 2 +-
2 files changed, 1 insertion(+), 30 deletions(-)
diff --git a/lib/private/helper.php b/lib/private/helper.php
index 4b462c8..29054f2 100644
--- a/lib/private/helper.php
+++ b/lib/private/helper.php
@@ -311,35 +311,6 @@ class OC_Helper {
}
/**
- * @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
* @param string $dest target folder
diff --git a/lib/private/util.php b/lib/private/util.php
index 3ab4f74..383f428 100755
--- a/lib/private/util.php
+++ b/lib/private/util.php
@@ -529,7 +529,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') {
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git
More information about the Pkg-owncloud-commits
mailing list