Commit Graph

95 Commits

Author SHA1 Message Date
Jörn Friedrich Dreyer 773941dfb0 prevent 0 byte downloads when storage returns false 2015-09-17 11:16:00 +02:00
Robin Appelman 688981b55c allow hook cancel 2015-09-14 20:35:33 +02:00
Robin Appelman 75f126da49 use the correct path for cache updates when doing chunked assembly 2015-09-14 20:35:33 +02:00
Robin Appelman 6386327150 work directly on storages when doing a chunked upload assembly 2015-09-14 20:35:33 +02:00
Robin Appelman e612d3123f wrap the entire put operation in a read lock 2015-09-14 20:35:33 +02:00
Robin Appelman 8c5302847b add test framework for doing full request webdav tests 2015-08-11 14:43:46 +02:00
Robin Appelman 2a90cbe603 go trough the updater when uploading over webdav 2015-08-03 13:42:36 +02:00
Thomas Müller d3ac73c0c9 Remove OC_Log 2015-07-03 18:00:16 +02:00
Vincent Petry cf245b80fe Only delete part file on error if it is really a part file 2015-07-01 12:52:06 +02:00
Vincent Petry fd4efdded9 Clean up part file only once, not twice on error 2015-07-01 09:47:05 +02:00
Vincent Petry 3217d4dad1 Cleanup part file after upload exception
Added unit tests for checking for stray part files.
Convert exception to sabre exception in upload put method.

Also added unit test for exception mapping, which also indirectly tests
that the part file is being deleted on exception.

This applies to both chunking and non-chunking mode.

Added some unit tests for chunk upload.
2015-06-29 17:31:14 +02:00
Morris Jobke f63915d0c8 update license headers and authors 2015-06-25 14:13:49 +02:00
Robin Appelman 7d72f7d8ce keep a read lock while scanning a file or folder 2015-06-15 14:32:29 +02:00
Vincent Petry 4497aa4c68 Webdav PUT small file lock must be shared during hooks
Fixed code path for Webdav PUT of small files to use shared locks during
hook execution, and exclusive during the file operation

This makes it possible for versions to be copied by accessing the file
in a post_write hook.
2015-06-12 18:52:18 +02:00
Vincent Petry ba174ac626 Convert LockedException to FileLocked in Sabre connector
For Sabre to be able to return the proper error code instead of 500, the
LockedException is now rethrown as FileLocked exception in the Sabre
connector
2015-06-01 13:22:57 +02:00
Robin Appelman 8665a98744 add locking for non-chunking webdav upload 2015-06-01 13:22:57 +02:00
Vincent Petry 3cae0135ad Fire prehooks when uploading directly to storage 2015-05-13 17:47:04 +02:00
Robin Appelman 06a65fab13 use cross storage move when renaming the part file during webdav put 2015-05-07 14:28:31 +02:00
Robin Appelman 2e897f05b1 triger propagation for webdav uploads
use post hooks for share etag propagator
2015-04-27 14:07:16 +02:00
Vincent Petry ffc796edcb Do not trash part files, delete directly 2015-04-21 18:28:15 +02:00
Robin Appelman eeecca04e6 Keep phpdoc updated. 2015-04-14 16:25:52 +02:00
Robin Appelman 308af8b909 pass a stream to the tests 2015-04-14 15:25:52 +02:00
Robin Appelman 2fd44dbde4 rewind and update error message 2015-04-13 14:14:48 +02:00
Robin Appelman dcfe014103 use our own stream copy instead 2015-04-13 14:13:21 +02:00
Robin Appelman cbcee34eb0 update tests 2015-04-09 14:46:25 +02:00
Robin Appelman 6a59502759 Work directly on the storage when uploading over webdav 2015-04-08 14:04:58 +02:00
Thomas Müller 161d80da5b In case of encryption exceptions we return 503 - this will allow the client to retry 2015-04-07 14:17:42 +02:00
Thomas Müller 664b2bb7af cleaning up exception mess 2015-04-07 13:30:30 +02:00
Thomas Müller bf809ac85a Removing left overs from old encryption app 2015-04-07 13:30:29 +02:00
Thomas Müller dbdd754c3f Further cleanup of files_encryption 2015-04-07 13:30:28 +02:00
Thomas Müller 00338f9dca Removing files_encryption left overs 2015-04-07 13:30:28 +02:00
Jenkins for ownCloud b585d87d9d Update license headers 2015-03-26 11:44:36 +01:00
Thomas Müller 4bac595068 adding storage specific filename verification - refs #13640 2015-03-09 10:38:37 +01:00
Morris Jobke 06aef4e8b1 Revert "Updating license headers"
This reverts commit 6a1a4880f0.
2015-02-26 11:37:37 +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
Lukas Reschke 886bda5f81 Refactor OC_Request into TrustedDomainHelper and IRequest
This changeset removes the static class `OC_Request` and moves the functions either into `IRequest` which is accessible via `\OC::$server::->getRequest()` or into a separated `TrustedDomainHelper` class for some helper methods which should not be publicly exposed.

