diff options
author | Robin Appelman <robin@icewind.nl> | 2019-03-14 16:18:43 +0100 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2019-03-14 16:18:43 +0100 |
commit | 62a969f056c9bebf1b9f579155c376fae31c207e (patch) | |
tree | de08588e87339ef6b926ae46a918df1651130cb7 /apps/files_trashbin | |
parent | 762a8bb3d9521a9f75d9e186150cb77241b3bc19 (diff) | |
download | nextcloud-server-62a969f056c9bebf1b9f579155c376fae31c207e.tar.gz nextcloud-server-62a969f056c9bebf1b9f579155c376fae31c207e.zip |
dont try to restore a trashbin item to a readonly target
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'apps/files_trashbin')
-rw-r--r-- | apps/files_trashbin/lib/Trashbin.php | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/apps/files_trashbin/lib/Trashbin.php b/apps/files_trashbin/lib/Trashbin.php index 1d0d5379905..1cf3e683543 100644 --- a/apps/files_trashbin/lib/Trashbin.php +++ b/apps/files_trashbin/lib/Trashbin.php @@ -48,6 +48,7 @@ use OCA\Files_Trashbin\Command\Expire; use OCP\Files\File; use OCP\Files\Folder; use OCP\Files\NotFoundException; +use OCP\Files\NotPermittedException; use OCP\User; class Trashbin { @@ -414,6 +415,9 @@ class Trashbin { $mtime = $view->filemtime($source); // restore file + if (!$view->isCreatable(dirname($target))) { + throw new NotPermittedException("Can't restore trash item because the target folder is not writable"); + } $restoreResult = $view->rename($source, $target); // handle the restore result |