raul
43185b5c4e
Fix unencrypted size calculation for files created before the Encryption storage is enabled
...
Signed-off-by: raul <raul@nextcloud.com>
2022-10-27 12:56:25 +02:00
raul
a31a03ef52
Fix: Prevent deadlocks during mtime/size/etag propagation
...
Signed-off-by: raul <raul@nextcloud.com>
2022-10-27 12:45:09 +02:00
Robin Appelman
d7858bfcf3
optimize search post-processing for jail wrapper
...
don't both asking the wrapped cache if we know it's not in our jail anyway
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-08-30 15:51:29 +00:00
Jonas
7ee01a07fd
Check whether entry is of type ICacheEntry in Cache->remove()
...
In some scenarios (file not in cache, but partial data of it in the
object), Cache->get() might return an array, which leads to errors like
"Call to a member function getId() on array".
So check whether the returned entry is of type ICacheEntry before doing
operations on it in Cache->remove().
Fixes : #33023
Signed-off-by: Jonas <jonas@freesources.org>
2022-06-30 12:24:42 +00:00
blizzz
adc0690960
Merge pull request #32124 from nextcloud/backport/32074/stable23
...
[stable23] tell mysql to ignore the sort index for search queries
2022-05-16 12:22:05 +02:00
Robin Appelman
2831da14be
tell mysql to ignore the sort index for search queries
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-04-25 11:56:44 +00:00
Robin Appelman
cc74bff50c
only request free space once for external shares
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-04-14 13:47:02 +02:00
Robin Appelman
d33ba15c38
don't overwrite the etag from storage backends that already provide "good" etags
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-04-14 13:47:02 +02:00
blizzz
eee279de78
Merge pull request #31835 from nextcloud/backport/31816/stable23
...
[stable23] Deduplicate storage ids in list before reusing
2022-04-14 13:39:04 +02:00
Joas Schilling
961bf74ae4
Deduplicate storage ids in list before reusing
...
Signed-off-by: Joas Schilling <coding@schilljs.com>
2022-04-04 17:18:04 +00:00
Robin Appelman
4167915b1a
return dummy availability if storage is not found in cache
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-03-10 17:17:20 +00:00
Robin Appelman
c9db02a921
background scan the source storage when a background scan on a storage jail is triggered
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-12-02 17:47:05 +00:00
Vincent Petry
f0661de4e5
Normalize directory entries in Encoding wrapper
...
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>
2021-11-19 14:51:38 +00:00
Vincent Petry
516b10de33
Move storage encoding compatibility warning logic
...
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>
2021-11-19 14:51:38 +00:00
Vincent Petry
106950d493
Normalize file name before existence check in scanner
...
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>
2021-11-19 14:51:38 +00:00
Robin Appelman
118c647f61
properly handle cases where cache wrappers block access
...
`CacheWrapper::formatCacheEntry` can return false for files that should be filtered out
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-11-01 11:48:01 +01:00
John Molakvoæ
63d3931e80
Merge pull request #29281 from vijfhoek/master
2021-11-01 11:29:37 +01:00
Carl Schwan
df4e6bab69
Merge pull request #29115 from nextcloud/work/carl/correct-permissions-when-copying
...
Fix permissions when copying from ObjectStorage
2021-10-28 14:38:20 +02:00
Carl Schwan
bfa60aaf27
Fix permissions when copying from ObjectStorage
...
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>
2021-10-28 13:29:50 +02:00
Sijmen Schoon
34600c78bb
Move query outside the loop and reduce chunk size to 1000
...
This involved changing CacheQueryBuilder\whereParentIn to take a
parameter name, renaming the function accordingly.
Signed-off-by: Sijmen Schoon <me@sijmenschoon.nl>
2021-10-17 20:57:28 +02:00
Sijmen Schoon
c959bf2b42
Limit parameter count per query in Cache.removeChildren
...
Signed-off-by: Sijmen Schoon <me@sijmenschoon.nl>
2021-10-17 19:10:58 +02:00
Robin Appelman
55346b5d6c
more reliable return value for Watcher::checkUpdate
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-10-15 16:03:18 +02:00
Robin Appelman
7351059326
generate a better optimized query for path prefix search filters
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-08-26 19:07:52 +02:00
Vincent Petry
e32d293346
Merge pull request #28476 from nextcloud/search-jail-insensitive
...
use case insensitive like when limiting search to jail
2021-08-24 08:59:35 +02:00
Robin Appelman
c688703117
use getGetUnjailedRoot to determine if jailed search needs the path filter
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-08-23 16:27:53 +02:00
Robin Appelman
c48f9ffcdd
use case insensitive like when limiting search to jail
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-08-17 13:51:45 +02:00
Carl Schwan
28970563a2
Remove some mentions of ownCloud from our api documentation
...
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2021-07-29 15:56:30 +02:00
Robin Appelman
97aadbe46c
dont apply jail search filter is on the root
...
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>
2021-07-26 17:44:52 +02:00
Robin Appelman
362cb2a11f
inject SearchBuilder
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-06-14 16:23:08 +02:00
Robin Appelman
66e10718c6
split of query building bits from searchhelper
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-06-14 16:11:40 +02:00
Robin Appelman
f938daa6e4
update tests and fix some edge cases around new search
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-06-14 16:11:36 +02:00
Robin Appelman
27e50b24aa
some cleanup and documentation
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-06-14 16:11:32 +02:00
Robin Appelman
5d1d53c42e
perform file search in a single query
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-06-14 16:11:29 +02:00
Robin Appelman
9774fb1573
use searchoperation for storage filter instead of db expression
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-06-14 16:11:25 +02:00
Robin Appelman
e198dc1b20
rework search api to allow searching on multiple caches at once
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-06-14 16:11:22 +02:00
John Molakvoæ (skjnldsv)
215aef3cbd
Update php licenses
...
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
2021-06-04 22:02:41 +02:00
Robin Appelman
7ee528fc5a
properly use limit and offset for search in Jail wrapper
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-05-21 15:37:38 +02:00
Robin Appelman
ed2396b045
better cleanup of filecache when deleting an external storage
...
this way it can delete the cache entries even with per-user credentials
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-05-19 17:08:20 +02:00
Morris Jobke
81fef4ddee
Log when a storage is marked as unavailable
...
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2021-03-25 16:19:08 +01:00
John Molakvoæ (skjnldsv)
2074d87d0c
Catch invalid cache source storage path
...
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
2021-03-24 10:36:51 +01:00
Robin Appelman
50e374c12f
only require user to be set in a query that handles tags
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-03-18 17:16:28 +01:00
Robin Appelman
f1e2fb426e
Merge pull request #26013 from nextcloud/object-store-copy-cache-id
...
Return the fileid from `copyFromCache` and use it instead of doing an extra query
2021-03-16 16:11:17 +00:00
Vincent Petry
e559afb8d4
Merge pull request #25136 from nextcloud/cachejail-search-filter
...
do cachejail search filtering in sql
2021-03-15 17:45:30 +01:00
Robin Appelman
d7748e2b4d
verify that cache entry is valid
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-03-12 17:23:02 +01:00
Robin Appelman
c2fc3195dd
also implement for FailedCache and NullCache
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-03-12 17:22:43 +01:00
Robin Appelman
d2bcb57a54
add ICopyFromCache trait to expose existing implementation
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-03-12 17:22:36 +01:00
Roeland Jago Douma
e6ef096e52
Merge pull request #25659 from nextcloud/smb-getmetadata-catch
...
catch notfound and forbidden exception in smb::getmetadata
2021-03-05 08:49:23 +01:00
Robin Appelman
b844293536
catch notfound and forbidden exception in smb::getmetadata
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-03-04 21:34:54 +01:00
Roeland Jago Douma
c3f1eb4f7f
Remove Redundantcasts
...
For #25839
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2021-03-04 14:44:04 +01:00
dependabot-preview[bot]
eb502c02ff
Bump nextcloud/coding-standard from 0.3.0 to 0.5.0
...
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>
2021-02-18 13:31:24 +01:00