[Pkg-owncloud-commits] [owncloud] 12/394: possible fix for bombarding the server with the htaccess test during setup
David Prévot
taffit at alioth.debian.org
Fri Nov 8 23:11:14 UTC 2013
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to annotated tag v4.5.10
in repository owncloud.
commit 46e9bf56789b8f4b8e01491d2d77ec83e828d5c8
Author: Robin Appelman <icewind at owncloud.com>
Date: Fri Oct 26 18:17:43 2012 +0200
possible fix for bombarding the server with the htaccess test during setup
---
lib/util.php | 37 +++++++++++++++++++++----------------
1 file changed, 21 insertions(+), 16 deletions(-)
diff --git a/lib/util.php b/lib/util.php
index ca8117d..98ea1da 100755
--- a/lib/util.php
+++ b/lib/util.php
@@ -64,23 +64,23 @@ class OC_Util {
}
public static function loadUserMountPoints($user) {
- $user_dir = '/'.$user.'/files';
- $user_root = OC_User::getHome($user);
+ $user_dir = '/'.$user.'/files';
+ $user_root = OC_User::getHome($user);
$userdirectory = $user_root . '/files';
- if (is_file($user_root.'/mount.php')) {
- $mountConfig = include($user_root.'/mount.php');
- if (isset($mountConfig['user'][$user])) {
- foreach ($mountConfig['user'][$user] as $mountPoint => $options) {
- OC_Filesystem::mount($options['class'], $options['options'], $mountPoint);
- }
- }
-
- $mtime=filemtime($user_root.'/mount.php');
- $previousMTime=OC_Preferences::getValue($user,'files','mountconfigmtime',0);
- if($mtime>$previousMTime) {//mount config has changed, filecache needs to be updated
- OC_FileCache::triggerUpdate($user);
- OC_Preferences::setValue($user,'files','mountconfigmtime',$mtime);
- }
+ if (is_file($user_root.'/mount.php')) {
+ $mountConfig = include($user_root.'/mount.php');
+ if (isset($mountConfig['user'][$user])) {
+ foreach ($mountConfig['user'][$user] as $mountPoint => $options) {
+ OC_Filesystem::mount($options['class'], $options['options'], $mountPoint);
+ }
+ }
+
+ $mtime=filemtime($user_root.'/mount.php');
+ $previousMTime=OC_Preferences::getValue($user,'files','mountconfigmtime',0);
+ if($mtime>$previousMTime) {//mount config has changed, filecache needs to be updated
+ OC_FileCache::triggerUpdate($user);
+ OC_Preferences::setValue($user,'files','mountconfigmtime',$mtime);
+ }
}
}
@@ -544,6 +544,11 @@ class OC_Util {
// creating a test file
$testfile = OC_Config::getValue( "datadirectory", OC::$SERVERROOT."/data" ).'/'.$filename;
+
+ if(file_exists($testfile)){// already running this test, possible recursive call
+ return false;
+ }
+
$fp = @fopen($testfile, 'w');
@fwrite($fp, $testcontent);
@fclose($fp);
--
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