Commit Graph

688 Commits

Author SHA1 Message Date
Robin Appelman b302592a64 Small cleanup of rename code 2015-04-13 15:11:03 +02:00
Vincent Petry 2822d0579e Properly add trailing slash to mount point
Fixes resolving mount points when shared mount point's target name has
the same prefix as the source name
2015-04-13 12:36:47 +02:00
Thomas Müller 8450b6aa2d Properly import used classes 2015-04-13 09:26:30 +02:00
Jens-Christian Fischer 9c95315a9e clarify the duplication of the $params array 2015-04-12 14:49:18 +02:00
Jens-Christian Fischer 22c6216f5c don't update identical values
The UPDATE oc_filecache statement blindly overwrites identical data.
Databases like Postgres that create a new row on an update
and mark the old one as dead will suffer from the previous
behaviour, as millions of "new" rows are created in the database.

This patch changes the WHERE clause to test for identical
values and not updating if the values in the DB are identical
to the ones being passed.
2015-04-11 18:06:21 +02:00
Thomas Müller 7b2d53603c Merge pull request #15489 from owncloud/dont_hide_exceptions_master
Dont hide exceptions master
2015-04-10 15:49:45 +02:00
Vincent Petry 73afca6207 Catch more exceptions when connecting to remote DAV server
Added InvalidArgumentException to catch HTML parsing errors when XML was
expected.
Made convertSabreException more generic to be able to handle more
exception cases.
2015-04-10 12:02:06 +02:00
Jörn Friedrich Dreyer b069f33a72 throw exception when backends don't provide a user instead of creating legacy local storages 2015-04-10 09:12:37 +02:00
Jörn Friedrich Dreyer 8af52e3876 fixes #15326 2015-04-09 15:37:00 +02:00
Morris Jobke 4e60b81264 Merge pull request #14120 from owncloud/dav-statcache
Stat cache for DAV storage, improves s2s performance a little bit
2015-04-08 21:09:28 +02:00
Bjoern Schiessle c379557e1d don't throw exception if a file gets uploaded and encryption is disabled 2015-04-08 16:41:20 +02:00
Morris Jobke 59322a5037 Merge pull request #15333 from owncloud/copy-cross-device
fix copying folder across devices
2015-04-08 12:35:15 +02:00
Thomas Müller a4483243ac fixing license headers - encryption code related 2015-04-07 17:02:49 +02:00
Thomas Müller 4a70ca665c respect mount option while encrypting 2015-04-07 13:30:31 +02:00
Thomas Müller 111fbabfb4 PHPDoc cleanup - clean code \o/ 2015-04-07 13:30:31 +02:00
Thomas Müller 69e95531f8 comment change as it broke unit tests 2015-04-07 13:30:31 +02:00
Thomas Müller ba9a797eaa Encryption storage wrapper is enabled by default - necessary to detect encrypted files even if encryption was disabled after files have been encrypted - prevents data corruption 2015-04-07 13:30:31 +02:00
Bjoern Schiessle fe74a0cb4f implement webdav copy 2015-04-07 13:30:31 +02:00
Thomas Müller 8991272269 Using stream_get_contents in file_get_contents implementation + close handle 2015-04-07 13:30:31 +02:00
jknockaert ff16e3dbff Adjusting count on read 2015-04-07 13:30:31 +02:00
jknockaert 02404a6a8c Fixing encryption stream wrapper seek - thanks @jknockaert 2015-04-07 13:30:30 +02:00
Thomas Müller 104d11ec4c Fixing encryption storage wrapper tests 2015-04-07 13:30:30 +02:00
Thomas Müller d9c41b00ab Introducing trait LocalTempFileTrait 2015-04-07 13:30:30 +02:00
Thomas Müller 8ffa6db110 fixing unit tests for stream wrapper 2015-04-07 13:30:30 +02:00
Thomas Müller 9d8c07850d fixing unencrypted file size 2015-04-07 13:30:30 +02:00
Thomas Müller c9d6ed3d7d in case the file exists we require the explicit module as specified in the file header - otherwise we need to fail hard to prevent data loss on client side 2015-04-07 13:30:30 +02:00
Thomas Müller cac83642f2 Finally fixing encryption with public share 2015-04-07 13:30:30 +02:00
Thomas Müller 137c135664 file_put_contents has to return the number of written bytes 2015-04-07 13:30:30 +02:00
Bjoern Schiessle 83cb382b3f pass file helper to encryption wrapper 2015-04-07 13:30:29 +02:00
Bjoern Schiessle e4895bda01 add helper class accessible for encryption modules to ask for a list of users with access to a file, needed to apply the recovery key to all files 2015-04-07 13:30:29 +02:00
Thomas Müller 1b42b492dc kill OC_FileProxy 💥 2015-04-07 13:30:28 +02:00
Thomas Müller 99255ff3a9 Fix - public sharing: in case on user is available - get it from the path 2015-04-07 13:30:28 +02:00
Bjoern Schiessle 0eee3a2618 remove unencrypted_size from the cache, size will contain the unencrypted size 2015-04-07 13:30:28 +02:00
Thomas Müller d185761d31 initializing some variables + update size after writing the headers 2015-04-07 13:30:28 +02:00
Thomas Müller 4441835d18 https://github.com/owncloud/core/pull/15305#discussion_r27382305
Conflicts:
	lib/private/files/stream/encryption.php
