aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/files/storage/local.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/files/storage/local.php')
-rw-r--r--lib/private/files/storage/local.php13
1 files changed, 11 insertions, 2 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;