diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2013-09-23 22:04:37 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2013-10-02 22:13:58 +0200 |
commit | ba7432126bac1061137fb150a39f1744e1303278 (patch) | |
tree | 669ff6386f46013cef12ed414520dd5e8c3ea984 /lib/connector | |
parent | d0046b6e29615cea117631aa7afdfe807e7716be (diff) | |
download | nextcloud-server-ba7432126bac1061137fb150a39f1744e1303278.tar.gz nextcloud-server-ba7432126bac1061137fb150a39f1744e1303278.zip |
handle error situation of rename proper
Diffstat (limited to 'lib/connector')
-rw-r--r-- | lib/connector/sabre/directory.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/connector/sabre/directory.php b/lib/connector/sabre/directory.php index 1434e970587..b0d7102c6d9 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(); |