aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoricewind1991 <robin@icewind.nl>2014-07-16 16:06:14 +0200
committericewind1991 <robin@icewind.nl>2014-07-16 16:06:14 +0200
commitd58c8d72cf8c0f6784bdec1f054c24a78ff131b6 (patch)
treed08cdba381cd4a72901bd113ebd494853770dfd9
parentcbf3e2b8292918a82a0c74bc3357b799b45c9361 (diff)
parent03f422153d70bc175bb6e68d27129deba6cb9875 (diff)
downloadnextcloud-server-d58c8d72cf8c0f6784bdec1f054c24a78ff131b6.tar.gz
nextcloud-server-d58c8d72cf8c0f6784bdec1f054c24a78ff131b6.zip
Merge pull request #9550 from kofemann/dcache-fixes-for-upstream
storage: do not check file mode on rename
-rw-r--r--lib/private/files/storage/local.php13
-rw-r--r--lib/private/files/storage/mappedlocal.php13
2 files changed, 22 insertions, 4 deletions
diff --git a/lib/private/files/storage/local.php b/lib/private/files/storage/local.php
index e33747bbd52..63570d70cff 100644
--- a/lib/private/files/storage/local.php
+++ b/lib/private/files/storage/local.php
@@ -172,10 +172,19 @@ if (\OC_Util::runningOnWindows()) {
}
public function rename($path1, $path2) {
- if (!$this->isUpdatable($path1)) {
- \OC_Log::write('core', 'unable to rename, file is not writable : ' . $path1, \OC_Log::ERROR);
+ $srcParent = dirname($path1);
+ $dstParent = dirname($path2);
+
+ if (!$this->isUpdatable($srcParent)) {
+ \OC_Log::write('core', 'unable to rename, source directory is not writable : ' . $srcParent, \OC_Log::ERROR);
return false;
}
+
+ if (!$this->isUpdatable($dstParent)) {
+ \OC_Log::write('core', 'unable to rename, destination directory is not writable : ' . $dstParent, \OC_Log::ERROR);
+ return false;
+ }
+
if (!$this->file_exists($path1)) {
\OC_Log::write('core', 'unable to rename, file does not exists : ' . $path1, \OC_Log::ERROR);
return false;
diff --git a/lib/private/files/storage/mappedlocal.php b/lib/private/files/storage/mappedlocal.php
index ea4deaa66e8..6910eef7401 100644
--- a/lib/private/files/storage/mappedlocal.php
+++ b/lib/private/files/storage/mappedlocal.php
@@ -184,10 +184,19 @@ class MappedLocal extends \OC\Files\Storage\Common {
}
public function rename($path1, $path2) {
- if (!$this->isUpdatable($path1)) {
- \OC_Log::write('core', 'unable to rename, file is not writable : ' . $path1, \OC_Log::ERROR);
+ $srcParent = dirname($path1);
+ $dstParent = dirname($path2);
+
+ if (!$this->isUpdatable($srcParent)) {
+ \OC_Log::write('core', 'unable to rename, source directory is not writable : ' . $srcParent, \OC_Log::ERROR);
return false;
}
+
+ if (!$this->isUpdatable($dstParent)) {
+ \OC_Log::write('core', 'unable to rename, destination directory is not writable : ' . $dstParent, \OC_Log::ERROR);
+ return false;
+ }
+
if (!$this->file_exists($path1)) {
\OC_Log::write('core', 'unable to rename, file does not exists : ' . $path1, \OC_Log::ERROR);
return false;