aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Files/Storage/Local.php
Commit message (Collapse)AuthorAgeFilesLines
...
* 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>
* Update php licensesJohn Molakvoæ (skjnldsv)2021-06-041-1/+1
| | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* Merge pull request #25280 from nextcloud/explicit-file-permissionsRoeland Jago Douma2021-03-301-4/+16
|\ | | | | Set umask before operations that create local files
| * Set umask before operations that create local filesRobin Appelman2021-03-231-4/+16
| | | | | | | | | | | | this solves issues where "other php stuff" is messing with the umask Signed-off-by: Robin Appelman <robin@icewind.nl>
* | show better error messages when a file with a forbidden path is encounteredRobin Appelman2021-03-241-8/+4
|/ | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* explicitly set permissions on newly created foldersRobin Appelman2021-01-201-1/+4
| | | | | | this works around any `umask` that might be set and limiting the folder permissions Signed-off-by: Robin Appelman <robin@icewind.nl>
* Add 'allow Symlinks' as an option to config.phpJohannes Leuker2021-01-121-3/+2
| | | | Signed-off-by: Johannes Leuker <j.leuker@hosting.de>
* Merge pull request #24594 from kofemann/dcacheJulius Härtl2020-12-221-1/+1
|\
| * files: Local#writeStream should use it's own file_put_contentsTigran Mkrtchyan2020-12-071-1/+1
| | | | | | | | | | | | | | | | | | | | The OC\Files\Storage\Local#writeStream use system provided file_put_contents. However, it overrides file_put_contents, thus expects that the default behaviour can be different. Use Local#file_put_contents in writeStream to benefit from class specific functionality. Signed-off-by: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
* | Update all license headers for Nextcloud 21Christoph Wurst2020-12-161-1/+2
|/ | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Fix file size computation on 32bit platformsaler92020-12-021-5/+4
| | | | Signed-off-by: aler9 <46489434+aler9@users.noreply.github.com>
* Update the license headers for Nextcloud 20Christoph Wurst2020-08-241-0/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Merge pull request #21677 from J0WI/clearstatcache-on-rmdirMorris Jobke2020-08-051-2/+4
|\ | | | | Do clearstatcache() on rmdir
| * Only clear the realpath cacheJ0WI2020-07-031-2/+2
| | | | | | | | Signed-off-by: J0WI <J0WI@users.noreply.github.com>
| * clearstatcache() on rmdirJ0WI2020-07-031-0/+2
| | | | | | | | Signed-off-by: J0WI <J0WI@users.noreply.github.com>
* | use exceptions for error signaling in writeStreamRobin Appelman2020-07-231-1/+7
|/ | | | | | this remove the ambiguity when writing zero length files Signed-off-by: Robin Appelman <robin@icewind.nl>
* Clear the statscache before fetching the metadataRoeland Jago Douma2020-05-221-0/+1
| | | | | | | | Else if a lot of writes happen. It might happen that an old stat result is used. Resulting in a wrong file size for the file. For example the text app when a lot of people edit at the same time. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Update license headers for 19Christoph Wurst2020-04-291-1/+0
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Add method to storage backends to get directory content with metadataRobin Appelman2020-04-201-0/+1
| | | | | | | | | | | | | | | | | Currently you need to use `opendir` and then call `getMetadata` for every file, which adds overhead because most storage backends already get the metadata when doing the `opendir`. While storagebackends can (and do) use caching to relief this problem, this adds cache invalidation dificulties and only a limited number of items are generally cached (to prevent memory usage exploding when scanning large storages) With this new methods storage backends can use the child metadata they got from listing the folder to return metadata without having to keep seperate caches. Signed-off-by: Robin Appelman <robin@icewind.nl>
* Format control structures, classes, methods and functionChristoph Wurst2020-04-101-2/+2
| | | | | | | | | | | | | | | To continue this formatting madness, here's a tiny patch that adds unified formatting for control structures like if and loops as well as classes, their methods and anonymous functions. This basically forces the constructs to start on the same line. This is not exactly what PSR2 wants, but I think we can have a few exceptions with "our" style. The starting of braces on the same line is pracrically standard for our code. This also removes and empty lines from method/function bodies at the beginning and end. Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Use elseif instead of else ifChristoph Wurst2020-04-101-4/+4
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* optimize getMetaData for local storageRobin Appelman2020-04-011-6/+57
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* Update the license headers for Nextcloud 19Christoph Wurst2020-03-311-0/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Use the short array syntax, everywhereChristoph Wurst2020-03-261-2/+2
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Update license headersChristoph Wurst2019-12-051-1/+2
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Improve etag handlingRoeland Jago Douma2019-11-271-6/+20
| | | | | | Check if values exist before using them Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Supress warnings touch can generateRoeland Jago Douma2019-07-261-2/+2
| | | | | | | We already catch the result value. Having the warning being logged explicitly doesn't help and polutes the log. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* verify that paths are valid for recursive local moveRobin Appelman2019-06-271-0/+21
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* extend storage api to allow directly writing a stream to storageRobin Appelman2018-10-311-0/+4
| | | | | | | | | | | this removes the need for temporary storages with some external storage backends. The new method is added to a separate interface to maintain compatibility with storage backends implementing the storage interface directly (without inheriting common) Currently the interface is implemented for objectstorage based storages and local storage and used by webdav uploads Signed-off-by: Robin Appelman <robin@icewind.nl>
* move log constants to ILoggerArthur Schiwon2018-04-261-4/+5
| | | | Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* Use fallback path if data dir is not available for Storage/Local.phpMorris Jobke2018-01-181-5/+10
| | | | | | | Found while testing strict types for PHP7+. Signed-off-by: Morris Jobke <hey@morrisjobke.de> Signed-off-by: Robin Appelman <robin@icewind.nl>
* Fix call to clearstatcache to actually use the file pathMorris Jobke2018-01-121-1/+1
| | | | | | | | * found while adding the strict_typing for PHP 7+ migration * first argument is a boolean - second one is the path * see http://php.net/manual/en/function.clearstatcache.php Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Update license headersMorris Jobke2017-11-061-0/+4
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Use ::class and fix missing docJoas Schilling2017-10-281-1/+2
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Fix copy from jailed storageRoeland Jago Douma2017-08-091-0/+6
| | | | | | | If we have a jailed storage we must also fix the internal path on copy. Else we pass in the wrong path. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Replace wrong PHPDocsLukas Reschke2017-08-011-4/+5
| | | | Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
* Fixed a crash caused by Local::copyFromStorage() not conforming to ↵Michael Munger2017-05-231-1/+1
| | | | Common::copyFromStorage. Issue# 5071
* use unjailed path when moving files out of a shared storageRobin Appelman2017-04-121-2/+9
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* Remove verbose error messageLukas Reschke2017-03-291-2/+3
| | | | | | There's no need to have this included in the error message. Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
* remove obsolete hack (#26928)Jörn Friedrich Dreyer2017-01-271-12/+1
| | | | | | | | | * remove obsolete hack > // file_get_contents() has a memory leak: https://bugs.php.net/bug.php?id=61961 was closed 4 years ago. we could also use the Common implementation Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Merge pull request #1890 from nextcloud/downstream-25428Morris Jobke2016-10-251-2/+10
|\ | | | | fixing php 32 bit (arm) filemtime on large file issue (#18971) (#25428)
| * Move function to LargeFileHelperLukas Reschke2016-10-251-1/+2
| | | | | | | | Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
| * fixing php 32 bit (arm) filemtime on large file issue (#18971) (#25428)Boris Rybalkin2016-10-251-2/+9
| | | | | | | | | | | | * fixing php 32 bit (arm) filemtime on large file issue (#18971) * cast to int
* | Remove not existent function callLukas Reschke2016-10-251-1/+1
|/ | | | | | | - Removes a not existent function call - Removes a fallback for Windows Signed-off-by: Lukas Reschke <lukas@statuscode.ch>