[Pkg-owncloud-commits] [owncloud] 20/58: Remove unneeded part file

David Prévot taffit at moszumanska.debian.org
Tue Aug 11 15:58:05 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to annotated tag v8.0.6
in repository owncloud.

commit c9e77c7de49400234f730147f7cf2b4de140bc2b
Author: Morris Jobke <hey at morrisjobke.de>
Date:   Thu Jul 2 11:01:01 2015 +0200

    Remove unneeded part file
---
 lib/private/connector/sabre/file.php | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/lib/private/connector/sabre/file.php b/lib/private/connector/sabre/file.php
index 0831bb3..f29e362 100644
--- a/lib/private/connector/sabre/file.php
+++ b/lib/private/connector/sabre/file.php
@@ -143,6 +143,7 @@ class OC_Connector_Sabre_File extends OC_Connector_Sabre_Node implements \Sabre\
 					}
 				}
 				catch (\OCP\Files\NotPermittedException $e) {
+					$this->fileView->unlink($partFilePath);
 					// a more general case - due to whatever reason the content could not be written
 					throw new \Sabre\DAV\Exception\Forbidden($e->getMessage(), $e->getCode(), $e);
 				}
@@ -332,6 +333,12 @@ class OC_Connector_Sabre_File extends OC_Connector_Sabre_Node implements \Sabre\
 
 				$info = $this->fileView->getFileInfo($targetPath);
 				return $info->getEtag();
+			} catch (\OCP\Files\NotPermittedException $e) {
+				if ($needsPartFile) {
+					$this->fileView->unlink($partFile);
+				}
+				// a more general case - due to whatever reason the content could not be written
+				throw new \Sabre\DAV\Exception\Forbidden($e->getMessage(), $e->getCode(), $e);
 			} catch (\OCP\Files\StorageNotAvailableException $e) {
 				throw new \Sabre\DAV\Exception\ServiceUnavailable("Failed to put file: ".$e->getMessage());
 			}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list