]> source.dussan.org Git - nextcloud-server.git/commitdiff
Do not keep the part file if the forbidden exception has retry set to false 22556/head
authorJulius Härtl <jus@bitgrid.net>
Thu, 3 Sep 2020 09:00:24 +0000 (11:00 +0200)
committerJulius Härtl <jus@bitgrid.net>
Thu, 3 Sep 2020 09:00:24 +0000 (11:00 +0200)
Signed-off-by: Julius Härtl <jus@bitgrid.net>
apps/dav/lib/Connector/Sabre/File.php

index 4e45661605991353ccfadfe6f7e9274f7d9df3a5..476824a2e36a29f76fc0307a4084f8d9baea19a7 100644 (file)
@@ -288,6 +288,9 @@ class File extends Node implements IFile {
                                                throw new Exception('Could not rename part file to final file');
                                        }
                                } catch (ForbiddenException $ex) {
+                                       if (!$ex->getRetry()) {
+                                               $partStorage->unlink($internalPartPath);
+                                       }
                                        throw new DAVForbiddenException($ex->getMessage(), $ex->getRetry());
                                } catch (\Exception $e) {
                                        $partStorage->unlink($internalPartPath);