Commit graph

11428 commits

Author SHA1 Message Date
Joas Schilling
3709a8182a
Apply changes from master's update to 3.1.3
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-11-15 19:06:36 +01:00
Joas Schilling
5300bade47
Allow NULL as well for limit, not integer only
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-11-15 18:59:14 +01:00
Joas Schilling
1aaf9f02a8 Fix missing token update
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-11-12 14:52:37 +00:00
Joas Schilling
ef48e7045e Fix updating with apps
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-11-11 13:42:56 +00:00
John Molakvoæ
fd35e9c13b
Merge pull request #29383 from nextcloud/backport/29304/stable22 2021-11-04 08:45:57 +01:00
John Molakvoæ
244b7ca415
Merge pull request #29506 from nextcloud/backport/29281/stable22 2021-11-04 08:37:55 +01:00
Côme Chilliet
90203c6ca7 Fix resource usages in OC_Image
This makes sure using resource or GdImage (PHP>=8) behaves the same.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2021-11-02 09:59:35 +00:00
Sijmen Schoon
071eda7baa 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:08:32 +00:00
Sijmen Schoon
ec3b1ccd91 Limit parameter count per query in Cache.removeChildren
Signed-off-by: Sijmen Schoon <me@sijmenschoon.nl>
2021-11-01 11:08:31 +00:00
Carl Schwan
8993cf86f1
Merge pull request #29475 from nextcloud/backport/29115/stable22
[stable22] Fix permissions when copying from ObjectStorage
2021-10-30 11:20:07 +02:00
MichaIng
5bd6a4fd29
Merge pull request #29415 from nextcloud/backport/27440/stable22
[stable22] Handle files with `is_file` instead of `file_exists`
2021-10-30 00:19:28 +02:00
Carl Schwan
7bf4a45f49 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-30 00:18:26 +02:00
MichaIng
629225c30a
Merge pull request #29391 from nextcloud/backport/29220/stable22
[stable22] s3 external storage fixes
2021-10-23 20:20:25 +02:00
acsfer
3a5d1c1faf 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-23 09:28:13 +00:00
Christoph Wurst
bc17c790ad Make the route name error more helpful
As a developer I have no clue what "Invalid route name" means. If the
exception gives me a hint I might find it easier to figure out why my
route triggers this error.

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2021-10-22 20:36:42 +00:00
Robin Appelman
5f438375a9 more reliable return value for Watcher::checkUpdate
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-10-22 12:34:30 +00:00
Robin Appelman
a4a4097068 s3 external storage listing rework
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-10-22 12:34:30 +00:00
JanBartels
28cd629de6 Patch for master-branch 2021-10-22 09:35:37 +00:00
Christoph Wurst
4e41638101 Prevent duplicate auth token activity updates
The auth token activity logic works as follows
* Read auth token
* Compare last activity time stamp to current time
* Update auth token activity if it's older than x seconds

This works fine in isolation but with concurrency that means that
occasionally the same token is read simultaneously by two processes and
both of these processes will trigger an update of the same row.
Affectively the second update doesn't add much value. It might set the
time stamp to the exact same time stamp or one a few seconds later. But
the last activity is no precise science, we don't need this accuracy.

This patch changes the UPDATE query to include the expected value in a
comparison with the current data. This results in an affected row when
the data in the DB still has an old time stamp, but won't affect a row
if the time stamp is (nearly) up to date.

