aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Files/Storage/Wrapper
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #44294 from nextcloud/fix/storage-mount-ownerJulius Härtl2024-04-091-0/+4
|\ | | | | fix: Pass the mountpoint target user to storages without owner
| * fix: Pass the mountpoint target user to storages without ownerJulius Härtl2024-04-091-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | Storages that do not have a dedicated owner (e.g. groupfolders, external storages) currently always assume the current session user as the owner. This leads to several issues when there is no user session but a node is obtained through a user folder. In order to have the correct user available we need to pass the user that is used to setup a mountpoint along to the storage layer as we generally assume that an owner is available for those. Signed-off-by: Julius Härtl <jus@bitgrid.net>
* | fix: use proper jailed patch in watcherRobin Appelman2024-04-081-4/+3
|/ | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* fix: Apply new coding standard to all filesCôme Chilliet2024-04-024-12/+12
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* fix: log error when default getWrapperStorage would return nullRobin Appelman2024-03-201-0/+9
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* fix: add some recrusive detection/preventionRobin Appelman2024-03-081-0/+11
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* chore: apply changes from Nextcloud coding standards 1.1.1Joas Schilling2023-11-231-1/+1
| | | | | Signed-off-by: Joas Schilling <coding@schilljs.com> Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
* optimize cache jail creationRobin Appelman2023-10-191-4/+1
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* Convert isset ternary to null coalescing operatorHamid Dehnavi2023-09-281-2/+2
| | | | Signed-off-by: Hamid Dehnavi <hamid.dev.pro@gmail.com>
* add wrapper to ensure we don't get an mtime that is lower than we know it isRobin Appelman2023-09-191-0/+142
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* fix: Only store unencrypted_size if path should be encryptedJulius Härtl2023-09-061-1/+1
| | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>
* extend fix-key-location to handle cases from broken cross-storage movesRobin Appelman2023-08-311-29/+17
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* only determine quota_include_external_storage once for quota wrapperRobin Appelman2023-08-181-2/+3
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* fix(sse): don't update uncached filesRichard Steinmetz2023-07-041-13/+21
| | | | Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
* Refactors "strpos" calls in lib/private to improve code readability.Faraz Samapoor2023-05-153-5/+5
| | | | Signed-off-by: Faraz Samapoor <fsamapoor@gmail.com>
* Fix file_get_content signatures to make it clear it can return falseCôme Chilliet2023-04-274-4/+4
| | | | | | | In File::getContent, which must return a string, throw an Exception instead of returning false. Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Merge pull request #36857 from nextcloud/scan-repair-unencrypted-sizeRobin Appelman2023-04-241-1/+4
|\ | | | | fix unencrypted_size for folders when scanning the filesystem with encryption enabled
| * fix unencrypted_size for files when scanningRobin Appelman2023-04-041-1/+4
| | | | | | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* | Merge pull request #34607 from nextcloud/encryption-size-not-foundVincent Petry2023-04-061-1/+3
|\ \ | | | | | | fix encryption wrapper filesize for non existing files
| * | fix encryption wrapper filesize for non existing filesRobin Appelman2023-04-041-1/+3
| |/ | | | | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* / Fix return type of methods returning false on errorCôme Chilliet2023-04-034-10/+10
|/ | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Fix quota typing for 32bits after forward port from 25Côme Chilliet2023-04-011-2/+2
| | | Signed-off-by: Côme Chilliet <91878298+come-nc@users.noreply.github.com>
* Adapt types of subclassesCôme Chilliet2023-04-012-4/+4
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Make it clear that file sizes may be float on 32bitsCôme Chilliet2023-04-012-9/+11
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Remove quota value type for 32-bit systemsVincent Petry2023-04-011-2/+2
| | | | Signed-off-by: Vincent Petry <vincent@nextcloud.com>
* Respect OCP interface in private classesCôme Chilliet2023-02-075-5/+5
| | | | | | | Because the parameter type was moved to phpdoc it needs to be removed from implementations Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Fix psalm errors related to filesizesCôme Chilliet2023-02-072-1/+4
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Strong type filesize related methods to ease 32bits problem findingsCôme Chilliet2023-02-075-17/+5
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* fix(encryption): don't throw on missing fileRichard Steinmetz2023-01-301-4/+1
| | | | Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
* composer run cs:fixCôme Chilliet2023-01-202-4/+0
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Suppress last psalm error until upstream fix is released and includedCôme Chilliet2023-01-021-0/+1
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Fix psalm spotted errors with new requirementsCôme Chilliet2023-01-021-1/+1
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* clear is-encrypted cache when trying to fix encrypted versionRobin Appelman2022-12-011-0/+4
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* fix reading newly written encrypted files before their cache entry is writtenRobin Appelman2022-11-301-4/+12
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* Rename file1 and file2 to source and target in Storage abstractionCarl Schwan2022-10-186-56/+55
| | | | Signed-off-by: Carl Schwan <carl@carlschwan.eu>
* Switch logical operators (and|or)Git'Fellow2022-09-121-18/+12
| | | Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
* get quota for user only when neededRobin Appelman2022-09-011-20/+51
| | | | | | always apply the wrapper but have the wrapper get the quota lazily only when an operation where quota is applied is performed Signed-off-by: Robin Appelman <robin@icewind.nl>
* Move CappedMemoryCache to OCPCarl Schwan2022-07-141-1/+1
| | | | | | | | This is an helpful helper that should be used in more place than just server and this is already the case with groupfodlers, deck, user_oidc and more using it, so let's make it public Signed-off-by: Carl Schwan <carl@carlschwan.eu>
* store unencrypted size in the unencrypted_size columnRobin Appelman2022-06-021-40/+58
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* Fixing psalm errorsCôme Chilliet2022-03-241-9/+9
| | | | | | Encryption constructor is problematic and should still be fixed later. Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Migrate from ILogger to LoggerInterface in lib/privateCôme Chilliet2022-03-241-26/+14
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Merge pull request #30631 from nextcloud/fix/update_encrypted_versionVincent Petry2022-01-141-1/+10
|\ | | | | updateEncryptedVersion: cleanup on target if cache already got renamed
| * updateEncryptedVersion: cleanup on target if cache already got renamedJonas Meurer2022-01-121-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When moving a file to trash with encryption enabled, the cache gets moved before the actual file. According to @icewind1991 this is in order to not break object storage. When moving a file from an unencrypted storage (e.g. a collectives storage) to the encrypted trashbin storage, this causes errors, see This commit fixes it by doing `updateEncryptedVersion()` on the target cache entry *if* the source cache entry doesn't exist anymore, but the corresponding target cache entry does exist already. Fixes: #26544 Signed-off-by: Jonas Meurer <jonas@freesources.org>
* | Fix psalm issuesCarl Schwan2022-01-131-6/+6
| | | | | | | | Signed-off-by: Carl Schwan <carl@carlschwan.eu>
* | Add helper method in WrapperCarl Schwan2022-01-131-1/+20
|/ | | | Signed-off-by: Carl Schwan <carl@carlschwan.eu>
* Fix fail when keys/files folder already existsVincent Petry2022-01-101-1/+5
| | | | | | | | | Fixes an issue with transfer ownership in move mode where the folder "files_encryption/keys/files" already exists. Instead of failing, its existence is checked before calling mkdir. Signed-off-by: Vincent Petry <vincent@nextcloud.com>
* Check resource before closing in encryption wrapperVincent Petry2021-12-091-2/+6
| | | | | | | | | | | In case of error there is no guarantee that $source or $target is set or is a resource when handling an error. Without this fix, there's a risk that fclose will fail and the actual exception will not be thrown, making it impossible to find out about the root cause. Signed-off-by: Vincent Petry <vincent@nextcloud.com>
* Normalize directory entries in Encoding wrapperVincent Petry2021-11-172-3/+66
| | | | | | | | | | | | 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>
* Update lib/private/Files/Storage/Wrapper/Availability.php add void Vincent Petry2021-11-051-1/+1
| | | | | Signed-off-by: Vincent Petry <vincent@nextcloud.com> Co-authored-by: Carl Schwan <carl@carlschwan.eu>
* Return false in hasUpdated when storage is not availableVincent Petry2021-11-051-4/+10
| | | | | | | | | | Technically, saying that a storage has no updates when it's not available is correct. This makes it possible to retrieve the cache entry for the mount point and also to list and remove unavailable federated shares. Signed-off-by: Vincent Petry <vincent@nextcloud.com>