aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Files/Storage/Local.php
Commit message (Collapse)AuthorAgeFilesLines
* fix(Storage): Fix method docs inheritancefix/storage/method-docs-inheritanceprovokateurin2024-09-171-3/+0
| | | | Signed-off-by: provokateurin <kate@provokateurin.de>
* chore: improve hash_file php usage in Local Storageartonge/fix/hash_return_typeJohn Molakvoæ2024-09-161-8/+1
| | | | Co-authored-by: Ferdinand Thiessen <opensource@fthiessen.de> Signed-off-by: John Molakvoæ <skjnldsv@users.noreply.github.com>
* fix(files): Ensure that the hash method does not return nullLouis Chemineau2024-09-161-2/+9
| | | | | | | | To match https://github.com/nextcloud/server/blob/beececf66068f57c416225efcde9b44ce5c2e835/lib/private/Files/View.php#L1050 - Fix https://github.com/nextcloud/server/issues/44110 Signed-off-by: Louis Chemineau <louis@chmn.me>
* fix(Storage\Local): Do not call getSourcePath() on SplFileInfofix/storage-local/get-source-path-spl-file-infoprovokateurin2024-09-151-1/+1
| | | | Signed-off-by: provokateurin <kate@provokateurin.de>
* fix(files): Never return a null ETag in DAVprovokateurin2024-09-091-7/+1
| | | | Signed-off-by: provokateurin <kate@provokateurin.de>
* fix: Release directory iterator and thereby its potential directory lock ↵Dennis Verspuij2024-07-271-0/+1
| | | | | | prior to deleting a directory, to avoid e.g. "Text file busy" error with VirtualBox shared folder storage Signed-off-by: Dennis Verspuij <6680484+dennisverspuij@users.noreply.github.com>
* chore: Add SPDX headerAndy Scherzinger2024-05-241-40/+4
| | | | Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
* fix: Fix newly spotted psalm issues, add exhaustive typed magic properties ↵Côme Chilliet2024-04-301-0/+1
| | | | | | for LDAP classes Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* fix(CI): Suppress psalm UndefinedClassJoas Schilling2024-04-181-0/+1
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* fix(files): Also skip cross storage move with access controlJoas Schilling2024-04-171-0/+2
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* fix: Apply new coding standard to all filesCôme Chilliet2024-04-021-1/+1
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* fix: avoid scanning a non existing directoryBenjamin Gaussorgues2024-03-141-1/+5
| | | | Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
* add some support for rename on case insensitive local filesystemsRobin Appelman2023-10-201-1/+26
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* Merge pull request #39216 from shdehnavi/replace_substr_calls_in_lib_privateRobin Appelman2023-09-211-2/+2
|\ | | | | Refactor "substr" calls in lib/private to improve code readability
| * Refactor "substr" calls to improve code readabilityHamid Dehnavi2023-07-071-2/+2
| | | | | | | | Signed-off-by: Hamid Dehnavi <hamid.dev.pro@gmail.com>
* | Allow ext storage Local to go unavailableVincent Petry2023-08-291-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | Whenever an external storage of type Local points at a non-existing directory, process this as a StorageNotAvailable instead of returning 404. This makes desktop clients ignore the folder instead of deleting it when it becomes unavailable. The code change was limited to external storages to avoid issues during setup and with the default home storage. Signed-off-by: Vincent Petry <pvince81@yahoo.fr>
* | fix: copy-and-delete fallback should use unlinkDaniel Kesselberg2023-07-311-1/+1
| | | | | | | | | | | | because rmdir does not work for files. Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
* | fix(storage): fallback to copy and unlink when rename failsDaniel Kesselberg2023-07-311-13/+6
|/ | | | Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
* invert elseif on rmdir for local storage Lorenzo Tanganelli2023-05-241-2/+2
| | | Signed-off-by: Lorenzo Tanganelli <lorenzo.tanganelli@hotmail.it>
* Get rid of more int casts in file size manipulationsCôme Chilliet2023-05-111-1/+2
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Merge pull request #37062 from nextcloud/free-spaceRobin Appelman2023-04-211-1/+1
|\ | | | | Check free space only if source exists and is dir
| * Add function_exists() checkGit'Fellow2023-03-071-1/+1
| | | | | | | | Co-authored-by: Simon L. <szaimen@e.mail.de> Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
| * Fix free space problemsGit'Fellow2023-03-071-1/+1
| | | | | | Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
* | Use typed version of IConfig::getSystemValue as much as possibleCôme Chilliet2023-04-051-2/+2
| | | | | | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* | Remove unused method getLocalFolderCôme Chilliet2023-04-031-4/+0
| | | | | | | | | | | | It’s not used and not in any OCP interface/class. Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* | Remove useless coalescing operator on non-null return valueCôme Chilliet2023-04-011-1/+1
| | | | | | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* | Silence a warning from psalm with explanationCôme Chilliet2023-04-011-0/+1
|/ | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Respect OCP interface in private classesCôme Chilliet2023-02-071-1/+1
| | | | | | | 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>
* Strong type filesize related methods to ease 32bits problem findingsCôme Chilliet2023-02-071-2/+2
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Revert "remove 32-bit workarounds"Côme Chilliet2023-02-071-0/+13
| | | | | | This reverts commit dd8774389e21b59c07882580356d51de018fe867. Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* fix moving files of encrypted local storage to unencrypted local storageRobin Appelman2023-01-241-5/+13
| | | | | | for example when moving encrypted files to a groupfolder Signed-off-by: Robin Appelman <robin@icewind.nl>
* fix psalmszaimen2022-11-021-1/+1
| | | | Signed-off-by: szaimen <szaimen@e.mail.de>
* remove 32-bit workaroundsszaimen2022-11-021-13/+0
| | | | Signed-off-by: szaimen <szaimen@e.mail.de>
* Rename file1 and file2 to source and target in Storage abstractionCarl Schwan2022-10-181-21/+21
| | | | Signed-off-by: Carl Schwan <carl@carlschwan.eu>
* trigger a rescan when trying to fopen a file that exists in cache but not on ↵Robin Appelman2022-09-291-1/+8
| | | | | | disk Signed-off-by: Robin Appelman <robin@icewind.nl>
* config: add a switch to control truncate before updateTigran Mkrtchyan2022-09-161-6/+12
| | | | | | | | | To avoid extra truncate on non WORM file systems, add a new config option `localstorage.unlink_on_truncate`, which defaults to false. The OC\Files\Storage\Local is update to respect that option. Signed-off-by: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
* files: remove destination file before copying new content (WORM)Tigran Mkrtchyan2022-09-161-0/+2
| | | | Signed-off-by: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
* files: make OC\Files\Storage\Local WORM friendlyTigran Mkrtchyan2022-08-251-0/+6
| | | | | | | | | | | | | | | Some filesystems run as a Write-Once-Read-Many storages. This makes them impossible to use with NexeCloud, as the file system layers uses `truncate` syscall (through file_put_contents function). As Nextcloud is never updates existing files, removing the old entry and creatint a new one on update will allow NextCoud to update on such file systems. Update Local#fopen and Local#file_put_contents to remote existing file before truncating. Signed-off-by: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
* Expose umask override value as config parameter: localstorage.umaskMartin Brugnara2022-06-051-5/+9
| | | | | | | | | | | | | | | | | Commit 451c06d introduced override for umask value. This is needed to avoid broken env configuration or dirty workers to mess with the permissions when creating new files. Most Nextcloud, that does not integrate with external software would work fine with an hard-coded value (451c06d set it at 022). Advanced install may require more flexibility, as such this commit exposes the "umask override value" as configuration parameter: `localstorage.umask` It defaults to 0022 both in code and in config/config.sample.php . Signed-off-by: Martin Brugnara <martin@0x6d62.eu>
* Remove ILogger usages in lib/private/Files/StorageCôme Chilliet2022-04-261-5/+5
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* ignore forbidden files while scanning local storageRobin Appelman2022-04-201-1/+5
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* some file scanner performance improvementsRobin Appelman2022-03-171-4/+14
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* Check for `disk_free_space`acsfer2021-11-181-1/+1
| | | | Check for `disk_free_space` before calling it. Fix https://github.com/nextcloud/server/issues/29748
* 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 #28768 from nextcloud/check-file-existsJohn Molakvoæ2021-10-181-1/+1
|\
| * Simplify :)acsfer2021-10-041-1/+1
| |
| * Replace `file_exists()` method by `is_file()`acsfer2021-10-041-1/+1
| |
| * Get `filesize()` if `file_exists()`acsfer2021-10-011-1/+1
| | | | | | Should make sense.
* | explicitly close source stream on local storageDaniel Kesselberg2021-09-211-1/+4
|/ | | | Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
* Fix scanner mistaking socket files for directoriesRid2021-06-171-2/+2
| | | | Signed-off-by: Rid <rid@cylo.io>