This changes only internal methods and nothing on the public API. Some public functions in `util.php` have been deprecated though in favour of the new non-static functions.

Unfortunately some part of this code uses things like `__DIR__` and thus is not completely unit-testable. Where tests where possible they ahve been added though.

Fixes https://github.com/owncloud/core/issues/13976 which was requested in https://github.com/owncloud/core/pull/13973#issuecomment-73492969
2015-02-16 22:13:00 +01:00
Vincent Petry 8210200770 Revert "adding OC-ETag header"
This reverts commit 96a931929e.
2015-02-05 20:43:37 +01:00
Robin Appelman 05035ef4af Fix webdav put for single file webdav shares 2015-01-29 12:47:12 +01:00
Thomas Müller 5f171618fd remove unused variable and fix undefined variable 2015-01-08 09:46:40 +01:00
Vincent Petry 2e57fe93e4 Disable part files for OC ext storage backend + s2s backend
When uploading files to an OC ext storage backend or when using server
to server sharing storage, part files aren't needed because the backend
already has its own part files and takes care of the final atomic rename
operation.

This also fixes issues when using two encrypted ownCloud instances where
one mounts the other either as external storage (ownCloud backend) or
through server to server sharing.
2015-01-07 21:21:51 +01:00
Chris Wilson 402a3ed146 Improve debugging for ServiceUnavailable exceptions
I was getting a lot of these in my logs for no apparent reason, and file
uploads were failing:

	{"app":"webdav","message":"Sabre\\DAV\\Exception\\ServiceUnavailable: ","level":4,"time":"2015-01-06T15:33:39+00:00"}

In order to debug it, I had to add unique messages to all the places where
this exception was thrown, to identify which one it was, and that made the
logs much more useful:

	{"app":"webdav","message":"Sabre\\DAV\\Exception\\ServiceUnavailable: Encryption is disabled","level":4,"time":"2015-01-06T15:36:47+00:00"}
2015-01-06 15:59:38 +00:00
Thomas Müller 5b00bc1d6e Adding basement for the direct download url 2014-12-28 17:17:14 +01:00
Joas Schilling 78a307995c Fix namespace of Files_Encryption outside of the app 2014-12-09 09:47:26 +01:00
Vincent Petry 0b2c24081f Return real mime type on PROPFIND
Return the real (insecure) mime type on PROPFIND
2014-11-11 15:42:50 +01:00
Vincent Petry 9b99c1d6f0 Merge pull request #12072 from owncloud/sabre-convertstoragenotavailableexception-secondtry
Convert StorageNotAvailableException to SabreDAV exception
2014-11-10 12:52:52 +01:00
Vincent Petry cccedf6f30 Convert StorageNotAvailableException to SabreDAV exception
Convert \OCP\Files\StorageNotAvailableException to
\Sabre\DAV\Exception\ServiceUnavailable for every file/directory
operation happening inside of SabreDAV.

This is necessary to avoid having the exception bubble up to remote.php
which would return an exception page instead of an appropriate response.
2014-11-10 12:01:24 +01:00
Bjoern Schiessle a10ae2816e clean up encryption exceptions 2014-11-07 13:48:31 +01:00
Bjoern Schiessle c2a45c1238 throw exception if private key is missing 2014-11-05 13:05:46 +01:00
Vincent Petry 470c25eff4 WebDAV now throws 403 when deletion did not work
Assume a permission issue whenever a file could not be deleted.

This is because some storages are not able to return permissions, so a
permission denied situation can only be triggered during direct
deletion.
2014-09-22 13:15:17 +02:00