2015-04-07 13:30:28 +02:00
Thomas Müller 90487384f7 initializing some variables 2015-04-07 13:30:28 +02:00
Bjoern Schiessle 0c48b069ba call end() before closing the file 2015-04-07 13:30:28 +02:00
Thomas Müller 498625ea3a adding unit tests for stream wrapper 2015-04-07 13:30:28 +02:00
Thomas Müller a905f641b3 various fixes & start to unit test the encryption storage wrapper 2015-04-07 13:30:28 +02:00
jknockaert 3e6eb28ee3 Applying diff as of https://github.com/owncloud/core/pull/15303 2015-04-07 13:30:28 +02:00
Bjoern Schiessle cb9980823d core: small fixes 2015-04-07 13:30:27 +02:00
Bjoern Schiessle 810ca9105c implement rename and delete of encryption keys 2015-04-07 13:30:27 +02:00
Joas Schilling a8d1ede347 Fix the exception messages 2015-04-02 18:40:06 +02:00
Robin Appelman f585994c4b setup mount manager before wrappers 2015-04-02 13:28:36 +02:00
Robin Appelman 068c624b0d fix copying folder across devices 2015-03-31 13:50:11 +02:00
Thomas Müller 722e50a112 Merge pull request #15240 from owncloud/storage-wrapper-priority
add priority to storage wrappers
2015-03-27 15:18:44 +01:00
Bjoern Schiessle c6be1ba8d3 fix check if a file is excluded from encryption or not 2015-03-27 11:51:50 +01:00
Vincent Petry 670ca68453 Added stat cache for DAV storage
The stat cache stored known states of files/folders to avoid requerying
the DAV server multiple times.
2015-03-26 23:15:53 +01:00
Robin McCorkell c2909355bf Merge pull request #14925 from owncloud/ext-mountoptions-ui
Mount options GUI for external storage
2015-03-26 21:36:34 +00:00
Robin Appelman cb9ead7dde add priority to storage wrappers 2015-03-26 21:26:38 +01:00
Thomas Müller 232518ac54 Merge pull request #15234 from owncloud/encryption2_core
core part of encryption 2.0
2015-03-26 21:14:59 +01:00
Bjoern Schiessle ff9c85ce60 implement basic encryption functionallity in core to enable multiple encryption modules 2015-03-26 20:56:51 +01:00
Vincent Petry 58b4c2c0e5 Make sure mountOptions keep their data type
str_replace for $user substitution was converting the data type of
mountOptions to string. This fix prevents this to happen by making sure
only strings are processed by substitution.

Also added a int conversion when reading the watcher policy
2015-03-26 19:24:37 +01:00
Jenkins for ownCloud b585d87d9d Update license headers 2015-03-26 11:44:36 +01:00
Morris Jobke 24d0dfc727 Revert "FIX for webdav.mediencenter.t-online.de" 2015-03-26 00:56:06 +01:00
Oliver Kohl D.Sc. 9323285987 FIX for webdav.mediencenter.t-online.de
https://webdav.mediencenter.t-online.de returns invalid response code.

