Commit graph

828 commits

Author SHA1 Message Date
Côme Chilliet
540d70a6fe Make sure that path is normalized and then checked,
and not the other way around

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-12-08 11:40:11 +00:00
Robin Appelman
19d487838e handle stream wrappers in SeekableHttpStream
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-06-21 15:12:07 +00:00
Joas Schilling
d7a58f7f39
Merge pull request #30834 from nextcloud/backport/29902/stable20
[stable20] Check for invalid characters before trimming
2022-01-25 15:32:49 +01:00
Carl Schwan
0c19c5c65a Fix search results filtering
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-01-25 10:10:12 +00:00
Joas Schilling
787897bf5e Check for invalid characters before trimming
Signed-off-by: Joas Schilling <coding@schilljs.com>
2022-01-25 09:43:37 +00:00
John Molakvoæ
44dc53d5c1
Merge pull request #30657 from nextcloud/backport/29622/stable20 2022-01-20 10:22:55 +01:00
Carl Schwan
e5c54bd8ac
Fix psalm issues
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-01-17 14:39:31 +01:00
Carl Schwan
33f49b13ed Add helper method in Wrapper
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-01-14 14:16:09 +00:00
John Molakvoæ
7ba126c00f
Implement multibucket shift for ObjectStore
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
2022-01-14 08:39:49 +01:00
John Molakvoæ
7e8c3d7779
Merge pull request #29290 from nextcloud/backport/28768/stable20 2021-11-04 09:21:03 +01:00
acsfer
023c060305 Handle files with is_file instead of file_exists
Should fix things like `fread(): read of 8192 bytes failed with errno=21 Is a directory`
2021-10-30 00:20:42 +02:00
Vincent Petry
80dca60858
Extra fixes needed for icewind/streams update to 0.7.2
Signed-off-by: Vincent Petry <vincent@nextcloud.com>
2021-10-25 09:36:48 +02:00
Carl Schwan
bd6b9e2dd1 Fix security issues when copying groupfolder with advanced ACL
Using advanced ACL, it is possible that an user has access to a
directory but not to a subdirectory, so the copying use
Common::copyFromStorage instead of Local::copyFromStorage.

Fix https://github.com/nextcloud/groupfolders/issues/1692

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2021-10-21 16:34:41 +00:00
acsfer
d8ff7eadc6 Simplify :) 2021-10-21 07:36:22 +00:00
acsfer
d845791968 Replace file_exists() method by is_file() 2021-10-21 07:36:22 +00:00
acsfer
f902cfaffe Get filesize() if file_exists()
Should make sense.
2021-10-21 07:36:22 +00:00
Vincent Petry
220004cf58
Merge pull request #29192 from nextcloud/backport/29080/stable20
[stable20] [21] generate a better optimized query for path prefix search filters
2021-10-19 16:45:27 +02:00
Robin Appelman
ff1029e8ef
[21] generate a better optimized query for path prefix search filters
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-10-18 15:39:24 +02:00
Julius Härtl
d97fc4e3da Make sure that a empty directory can still be deleted when copied from another storage
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2021-10-11 08:01:03 +00:00
Daniel Kesselberg
e47903d3ea explicitly close source stream on object store upload even if countwrapper isn't needed
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2021-09-24 11:40:50 +00:00
blizzz
8687bec176
Merge pull request #27407 from nextcloud/backport/24966/stable20
[stable20] avoid fread on directories and unencrypted files
2021-09-23 10:05:05 +02:00
Pauli Järvinen
50729e2693 Support seeking also from the end of file on S3 storage
The PR https://github.com/nextcloud/server/pull/20033 added support
for `fseek` for  the S3 storage backend. However, the seek mode SEEK_END
was left out that time. This PR fills this gap.

Signed-off-by: Pauli Järvinen <pauli.jarvinen@gmail.com>
2021-09-20 18:13:04 +00:00
Robin Appelman
c0b701f7f1
make event constructor backwards compatible just in case
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-09-16 15:14:01 +02:00
Robin Appelman
1ed2550281
update @since for backport
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-09-13 18:01:28 +02:00
Robin Appelman
5e8e252a64 code style and dispatchTyped
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-09-13 15:56:44 +00:00
Robin Appelman
e9234782a2 rename cache event to follow new naming standards
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-09-13 15:56:42 +00:00
Robin Appelman
11e81b340d 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>
2021-09-13 15:56:41 +00:00
Jasper Knockaert
8466c53e00 fix even more brackets
Signed-off-by: Jasper Knockaert jasper@knockaert.nl
2021-09-03 13:42:10 +00:00
Jasper Knockaert
ac650a13d3 fix brakcets 2021-09-03 13:42:10 +00:00
Jasper Knockaert
df3cd0f89e consolidation of boolean expression 2021-09-03 13:42:10 +00:00
Jasper Knockaert
1bca62fa1a avoid fread on directories and unencrypted files
Reworking the logic in order to first check the filecache and only then reading the fileheader.
This in order to solve #21578.
2021-09-03 13:42:09 +00:00
Vincent Petry
610e76555d
Unregister enc stream wrapper for any exception
This prevents side effects in tests by properly cleaning up
even with expected exceptions.

Signed-off-by: Vincent Petry <vincent@nextcloud.com>
2021-08-26 14:26:50 +02:00
Robin Appelman
a4cdebec62
fix Folder->getById() when a single storage is mounted multiple times
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-08-11 09:05:44 +02:00
Robin Appelman
b3e238c731 dont apply jail search filter is on the root
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-07-29 14:40:00 +00:00
Julius Härtl
ae8373df1c Reset checksum when writing files to object store
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2021-07-01 15:38:17 +00:00
Robin Appelman
464aeb065c
properly use limit and offset for search in Jail wrapper
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-06-09 08:08:55 +02:00
Robin Appelman
252268e4d2
Set umask before operations that create local files
this solves issues where "other php stuff" is messing with the umask

Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-06-04 15:42:05 +02:00
Julius Härtl
4f8c89f8a5 Fail when creating new files with an empty path
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2021-04-28 10:06:03 +00:00
Roeland Jago Douma
99e2e5f6b9
Merge pull request #26258 from nextcloud/backport/26198/stable20
[stable20] Handle limit offset and sorting in files search
2021-03-30 20:53:11 +02:00
Morris Jobke
a8c6ffaf9a
Merge pull request #26290 from nextcloud/backport/21484/stable20
[stable20] show better error messages when a file with a forbidden path is encountered
2021-03-26 13:51:02 +01:00
Morris Jobke
3fe78684ad Log when a storage is marked as unavailable
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2021-03-25 16:12:12 +00:00
Robin Appelman
82a2492c33 show better error messages when a file with a forbidden path is encountered
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-03-25 10:56:44 +00:00
Robin Appelman
4b65a1dcd7
fix type hints
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-03-24 16:35:08 +01:00
Robin Appelman
055af29371
handle ordering in folder search
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-03-24 16:01:05 +01:00
Robin Appelman
671b99251e
folder filtering in sql
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-03-24 16:00:58 +01:00
Robin Appelman
4e60b9ffe2
cleanup fileinfo creation
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-03-24 16:00:53 +01:00
Robin Appelman
dbd8b0ae82
format
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-03-24 16:00:47 +01:00
Robin Appelman
6a639ec1d0
handle limit and offset in folder file search
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-03-24 16:00:41 +01:00
Robin Appelman
4655f6feb1
only require user to be set in a query that handles tags
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-03-24 16:00:35 +01:00
Robin Appelman
a624243236
unify handling of Folder::search methods into "new" query objects
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-03-24 16:00:29 +01:00