Compare commits

...

1 Commits

Author SHA1 Message Date
Robin Appelman 00199c0c55
[PATCH] log and block object store deletes from groupfolders that dont go trough trash or versioning
Signed-off-by: Robin Appelman <robin@icewind.nl>
2020-01-13 14:58:26 +01:00
1 changed files with 6 additions and 0 deletions

View File

@ -198,6 +198,12 @@ class ObjectStoreStorage extends \OC\Files\Storage\Common {
if ($stat['mimetype'] === 'httpd/unix-directory') {
return $this->rmdir($path);
}
if (strpos($path, '__groupfolders') !== false) {
if (strpos($path, '__groupfolders/trash') === false && strpos($path, '__groupfolders/versions') === false) {
// DEBUG: log any attempt made to delete a file from a group folder and block the delete
throw new \Exception('Deleting object from groupfolder without going trough trash ' . $this->getURN($stat['fileid']) . ' for ' . $path);
}
}
try {
$this->objectStore->deleteObject($this->getURN($stat['fileid']));
} catch (\Exception $ex) {