Julius Härtl
8f3e6c755f
fix: Only read unencrypted_size when file is actually encrypted
...
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2023-09-12 15:07:56 +02:00
Julius Härtl
72cb434e8d
fix: Check for wrapped retriable exceptions
...
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2023-06-21 19:22:31 +00:00
Robin Appelman
286469a713
clear encrypted flag when moving away from encrypted storage
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2023-04-01 16:49:28 +00:00
Robin Appelman
0bd5bcdaeb
escape path prefix when doing cache jail search
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2023-01-11 17:12:40 +00:00
Andy Xheli
775c62860c
Fix Executing a query: SQLSTATE[42000]
...
Signed-off-by: Andy Xheli <axheli@axtsolutions.com>
Fix https://github.com/nextcloud/server/issues/32007#issuecomment-1329405245
Signed-off-by: Andy Xheli <axheli@axtsolutions.com>
2022-11-30 15:04:47 +00:00
John Molakvoæ
e8a69778d3
Merge pull request #34770 from nextcloud/backport/34579/stable24
...
[stable24] fix null error in getUnencryptedSize
2022-10-27 18:12:46 +02:00
raul
bdbacdffc2
Fix unencrypted size calculation for files created before the Encryption storage is enabled
...
Signed-off-by: raul <raul@nextcloud.com>
2022-10-25 15:08:22 +00:00
raul
ba12309f3c
Fix: Prevent deadlocks during mtime/size/etag propagation
...
Signed-off-by: raul <raul@nextcloud.com>
2022-10-25 15:08:22 +00:00
Robin Appelman
29c359d7e7
fix null error in getUnencryptedSize
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-10-24 13:34:52 +00:00
blizzz
7e980a1f1f
Merge pull request #33656 from nextcloud/backport/33574/stable24
...
[stable24] directly build the search filter for shared storage instead of setting up the source cache
2022-08-30 17:48:11 +02:00
Robin Appelman
9cadbe811e
directly build the search filter for shared storage instead of setting up the source cache
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-08-23 12:19:14 +00:00
Robin Appelman
9deae5b17a
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-18 13:39:36 +02:00
Robin Appelman
ea9509eaf9
fix updating size when folder is empty
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-08-16 13:40:45 +02:00
Jonas
aec0899efd
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:25:26 +00:00
Robin Appelman
fd2afe604e
store unencrypted size in the unencrypted_size column
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-06-03 15:43:50 +02:00
Robin Appelman
32cd1bed38
tell mysql to ignore the sort index for search queries
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-05-16 09:53:43 +00:00
Robin Appelman
9834350ac3
Merge pull request #31713 from nextcloud/fed-performance
...
Federated share performance improvements
2022-04-07 18:53:36 +00:00
Joas Schilling
a44671d396
Merge pull request #31816 from nextcloud/bugfix/noid/deduplicate-storage-id-before-reusing
...
Deduplicate storage ids in list before reusing
2022-04-04 19:00:22 +02:00
Robin Appelman
cc5e26bb14
Merge pull request #31776 from nextcloud/storage-id-cache-bi-directional
...
cache storage id mapping both ways
2022-04-04 14:50:23 +00:00
Robin Appelman
5e2dd29aaf
only request free space once for external shares
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-04-04 16:48:27 +02:00
Robin Appelman
89d3cd1447
don't overwrite the etag from storage backends that already provide "good" etags
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-04-04 16:48:18 +02:00
Joas Schilling
d3b9d49c22
Deduplicate storage ids in list before reusing
...
Signed-off-by: Joas Schilling <coding@schilljs.com>
2022-04-04 07:07:48 +02:00
Robin Appelman
ac657b0f06
cache storage id mapping both ways
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-03-31 14:35:42 +02:00
Côme Chilliet
ea23523c70
Adapt more code to migration to LoggerInterface
...
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-03-24 16:21:25 +01:00
Côme Chilliet
6be7aa112f
Migrate from ILogger to LoggerInterface in lib/private
...
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-03-24 16:21:25 +01:00
Robin Appelman
84f464550a
some file scanner performance improvements
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-03-17 22:21:16 +01:00
Robin Appelman
b0ce876f41
return dummy availability if storage is not found in cache
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-02-25 15:25:13 +01:00
acsfer
074a9a5e88
Switch logical operators
...
Unless there is a good reason to keep actual ones 👀
2021-12-03 16:05:19 +01:00
Robin Appelman
f5fe887b4b
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:34:58 +01:00
Côme Chilliet
113756db30
Fix ArrayAccess and JsonSerializable return types
...
First round of modifications for PHP 8.1
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2021-11-23 09:28:56 +01:00
Vincent Petry
c92a0e4152
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-17 09:43:25 +01:00
Vincent Petry
67ebe75d0e
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-17 09:24:13 +01:00
Vincent Petry
39fe43b914
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-17 09:24:13 +01: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