aboutsummaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* Fix resource usages in OC_ImageCôme Chilliet2021-10-286-23/+26
| | | | | | This makes sure using resource or GdImage (PHP>=8) behaves the same. Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Merge pull request #29115 from ↵Carl Schwan2021-10-282-1/+9
|\ | | | | | | | | nextcloud/work/carl/correct-permissions-when-copying Fix permissions when copying from ObjectStorage
| * Fix permissions when copying from ObjectStorageCarl Schwan2021-10-282-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge pull request #29444 from ↵Joas Schilling2021-10-284-13/+77
|\ \ | | | | | | | | | | | | nextcloud/bugfix/noid/public-api-for-trusted-domain-helpers Add an OCP for trusted domain helper
| * | Add an OCP for trusted domain helperJoas Schilling2021-10-284-13/+77
| | | | | | | | | | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* | | Merge pull request #29453 from nextcloud/bugfix/noid/improve-wordingJohn Molakvoæ2021-10-272-4/+2
|\ \ \
| * | | Improve wordingJoas Schilling2021-10-272-4/+2
| |/ / | | | | | | | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* | | Prevent unnecesary profile action registrationsChristopher Ng2021-10-261-11/+20
| | | | | | | | | | | | Signed-off-by: Christopher Ng <chrng8@gmail.com>
* | | Merge pull request #29435 from nextcloud/explicitly-name-profile-link-actionJohn Molakvoæ2021-10-263-11/+11
|\ \ \
| * | | Use more explicit naming for profile link actionChristopher Ng2021-10-253-11/+11
| |/ / | | | | | | | | | Signed-off-by: Christopher Ng <chrng8@gmail.com>
* / / [tx-robot] updated from transifexNextcloud bot2021-10-262-0/+32
|/ / | | | | | | Signed-off-by: Nextcloud bot <bot@nextcloud.com>
* | Merge pull request #29425 from nextcloud/revert-28138-zorn-v-patch-2John Molakvoæ2021-10-251-1/+0
|\ \
| * | Revert "Fix "never catch" catches in OC_App"Joas Schilling2021-10-251-1/+0
| | |
* | | Merge pull request #26531 from J0WI/refactor-preview-execJohn Molakvoæ2021-10-256-64/+94
|\ \ \ | |/ / |/| |
| * | Use findBinaryPath for previewsJ0WI2021-10-236-64/+94
| | | | | | | | | | | | Signed-off-by: J0WI <J0WI@users.noreply.github.com>
* | | [tx-robot] updated from transifexNextcloud bot2021-10-252-0/+2
|/ / | | | | | | Signed-off-by: Nextcloud bot <bot@nextcloud.com>
* | Add type hint to fread_block $blockSize param & apply cs:fix.alanmeeson2021-10-231-2/+2
| | | | | | | | Signed-off-by: alanmeeson <alan@carefullycalculated.co.uk>
* | Fix truncation of files upon read when using object store and encryption.Alan Meeson2021-10-231-2/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using and object store as primary storage and using the default encryption module at the same time, any encrypted file would be truncated when read, and a text error message added to the end. This was caused by a combination of the reliance of the read functions on on knowing the unencrypted file size, and a bug in the function which calculated the unencrypted file size for a given file. In order to calculate the unencrypted file size, the function would first skip the header block, then use fseek to skip to the last encrypted block in the file. Because there was a corresponence between the encrypted and unencrypted blocks, this would also be the last encrypted block. It would then read the final block and decrypt it to get the unencrypted length of the last block. With that, the number of blocks, and the unencrypted block size, it could calculate the unencrypted file size. The trouble was that when using an object store, an fread call doesn't always get you the number of bytes you asked for, even if they are available. To resolve this I adapted the stream_read_block function from lib/private/Files/Streams/Encryption.php to work here. This function wraps the fread call in a loop and repeats until it has the entire set of bytes that were requested, or there are no more to get. This fixes the imediate bug, and should (with luck) allow people to get their encrypted files out of Nextcloud now. (The problem was purely on the decryption side). In the future it would be nice to do some refactoring here. I have tested this with image files ranging from 1kb to 10mb using Nextcloud version 22.1.0 (the nextcloud:22.1-apache docker image), with sqlite and a Linode object store as the primary storage. Signed-off-by: Alan Meeson <alan@carefullycalculated.co.uk>
* | Merge pull request #27440 from nextcloud/is-file-handleJohn Molakvoæ2021-10-231-4/+4
|\ \
| * | Handle files with is_file instead of file_existsacsfer2021-08-151-4/+4
| | | | | | | | | Should fix things like `fread(): read of 8192 bytes failed with errno=21 Is a directory`
* | | Merge pull request #28138 from nextcloud/zorn-v-patch-2John Molakvoæ2021-10-231-0/+1
|\ \ \
| * | | Fix "never catch" catches in OC_Appzorn-v2021-10-221-0/+1
| | | | | | | | | | | | Need to check another legacy. Need to explicitly add to use or do not forget add slash `\`
* | | | Merge pull request #29363 from nextcloud/fair-use-pushJohn Molakvoæ2021-10-235-33/+93
|\ \ \ \
| * | | | Fair use of push notificationsJoas Schilling2021-10-235-33/+93
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We want to keep offering our push notification service for free, but large users overload our infrastructure. For this reason we have to rate-limit the use of push notifications. If you need this feature, consider setting up your own push server or using Nextcloud Enterprise. Signed-off-by: Joas Schilling <coding@schilljs.com>
* | | | | Merge pull request #29397 from nextcloud/fix/noid/profile-missing-def-valuesJohn Molakvoæ2021-10-231-6/+7
|\ \ \ \ \
| * | | | | fix populating account array with missing default valuesArthur Schiwon2021-10-221-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - both $userData and $defaultUserData have numeric indices - each element contains at least the name and other fields - appending the missing data array is sufficient Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* | | | | | [tx-robot] updated from transifexNextcloud bot2021-10-234-2/+32
| |/ / / / |/| | | | | | | | | | | | | | Signed-off-by: Nextcloud bot <bot@nextcloud.com>
* | | | | Merge pull request #29378 from nextcloud/fix/unhelpful-route-name-errorDaniel2021-10-222-2/+2
|\ \ \ \ \ | |/ / / / |/| | | | Make the route name error more helpful
| * | | | Make the route name error more helpfulChristoph Wurst2021-10-222-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | | | Merge pull request #25392 from nextcloud/imountpoint-ocp-storageJulius Härtl2021-10-225-5/+7
|\ \ \ \ \
| * \ \ \ \ Merge branch 'master' into imountpoint-ocp-storageJohn Molakvoæ2021-10-221462-7591/+13453
| |\ \ \ \ \
| * | | | | | dont return private storage interface from public mount interfaceRobin Appelman2021-03-235-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* | | | | | | Merge pull request #29220 from nextcloud/s3-external-listJohn Molakvoæ2021-10-222-2/+9
|\ \ \ \ \ \ \ | |_|/ / / / / |/| | | | | |
| * | | | | | more reliable return value for Watcher::checkUpdateRobin Appelman2021-10-151-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
| * | | | | | s3 external storage listing reworkRobin Appelman2021-10-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* | | | | | | Merge pull request #26347 from J0WI/clean-path-regexJohn Molakvoæ2021-10-221-4/+4
|\ \ \ \ \ \ \
| * | | | | | | Cleaner normalizePath regexJ0WI2021-03-271-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: J0WI <J0WI@users.noreply.github.com>
* | | | | | | | Merge pull request #27876 from ↵John Molakvoæ2021-10-221-3/+9
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | nextcloud/bugfix/noid/use-cached-user-backend-info-for-password-login
| * | | | | | | | Use cached user backend info for password loginJoas Schilling2021-09-141-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* | | | | | | | | Merge pull request #29344 from nextcloud/dependabot/composer/doctrine/dbal-3.1.3John Molakvoæ2021-10-223-5/+5
|\ \ \ \ \ \ \ \ \
| * | | | | | | | | Bump doctrine/dbal from 3.0.0 to 3.1.3Christoph Wurst2021-10-223-5/+5
| | |_|_|_|/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* | | | | | | | | Merge pull request #29304 from JanBartels/masterJohn Molakvoæ2021-10-221-1/+1
|\ \ \ \ \ \ \ \ \ | |_|_|_|_|_|/ / / |/| | | | | | | |
| * | | | | | | | Patch for master-branchJanBartels2021-10-181-1/+1
| | | | | | | | |
* | | | | | | | | Merge pull request #29357 from ↵John Molakvoæ2021-10-222-2/+40
|\ \ \ \ \ \ \ \ \ | |_|/ / / / / / / |/| | | | | | | | | | | | | | | | | nextcloud/fix/concurrent-duplicate-auth-token-updates
| * | | | | | | | Prevent duplicate auth token activity updatesChristoph Wurst2021-10-222-2/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | | | | | | | [tx-robot] updated from transifexNextcloud bot2021-10-222-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Nextcloud bot <bot@nextcloud.com>
* | | | | | | | | Merge pull request #29362 from nextcloud/fix/groupfolder-copy-aclCarl Schwan2021-10-211-1/+4
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | Fix security issues when copying groupfolder with advanced ACL
| * | | | | | | | | Fix security issues when copying groupfolder with advanced ACLCarl Schwan2021-10-211-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | | | | | | | | Merge pull request #23171 from nextcloud/enh/preview/move_to_bootstrapJohn Molakvoæ2021-10-218-2/+143
|\ \ \ \ \ \ \ \ \ \ | |_|/ / / / / / / / |/| | | | | | | | |
| * | | | | | | | | Move preview provider registration to bootstrapRoeland Jago Douma2021-10-218-2/+143
| |/ / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl> Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>