e.g.
{"reqId":"f9a1c394b98108e4e5ca62bf47829c64","remoteAddr":"81.189.45.224","app":"PHP","message":"Undefined offset: 2 at \/var\/www\/owncloud\/3rdparty\/sabre\/dav\/lib\/Sabre\/DAV\/Client.php#569","level":3,"time":"2015-03-25T18:25:48+00:00","method":"GET","url":"\/index.php\/apps\/files\/ajax\/getstoragestats.php?dir=External%2FT-Cloud%2FTests"}

e.g.
{"reqId":"3407d66672b3cef206b0af883e49bff4","remoteAddr":"46.74.125.245","app":"PHP","message":"Undefined index: {DAV:}getlastmodified at \/var\/www\/owncloud\/lib\/private\/files\/storage\/dav.php#563","level":3,"time":"2015-03-25T16:33:21+00:00"}
2015-03-25 21:29:29 +01:00
Robin Appelman d11f01fa0f Add `getNonExistingName()` to the node api 2015-03-24 15:00:36 +01:00
Vincent Petry 67160e0861 Do not automatically add "update" permission to shared mounts
In the past it seems the update permission was needed to be able to
rename shared mounts, but it doesn't seem to be the case any more.

Removing the "update" permission that used to be added automatically
fixes the read-only permission check when trying to overwrite a
read-only file over WebDAV.
2015-03-20 12:33:59 +01:00
Robin Appelman 73874ca27f Merge pull request #14704 from owncloud/storage-wrapper-mount
pass mountpoint to storage wrapper callback
2015-03-19 16:20:38 +01:00
Lukas Reschke bb5c5a3691 Remove unreqired backtick removal
Without this files with a ` (backtick) in the beginning of the filenames where simply not correctly referenced as the ` got removed. This can lead to all possible havoc situations.

Should get backported to stable8 and in future we might consider if it is really worth to backport such changes when it is just for SQLite 🙈

