aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Files/Cache
Commit message (Collapse)AuthorAgeFilesLines
...
* Normalize directory entries in Encoding wrapperVincent Petry2021-11-171-1/+4
| | | | | | | | | | | | Directory entry file names are now normalized in getMetaData(), getDirectoryContents() and opendir(). This makes the scanner work properly as it assumes pre-normalized names. In case the names were not normalized, the scanner will now skip the entries and display a warning when applicable. Signed-off-by: Vincent Petry <vincent@nextcloud.com>
* Move storage encoding compatibility warning logicVincent Petry2021-11-171-2/+8
| | | | | | | | | | | The encoding check for file names is now happening the Scanner, and an event will be emitted only if the storage doesn't contain the encoding compatibility wrapper. The event is listened to by the occ scan command to be able to display a warning in case of file name mismatches when they have NFD encoding. Signed-off-by: Vincent Petry <vincent@nextcloud.com>
* Normalize file name before existence check in scannerVincent Petry2021-11-171-0/+1
| | | | | | | | | | | | The scanner would not find a NFD-encoded file name in an existing file list that is normalized. This normalizes the file name before scanning. Fixes issues where scanning repeatedly would make NFD files flicker in and out of existence in the file cache. Signed-off-by: Vincent Petry <vincent@nextcloud.com>
* properly handle cases where cache wrappers block accessRobin Appelman2021-11-012-3/+4
| | | | | | `CacheWrapper::formatCacheEntry` can return false for files that should be filtered out Signed-off-by: Robin Appelman <robin@icewind.nl>
* Merge pull request #29281 from vijfhoek/masterJohn Molakvoæ2021-11-012-6/+14
|\
| * Move query outside the loop and reduce chunk size to 1000Sijmen Schoon2021-10-172-12/+14
| | | | | | | | | | | | | | This involved changing CacheQueryBuilder\whereParentIn to take a parameter name, renaming the function accordingly. Signed-off-by: Sijmen Schoon <me@sijmenschoon.nl>
| * Limit parameter count per query in Cache.removeChildrenSijmen Schoon2021-10-171-8/+14
| | | | | | | | Signed-off-by: Sijmen Schoon <me@sijmenschoon.nl>
* | Merge pull request #29115 from ↵Carl Schwan2021-10-281-1/+1
|\ \ | | | | | | | | | | | | nextcloud/work/carl/correct-permissions-when-copying Fix permissions when copying from ObjectStorage
| * | Fix permissions when copying from ObjectStorageCarl Schwan2021-10-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make sure that when a user copy a file from a directory they don't have all permissions to a directory where they have more permissions, the permissions are correctly set to the one from the parent taget folder. This was caused by the ObjectStoreStorage::copyFromStorage using the jailed storage and cache entry instead of the unjailed one like other storages (the local one). Steps to reproduce + Use object storage + Create a groupfolder with one group having full permission and another one who can just read files. + With an user who is in the second group, copy a file from the groupfolder to the home folder of this user. + The file in the home folder of the user will be read only and can't be deleted even though it is in their home folder and they are the owner. In oc_filecache, the permissions stored for this file are 1 (READ) Signed-off-by: Carl Schwan <carl@carlschwan.eu>
* | | more reliable return value for Watcher::checkUpdateRobin Appelman2021-10-151-1/+8
| |/ |/| | | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* | generate a better optimized query for path prefix search filtersRobin Appelman2021-08-262-9/+17
|/ | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* Merge pull request #28476 from nextcloud/search-jail-insensitiveVincent Petry2021-08-242-3/+5
|\ | | | | use case insensitive like when limiting search to jail
| * use case insensitive like when limiting search to jailRobin Appelman2021-08-172-3/+5
| | | | | | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* | use getGetUnjailedRoot to determine if jailed search needs the path filterRobin Appelman2021-08-231-1/+1
| | | | | | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* | Remove some mentions of ownCloud from our api documentationCarl Schwan2021-07-291-2/+2
|/ | | | Signed-off-by: Carl Schwan <carl@carlschwan.eu>
* dont apply jail search filter is on the rootRobin Appelman2021-07-261-11/+15
| | | | | | the extra '/' breaks things and the filter wouldn't do anything anyway except making the databases job harder Signed-off-by: Robin Appelman <robin@icewind.nl>
* inject SearchBuilderRobin Appelman2021-06-143-14/+5
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* split of query building bits from searchhelperRobin Appelman2021-06-142-196/+242
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* update tests and fix some edge cases around new searchRobin Appelman2021-06-141-1/+5
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* some cleanup and documentationRobin Appelman2021-06-141-4/+6
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* perform file search in a single queryRobin Appelman2021-06-143-9/+11
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* use searchoperation for storage filter instead of db expressionRobin Appelman2021-06-145-29/+40
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* rework search api to allow searching on multiple caches at onceRobin Appelman2021-06-147-243/+215
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* Update php licensesJohn Molakvoæ (skjnldsv)2021-06-0420-28/+8
| | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* properly use limit and offset for search in Jail wrapperRobin Appelman2021-05-211-7/+2
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* better cleanup of filecache when deleting an external storageRobin Appelman2021-05-191-0/+40
| | | | | | this way it can delete the cache entries even with per-user credentials Signed-off-by: Robin Appelman <robin@icewind.nl>
* Log when a storage is marked as unavailableMorris Jobke2021-03-251-0/+4
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Catch invalid cache source storage pathJohn Molakvoæ (skjnldsv)2021-03-241-0/+4
| | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* only require user to be set in a query that handles tagsRobin Appelman2021-03-181-4/+8
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* Merge pull request #26013 from nextcloud/object-store-copy-cache-idRobin Appelman2021-03-163-35/+51
|\ | | | | Return the fileid from `copyFromCache` and use it instead of doing an extra query
| * verify that cache entry is validRobin Appelman2021-03-121-0/+3
| | | | | | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
| * also implement for FailedCache and NullCacheRobin Appelman2021-03-121-0/+5
| | | | | | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
| * add ICopyFromCache trait to expose existing implementationRobin Appelman2021-03-122-35/+43
| | | | | | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* | Merge pull request #25136 from nextcloud/cachejail-search-filterVincent Petry2021-03-153-17/+103
|\ \ | |/ |/| do cachejail search filtering in sql
| * adjust testsRobin Appelman2021-01-261-1/+1
| | | | | | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
| * fix search in nested jailsRobin Appelman2021-01-261-19/+35
| | | | | | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
| * fix cachjail searching for rootRobin Appelman2021-01-262-3/+17
| | | | | | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
| * do cachejail search filtering in sqlRobin Appelman2021-01-263-4/+60
| | | | | | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* | Merge pull request #25659 from nextcloud/smb-getmetadata-catchRoeland Jago Douma2021-03-051-3/+3
|\ \ | | | | | | catch notfound and forbidden exception in smb::getmetadata
| * | catch notfound and forbidden exception in smb::getmetadataRobin Appelman2021-03-041-3/+3
| | | | | | | | | | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* | | Remove RedundantcastsRoeland Jago Douma2021-03-041-1/+1
|/ / | | | | | | | | | | For #25839 Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* | Bump nextcloud/coding-standard from 0.3.0 to 0.5.0dependabot-preview[bot]2021-02-184-4/+4
| | | | | | | | | | | | | | | | | | | | Bumps [nextcloud/coding-standard](https://github.com/nextcloud/coding-standard) from 0.3.0 to 0.5.0. - [Release notes](https://github.com/nextcloud/coding-standard/releases) - [Changelog](https://github.com/nextcloud/coding-standard/blob/master/CHANGELOG.md) - [Commits](https://github.com/nextcloud/coding-standard/compare/v0.3.0...v0.5.0) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* | move AbstractCacheEvent into OCPRobin Appelman2021-02-151-93/+0
|/ | | | | | otherwise we have concrete cache events in OCP extending non OCP classes Signed-off-by: Robin Appelman <robin@icewind.nl>
* Bump doctrine/dbal from 2.12.0 to 3.0.0Christoph Wurst2021-01-082-10/+13
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* ignore files that have no read permissions during scanningRobin Appelman2021-01-061-0/+4
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* Update license headersChristoph Wurst2020-12-301-0/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Merge pull request #24715 from nextcloud/bug/noid/limit-get-incomplete-to-1Roeland Jago Douma2020-12-211-1/+2
|\ | | | | Limit getIncomplete query to one row
| * Limit getIncomplete query to one rowDaniel Kesselberg2020-12-151-1/+2
| | | | | | | | Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
* | Update all license headers for Nextcloud 21Christoph Wurst2020-12-1611-10/+14
|/ | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* code style and dispatchTypedRobin Appelman2020-12-021-2/+1
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>