This is a micro optimization and will possibly not show any significant
performance improvement. Yet in setups with a DB cluster it means that
the write node has to send fewer changes to the read nodes due to the
lower number of actual changes.

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2021-10-22 09:16:05 +00:00
Carl Schwan
887f4ba2fb 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:20 +00:00
John Molakvoæ
cad44d69dd
Merge pull request #29288 from nextcloud/backport/28768/stable22 2021-10-21 09:31:46 +02:00
Joas Schilling
cbb2ffd1d2
Merge pull request #29301 from nextcloud/backport/29259/stable22
[stable22] Fix app upgrade
2021-10-19 13:36:57 +02:00
John Molakvoæ
27c23b6f13
Merge pull request #29183 from nextcloud/backport/29028/stable22 2021-10-19 11:11:26 +02:00
Joas Schilling
6a7b6ea0e8 Fix app upgrade
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-10-18 19:22:48 +00:00
acsfer
50791c61d3 Simplify :) 2021-10-18 07:59:00 +00:00
acsfer
269d9b5e0b Replace file_exists() method by is_file() 2021-10-18 07:58:59 +00:00
acsfer
698527d197 Get filesize() if file_exists()
Should make sense.
2021-10-18 07:58:59 +00:00
John Molakvoæ (skjnldsv)
f70c17cbcf Add proper message to created share not found
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
2021-10-13 22:48:08 +00:00
blizzz
ef56aa7c33
Merge pull request #29196 from nextcloud/backport/29020/stable22
[stable22] Keep group restrictions when reenabling apps after an update
2021-10-13 19:30:39 +02:00
Joas Schilling
f417c2e642
Keep group restrictions when reenabling apps after an update
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-10-13 14:03:39 +02:00
Joas Schilling
982f956342 Fix translated app details
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-10-13 09:59:48 +00:00
Bjoern Schiessle
ff48e1953d add 'supported'-label to all supported apps, also if they are not downloaded yet
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2021-10-12 11:47:43 +00:00
Julius Härtl
96abf31c3b
Merge pull request #29160 from nextcloud/backport/24185/stable22 2021-10-12 09:12:11 +02:00
MichaIng
a388b2fe72
Merge pull request #29129 from nextcloud/backport/27886/stable22
[stable22] Keep pw based auth tokens valid when pw-less login happens
2021-10-12 02:20:07 +02:00
Julius Härtl
9163894634
Merge pull request #29133 from nextcloud/backport/28907/stable22 2021-10-11 22:22:59 +02:00
Julius Härtl
311988673c Tokens without password should not trigger changed password invalidation
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2021-10-11 09:34:04 +00:00
Julius Härtl
3246eea0b6 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:10 +00:00
John Molakvoæ
c5e9e74a56
Merge pull request #29124 from nextcloud/backport/29123/stable22 2021-10-08 11:40:08 +02:00
Daniel Kesselberg
15417f3824 explicitly close source stream on encryption storage
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2021-10-08 08:04:34 +00:00
Daniel Kesselberg
8ce2a320a1 explicitly close source stream on local storage
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2021-10-08 08:04:34 +00:00
Tobias Assmann
caae37e9e7
add spaces around operators
Signed-off-by: Tobias Assmann <tobias.assmann@ecsec.de>
2021-10-08 08:06:06 +02:00
Tobias Assmann
ce834cbb55
draft to prevent the invalidation of pw based authn tokens on a pw less login
Signed-off-by: Tobias Assmann <tobias.assmann@ecsec.de>
2021-10-08 08:06:03 +02:00
Daniel Kesselberg
d94d4acad6 Set associative = true for cleanup job
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2021-10-07 19:34:10 +00:00
Robin Appelman
d4fb676dd7 generate a better optimized query for path prefix search filters
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-10-07 15:19:58 +00:00
MichaIng
3ff8e940d1
Merge pull request #29086 from nextcloud/backport/29082/stable22
[stable22] Add a few sensitive config keys
2021-10-06 13:28:50 +02:00
Julius Härtl
59c5304159
Merge pull request #29062 from nextcloud/backport/28939/stable22 2021-10-06 09:59:30 +02:00
Julien Veyssier
c681ed2e9b consider some config keys under 'objectstore_multibucket' as sensitive
Signed-off-by: Julien Veyssier <eneiluj@posteo.net>
2021-10-06 07:52:38 +00:00
acsfer
99c053e5d9 Avoid usage of Nextcloud API, use PHP function 2021-10-04 17:27:53 +00:00
acsfer
0506288882 Fix path of file_get_contents
Try to fix #28370  and #27441 

Avoid pre-pends the `$path` to the user's own storage.
2021-10-04 17:27:53 +00:00
Joas Schilling
7eface3bfd Don't further setup disabled users when logging in with apache
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-10-04 11:03:04 +00:00