summaryrefslogtreecommitdiffstats
path: root/lib/connector/sabre/directory.php
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2013-09-23 22:04:37 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2013-09-23 22:04:37 +0200
commite55f25b64df09a3ba6535274eaf738e82910e1f6 (patch)
treedfb492df647e7c47dce9ed3eb9e150e601891288 /lib/connector/sabre/directory.php
parent5d671a84b22079f12a993c02993db39cef008230 (diff)
downloadnextcloud-server-e55f25b64df09a3ba6535274eaf738e82910e1f6.tar.gz
nextcloud-server-e55f25b64df09a3ba6535274eaf738e82910e1f6.zip
handle error situation of rename proper
Diffstat (limited to 'lib/connector/sabre/directory.php')
-rw-r--r--lib/connector/sabre/directory.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/connector/sabre/directory.php b/lib/connector/sabre/directory.php
index 3181a4b310f..9e0fe5e64e7 100644
--- a/lib/connector/sabre/directory.php
+++ b/lib/connector/sabre/directory.php
@@ -88,7 +88,12 @@ class OC_Connector_Sabre_Directory extends OC_Connector_Sabre_Node implements Sa
}
// rename to correct path
- \OC\Files\Filesystem::rename($partpath, $newPath);
+ $renameOkay = \OC\Files\Filesystem::rename($partpath, $newPath);
+ if (!$renameOkay) {
+ \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();