summaryrefslogtreecommitdiffstats
path: root/lib/private/tempmanager.php
Commit message (Collapse)AuthorAgeFilesLines
* lib: Fix typos (found by codespell)Stefan Weil2016-04-071-2/+2
| | | | Signed-off-by: Stefan Weil <sw@weilnetz.de>
* Update author informationLukas Reschke2016-03-011-0/+1
| | | | Probably nice for the people that contributed to 9.0 to see themselves in the AUTHORS file :)
* Merge pull request #21543 from owncloud/Larzenegger-masterThomas Müller2016-01-151-5/+6
|\ | | | | [CI] Larzenegger master
| * tempnam accepts a directory as its first parameter, not a full path and ↵Lars2016-01-111-5/+6
| | | | | | | | | | | | filename. tempnam falls back to creating a file in the system's temp directory. On systems with open_basedir restrictions, this may trigger an error message. By moving this below the checkTemporaryDirectory-loop, tempnam will only be tested if all alternatives fail and the error message is most likely avoided.
* | Happy new year!Thomas Müller2016-01-121-2/+2
|/
* Use proper class nameLukas Reschke2016-01-091-1/+1
| | | | This has never worked before. Introduced with https://github.com/owncloud/core/pull/18658
* Replace new occurences of ini_get with IniWrapper methodsMorris Jobke2015-11-231-1/+1
|
* deduplicate @xenopathicMorris Jobke2015-10-061-1/+1
|
* update licence headers via scriptMorris Jobke2015-10-051-0/+2
|
* Clean up TempManager to follow code guidelinesRobin McCorkell2015-08-301-39/+65
| | | | tmpBaseDir can be overridden for unit testing purposes
* moved code to /lib/private/tempmanager.phproot2015-08-291-3/+57
| | | | | | fix for unit test some fixes
* update license headers and authorsMorris Jobke2015-06-251-1/+2
|
* Fix collision on temporary files + adjust permissionsLukas Reschke2015-04-231-38/+61
| | | | | | | | | | | | | | | | | | | | | | | | | This changeset hardens the temporary file and directory creation to address multiple problems that may lead to exposure of files to other users, data loss or other unexpected behaviour that is impossible to debug. **[CWE-668: Exposure of Resource to Wrong Sphere](https://cwe.mitre.org/data/definitions/668.html)** The temporary file and folder handling as implemented in ownCloud is performed using a MD5 hash over `time()` concatenated with `rand()`. This is insufficiently and leads to the following security problems: The generated filename could already be used by another user. It is not verified whether the file is already used and thus temporary files might be used for another user as well resulting in all possible stuff such as "user has file of other user". Effectively this leaves us with: 1. A timestamp based on seconds (no entropy at all) 2. `rand()` which returns usually a number between 0 and 2,147,483,647 Considering the birthday paradox and that we use this method quite often (especially when handling external storage) this is quite error prone and needs to get addressed. This behaviour has been fixed by using `tempnam` instead for single temporary files. For creating temporary directories an additional postfix will be appended, the solution is for directories still not absolutely bulletproof but the best I can think about at the moment. Improvement suggestions are welcome. **[CWE-378: Creation of Temporary File With Insecure Permissions](https://cwe.mitre.org/data/definitions/378.html)** Files were created using `touch()` which defaults to a permission of 0644. Thus other users on the machine may read potentially sensitive information as `/tmp/` is world-readable. However, ownCloud always encourages users to use a dedicated machine to run the ownCloud instance and thus this is no a high severe issue. Permissions have been adjusted to 0600. **[CWE-379: Creation of Temporary File in Directory with Incorrect Permissions](https://cwe.mitre.org/data/definitions/379.html)** Files were created using `mkdir()` which defaults to a permission of 0777. Thus other users on the machine may read potentially sensitive information as `/tmp/` is world-readable. However, ownCloud always encourages users to use a dedicated machine to run the ownCloud instance and thus this is no a high severe issue. Permissions have been adjusted to 0700.Please enter the commit message for your changes.
* Filter potential dangerous characters in path nameLukas Reschke2015-03-261-0/+5
| | | | We should not allow / or \ in the postfix here.
* Merge pull request #13654 from oparoz/tmpfile-with-extensionVincent Petry2015-03-261-0/+3
|\ | | | | Keep the extension in temp files
| * Make the method compatible with all types of extensionsOlivier Paroz2015-03-191-1/+4
| | | | | | | | Fix existing tests
| * Keep the extension in temp filesOlivier Paroz2015-03-191-1/+1
| | | | | | | | | | The file extension helps some applications like ImageMagick to properly process files
* | Update license headersJenkins for ownCloud2015-03-261-5/+18
|/
* Revert "Updating license headers"Morris Jobke2015-02-261-17/+6
| | | | This reverts commit 6a1a4880f0d556fb090f19a5019fec31916f5c36.
* Updating license headersJenkins for ownCloud2015-02-231-6/+17
|
* Check directory handle before we use itRobin Appelman2015-02-091-6/+8
|
* Add \OC\TempManager to handle creating and cleaning temporary filesRobin Appelman2014-10-241-0/+146