aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2013-09-24 13:54:18 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2013-10-02 22:13:59 +0200
commit1f1171dfafe7c314b547f332ac04e66e8539c5f5 (patch)
tree46273d51be2de06d6244222c3c6c93b51b08e18a
parent245a0260a95e0d81bc08b2488f0b8ecd8f1ff7f1 (diff)
downloadnextcloud-server-1f1171dfafe7c314b547f332ac04e66e8539c5f5.tar.gz
nextcloud-server-1f1171dfafe7c314b547f332ac04e66e8539c5f5.zip
duplicate code :sigh: - will fix this in a second pr
-rw-r--r--lib/connector/sabre/file.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/connector/sabre/file.php b/lib/connector/sabre/file.php
index 06ab73e3e4d..2ddf833f40e 100644
--- a/lib/connector/sabre/file.php
+++ b/lib/connector/sabre/file.php
@@ -69,7 +69,14 @@ class OC_Connector_Sabre_File extends OC_Connector_Sabre_Node implements Sabre_D
}
// rename to correct path
- \OC\Files\Filesystem::rename($partpath, $this->path);
+ $renameOkay = \OC\Files\Filesystem::rename($partpath, $this->path);
+ $fileExists = \OC\Files\Filesystem::file_exists($this->path);
+ if ($renameOkay === false || $fileExists === false) {
+ \OC_Log::write('webdav', '\OC\Files\Filesystem::rename() failed', \OC_Log::ERROR);
+ \OC\Files\Filesystem::unlink($partpath);
+ throw new Sabre_DAV_Exception();
+ }
+
//allow sync clients to send the mtime along in a header
$mtime = OC_Request::hasModificationTime();