Regression of https://github.com/owncloud/core/pull/14734
2015-03-18 12:38:19 +01:00
Lukas Reschke f13216d275 Use `FILTER_UNSAFE_RAW` instead of `FILTER_SANITIZE_STRING`
`FILTER_SANITIZE_STRING` will still encode everything else.
2015-03-17 21:56:16 +01:00
Morris Jobke 997a7a2668 Merge pull request #14766 from owncloud/fix-insertifnotexists-poc
Allow specifying the compare-array for insertIfNotExists()
2015-03-16 10:31:36 +01:00
Thomas Müller 6927773648 Merge pull request #14776 from owncloud/fix-14629-master
verify the file name length not to exceed 255 characters + verify path d...
2015-03-16 09:58:41 +01:00
Thomas Müller 5855108e9b drop any fallback code related to curl - refs https://github.com/owncloud/core/pull/14838#issuecomment-78586447 2015-03-12 21:43:41 +01:00
Thomas Müller 80ef53eff0 verify the file name length not to exceed 255 characters + verify path during rename 2015-03-12 10:47:47 +01:00
Morris Jobke 82254ad5ef Merge pull request #13893 from owncloud/create-cachedir-on-user
Only make sure the cache directory exists when we use it
2015-03-11 16:49:24 +01:00
Robin Appelman 169031d1c5 fix factory test 2015-03-11 15:07:59 +01:00
Robin Appelman e1f2a6df94 Allow setting the watcher policy as mount option 2015-03-11 15:07:23 +01:00
Robin Appelman 7adda88786 Copy mount options to the storage 2015-03-11 15:06:48 +01:00
Robin Appelman 4f0f175f8b Allow getting all mount options as array 2015-03-11 15:06:12 +01:00
Robin Appelman e5c8fd37df pass mountpoint to storage wrapper callback 2015-03-11 15:06:12 +01:00
cmeh 4a0c649c8a Correct "one invalid characters" to "one invalid character"
Corrected "one invalid characters" to "one invalid character" in line 1575.
2015-03-11 09:59:42 +01:00
Joas Schilling 2af8fea2be Throw a RuntimeException in the cache aswell 2015-03-11 09:33:50 +01:00
Lukas Reschke 284bd6647c Merge pull request #14759 from owncloud/clean-up-code
Clean-up code and use proper exception types
2015-03-10 14:18:21 +01:00
Joas Schilling 2747a83a49 Get the id before using it 2015-03-09 22:37:49 +01:00
Joas Schilling 3115d66d60 Better save then sorry 2015-03-09 22:37:49 +01:00
Joas Schilling 940163e16b insertIfNotExists() for storage insertion 2015-03-09 22:37:49 +01:00
Joas Schilling c917ea183c Only check unique keys for the comparison on filecache insert & update otherwise 2015-03-09 22:37:49 +01:00
Lukas Reschke 2ac6f3a4f5 Clean-up code and use proper exception types 2015-03-09 11:48:55 +01:00
Thomas Müller 3623f14e73 no translation service in common storage class 2015-03-09 10:38:38 +01:00
Thomas Müller 33b11682f9 translate error messages 2015-03-09 10:38:38 +01:00
Lukas Reschke 2f18a09a20 Optimize loop 2015-03-09 10:38:38 +01:00
Thomas Müller 49e1a81eba fixing namespaces and PHPDoc 2015-03-09 10:38:37 +01:00
Thomas Müller 4bac595068 adding storage specific filename verification - refs #13640 2015-03-09 10:38:37 +01:00
Thomas Müller 1b08b7c726 use insertIfNotExist() in cache put 2015-03-06 15:32:58 +01:00
Joas Schilling 09ac2df1f8 Update scanFile() and scanChildren() to the new signature of the parent class 2015-03-04 09:22:53 +01:00
Robin Appelman f6182aa87e Allow disabling the cache updater 2015-02-27 17:14:16 +01:00
Morris Jobke b4dfd043d7 Merge pull request #14575 from owncloud/cache-rename-overwrite
Fix cache update when doing a rename that overwrites the target
2015-02-27 17:11:37 +01:00
Robin Appelman fc027bceb7 Fix cache update when doing a rename that overwrites the target 2015-02-27 16:39:58 +01:00
Joas Schilling 3a6a0501c4 Add "throws" lines to calling methods and interface aswell 2015-02-27 12:16:53 +01:00
Thomas Müller 7fe07e93fe Merge pull request #14437 from owncloud/node-check-fileinfo
Check if we have a proper fileinfo
2015-02-27 02:56:13 -08:00
Thomas Müller f72f9e0159 Merge pull request #14530 from owncloud/revert-14403
Revert "Updating license headers"
2015-02-27 00:39:29 -08:00
Vincent Petry 232de3bdc0 Delete target file for unsuccessful copy/rename 2015-02-26 15:11:37 +01:00
Morris Jobke 06aef4e8b1 Revert "Updating license headers"
This reverts commit 6a1a4880f0.
2015-02-26 11:37:37 +01:00
Robin Appelman f5befbeac6 Check if we have a proper fileinfo 2015-02-25 16:02:08 +01:00
Vincent Petry 9f6dcb9d3e Sabre Update to 2.1
- VObject fixes for Sabre\VObject 3.3
- Remove VObject property workarounds
- Added prefetching for tags in sabre tags plugin
- Moved oc_properties logic to separate PropertyStorage backend (WIP)
- Fixed Sabre connector namespaces
- Improved files plugin to handle props on-demand
- Moved allowed props from server class to files plugin
- Fixed tags caching for files that are known to have no tags
  (less queries)
- Added/fixed unit tests for Sabre FilesPlugin, TagsPlugin
- Replace OC\Connector\Sabre\Request with direct call to
  httpRequest->setUrl()
- Fix exception detection in DAV client when using Sabre\DAV\Client
- Added setETag() on Node instead of using the static FileSystem
- Also preload tags/props when depth is infinity
2015-02-23 22:27:23 +01:00
Jenkins for ownCloud 6a1a4880f0 Updating license headers 2015-02-23 12:13:59 +01:00
Thomas Müller 3a6b11d018 Merge pull request #13767 from owncloud/issue/13764-mimetype-racecondition
Use insertIfNotExists() and reload mimetypes after inserting one
2015-02-20 17:39:17 +01:00
Thomas Müller 84eb00e428 Merge pull request #14342 from owncloud/disallow-path-traversals-in-file-view
Disallow path traversals in file view
2015-02-19 10:27:04 +01:00
Thomas Müller b32d31a2f1 Merge pull request #13836 from owncloud/part-no-cache-update
Dont update the cache when working with part files
2015-02-19 00:08:10 +01:00