Robin Appelman
f6024a895c
also use case sensitive like when searching in a folder
...
this case was missed from https://github.com/nextcloud/server/pull/29080
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-12-14 17:49:48 +01:00
Louis
f41c1fffff
Merge pull request #30056 from nextcloud/backport/29735/stable21
...
[stable21] find users for background scan one by one
2021-12-08 18:06:00 +01:00
John Molakvoæ
fda86f8c8c
Merge pull request #29834 from nextcloud/carl/bugfix/file-search-21
2021-12-06 14:51:55 +01:00
Robin Appelman
bd677f6741
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 20:00:45 +00:00
Carl Schwan
8f9d1b31df
Fix search results filtering
...
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2021-11-26 16:30:47 +01:00
MichaIng
9db07032d5
Use pre-v22 query commands
...
Signed-off-by: MichaIng <micha@dietpi.com>
2021-11-24 14:47:23 +01:00
Robin Appelman
a3dc399e2f
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-11-24 14:47:23 +01:00
Vincent Petry
ca37664887
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:39 +00:00
Vincent Petry
88b5860e70
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:39 +00:00
Vincent Petry
2e79444828
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:39 +00:00
John Molakvoæ
5b89d34397
Revert "[21] tell mysql to ignore the sort index for search queries"
2021-11-04 11:10:46 +01:00
John Molakvoæ
07c20b4f22
Merge pull request #29322 from nextcloud/mysql-search-ignore-index-21
2021-11-04 09:00:16 +01:00
Sijmen Schoon
43e829a93e
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-11-01 11:27:36 +00:00
Sijmen Schoon
bb198c635f
Limit parameter count per query in Cache.removeChildren
...
Signed-off-by: Sijmen Schoon <me@sijmenschoon.nl>
2021-11-01 11:27:36 +00:00
Carl Schwan
00a9b0c1db
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 12:55:53 +00:00
Robin Appelman
99ba96524e
more reliable return value for Watcher::checkUpdate
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-10-26 14:45:08 +02:00
Robin Appelman
5002bf9cc1
tell mysql to ignore the sort index for search queries
...
mysql really likes to pick an index for sorting if it can't fully satisfy the where
filter with an index, since search queries pretty much never are fully filtered by index
mysql often picks an index for sorting instead of the *much* more useful index for filtering.
To bypass this, we tell mysql explicitly not to use the mtime (the default order field) index,
so it will instead pick an index that is actually useful.
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-10-18 18:05:48 +02:00
Robin Appelman
7f272dd98f
allow specifying index hints for mysql search queries
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-10-18 18:03:34 +02:00
Robin Appelman
916a838873
[21] generate a better optimized query for path prefix search filters
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-10-12 15:55:57 +02:00
Robin Appelman
a9fbd0b41b
dont apply jail search filter is on the root
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-07-29 14:22:38 +02:00
John Molakvoæ
218a96ebf9
Revert "[stable21] better cleanup of filecache when deleting an external storage"
2021-07-27 15:51:10 +02:00
Robin Appelman
feb640cd64
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-07-13 08:54:30 +02:00
Robin Appelman
a21eb8d6d2
properly use limit and offset for search in Jail wrapper
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-05-31 12:28:12 +00:00
Morris Jobke
cf8be87e47
Log when a storage is marked as unavailable
...
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2021-03-25 16:10:28 +00:00
Morris Jobke
ffb7c51ca6
Merge pull request #26257 from nextcloud/backport/26198/stable21
...
[stable21] Handle limit offset and sorting in files search
2021-03-24 17:32:36 +01:00
John Molakvoæ (skjnldsv)
e9fafce71b
Catch invalid cache source storage path
...
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
2021-03-24 11:03:30 +00:00
Robin Appelman
2500d296c5
only require user to be set in a query that handles tags
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-03-23 13:41:11 +00:00
Morris Jobke
95ebe5e819
Merge pull request #26146 from nextcloud/backport/26013/stable21
...
[stable21] Return the fileid from `copyFromCache` and use it instead of doing an extra query
2021-03-17 20:03:58 +01:00
Morris Jobke
4b3684fbc4
Merge pull request #25943 from nextcloud/backport/25659/stable21
...
[stable21] catch notfound and forbidden exception in smb::getmetadata
2021-03-17 13:50:39 +01:00
Robin Appelman
44d4957548
verify that cache entry is valid
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-03-16 16:17:59 +00:00
Robin Appelman
f6f92e8bc6
also implement for FailedCache and NullCache
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-03-16 16:17:58 +00:00
Robin Appelman
bb180a95bb
add ICopyFromCache trait to expose existing implementation
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-03-16 16:17:56 +00:00
Robin Appelman
c727879073
adjust tests
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-03-15 17:51:34 +00:00
Robin Appelman
ec0985ba68
fix search in nested jails
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-03-15 17:51:33 +00:00
Robin Appelman
eb56b1d0bd
fix cachjail searching for root
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-03-15 17:51:32 +00:00
Robin Appelman
046638abeb
do cachejail search filtering in sql
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-03-15 17:51:32 +00:00
Robin Appelman
67d62a820c
catch notfound and forbidden exception in smb::getmetadata
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-03-05 07:51:47 +00:00
Christoph Wurst
8b64e92b92
Bump doctrine/dbal from 2.12.0 to 3.0.0
...
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2021-01-08 11:45:19 +01:00
Robin Appelman
205386b24e
ignore files that have no read permissions during scanning
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-01-06 17:27:31 +01:00
Christoph Wurst
9ce3ea3368
Update license headers
...
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-12-30 14:07:05 +01:00
Roeland Jago Douma
4973f9b952
Merge pull request #24715 from nextcloud/bug/noid/limit-get-incomplete-to-1
...
Limit getIncomplete query to one row
2020-12-21 09:15:10 +01:00
Christoph Wurst
d89a75be0b
Update all license headers for Nextcloud 21
...
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-12-16 18:48:22 +01:00
Daniel Kesselberg
e0e76bb784
Limit getIncomplete query to one row
...
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2020-12-15 21:42:26 +01:00
Robin Appelman
aef1cdba03
code style and dispatchTyped
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2020-12-02 16:15:02 +01:00
Robin Appelman
88f35d52d2
rename cache event to follow new naming standards
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2020-11-26 15:39:46 +01:00
Robin Appelman
23fb497ff5
extend cache events
...
- adds cache remove event
- expose storage id in event
- emit events during cache move
Signed-off-by: Robin Appelman <robin@icewind.nl>
2020-11-26 15:22:03 +01:00
Joas Schilling
cffad62771
Empty string is returned as null, but empty string in file cache is the root and exists
...
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-11-10 15:35:43 +01:00
Joas Schilling
8027dcbc6f
Don't leave cursors open when tests fail
...
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-11-09 12:28:17 +01:00
Joas Schilling
c07720de77
Use query builder instead of OC_DB in OC\Files\*
...
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-11-09 09:05:15 +01:00
Joas Schilling
4b125d4402
Use Query builder function
...
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-11-06 12:13:22 +01:00