Commit Graph

592 Commits

Author SHA1 Message Date
Vincent Petry 13c01e62cf
Mark $usersSetup only if user was found in initMountPoints
initMountPoints is marking a user as successfully initialized too
early. If the user was not found an NoUserException was thrown, the
second time initMountPoints is called would not rethrow the exception
and happily continue.

This fix makes sure that we consistently throw NoUserException when
initMountPoints is called repeatedly with invalid users.
2016-04-22 14:29:41 +02:00
Vincent Petry 085bcd7da2
Throw NoUserException when attempting to init mount point for null user
In some scenarios initMountPoints is called with an empty user, and
also there is no user in the session.

In such cases, it is unsafe to let the code move on with an empty user.
2016-04-22 11:46:33 +02:00
Thomas Müller cdcabbd0b3 Merge pull request #24098 from owncloud/fix_23782
When calling file_put_contents clear the checksum
2016-04-20 20:37:01 +02:00
Roeland Jago Douma 0dbcbc4cae
When the scanner detects a file is changed clear checksum
Fixes #23782 and #23783

If the file scanner detects a changed file we clear the checksum while
we update the cache.

* Unit test added
2016-04-19 20:20:45 +02:00
Thomas Müller 50e20e531e
Introduce isReadyForUser and verify in file transfer ownership - fixes #23786 2016-04-15 15:07:40 +02:00
Stefan Weil 02e226a6b3 tests: Fix typos (found by codespell)
Fix also a small grammar issue.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2016-04-06 15:08:27 +02:00
Frank Karlitschek 2bff34be56 Merge pull request #23707 from owncloud/make-sure-that-encrypted-version-is-set
Make sure that the encrypted version is set
2016-03-31 20:37:17 +02:00
Bjoern Schiessle 93ed965cbb fix creation of versions of encrypted files on external storages
in order to create a 1:1 copy of a file if a version gets created
we need to store this information on copyBetweenStorage(). This
allows us to by-pass the encryption wrapper if we read the source file.
2016-03-31 19:24:47 +02:00
Lukas Reschke c427bf3b5d Make sure that the encrypted version is set
The code path called when using external storage with WebDAV is using `\OC\Files\Storage\Wrapper\Encryption::getMetaData` which did not contain the actual encrypted version inside the cache entry version. This lead to the following:

1. User uploaded a file
2. File is created and `\OC\Files\Storage\Wrapper\Encryption::getMetaData` is called. It has an empty `encryptedVersion` but sets `encrypted` to either `true` or `false`.
3. The call when updating the file cache will use the old version.
2016-03-31 18:06:37 +02:00
Robin Appelman 0b0b3253bb properly use fileinfo objects 2016-03-21 14:20:33 +01:00
Robin Appelman 5e6c905a14 pass the fileinfo to the node if available 2016-03-21 13:53:33 +01:00
Lukas Reschke 676041ba7e Ensure that stored version is at least 1 for cross-storage copy
In case of a move operation from an unencrypted to an encrypted
storage the old encrypted version would stay with "0" while the
correct value would be "1". Thus we manually set the value to "1"
for those cases.

See also https://github.com/owncloud/core/issues/23078
2016-03-16 10:36:15 +01:00
Lukas Reschke 72c8187cbb Keep "encryptedVersion" when calling `\OC\Files\View::copy`
When calling `\OC\Files\View::copy` we should also keep the version to ensure that the file will always have the correct version attached and can be successfully decrypted.

To test this the following steps are necessary (from https://github.com/owncloud/core/issues/22781#issuecomment-191328982):

1. setup a new ownCloud 9.0 beta2
2. enable encryption
2. upload a docx (5.7MB large)
3. upload the same file again and overwrite the existing file
4. I can download the original file and the first version
5. I restore the first version
6. restored version can no longer be downloaded with the error described above

The manual cache operation in `\OCA\Files_Versions\Storage` is unfortunately necessary since `\OCA\Files_Versions\Storage::copyFileContents` is not using `\OCP\Files\Storage::moveFromStorage` in the case when an object storage is used. Due to the workaround added in 54cea05271 the stream is directly copied and thus bypassing the FS.
2016-03-03 14:15:36 +01:00
Bjoern Schiessle 834b51b83b recalculate unencrypted size if we assume that the size stored in the db is not correct 2016-02-23 15:09:46 +01:00
Robin Appelman c3e4ced64a fix getNodeForPath for non existing part files 2016-02-11 17:22:40 +01:00
Björn Schießle 9bb97c714b fixing unit tests 2016-02-09 23:43:26 +01:00
Robin Appelman fb76d7de69 remove unused Storage->getLocalFolder 2016-02-05 16:48:08 +01:00
Thomas Müller 67bf225fbe Merge pull request #21956 from owncloud/cross-cache-move
Add fallback moveFromCache implementation
2016-01-29 17:03:16 +01:00
Robin Appelman ec3f6549f6 Add fallback moveFromCache implementation 2016-01-29 13:06:59 +01:00
Joas Schilling 2563c3ffaf Fix failing oracle and postgres tests 2016-01-27 12:53:44 +01:00
Robin Appelman 644a8ab797 add IUserMountCache->getMountsForFileId 2016-01-27 12:53:44 +01:00
Robin Appelman 99415a9f7f multiple minor fies 2016-01-20 16:32:52 +01:00
Robin Appelman 222e719c87 sort in tests 2016-01-20 16:30:22 +01:00
Robin Appelman 8940429976 log duplicates 2016-01-20 16:30:22 +01:00
Robin Appelman cf6ee1c866 cache mountpoints in the db 2016-01-20 16:30:22 +01:00
Robin Appelman d2c579e167 fix quota wrapper 2016-01-14 12:54:42 +01:00
Robin Appelman 62d383e1ba fix tests 2016-01-14 12:54:42 +01:00
Thomas Müller 24271cf953 Merge pull request #21216 from owncloud/fopen-statcache
Clear SMB statcache after fopen
2015-12-28 10:21:26 +01:00
Morris Jobke a18c0983d5 Use TempManager instead of tmpFile 2015-12-18 11:25:33 +01:00
Morris Jobke 90b0831cec Use TempManager instead of tmpFolder 2015-12-18 11:19:53 +01:00
Roeland Jago Douma 1f715289bf Removed deprecated function OC_User::deleteUser
Replaced with proper OCP calls
2015-12-17 16:18:40 +01:00
Roeland Jago Douma 835911bce5 Removed deprecated private OC_User::createUser
All function calls are replaced with the recommended (which was already
the body of the function).
2015-12-17 16:18:40 +01:00
Robin Appelman 38a2467a4f test for statcache after fopen 2015-12-15 13:48:17 +01:00
Vincent Petry 28e9bc1156 Fix more unit tests to pass a mock storage instead of null to FileInfo 2015-12-08 16:33:39 +01:00
Thomas Müller 0c3d97921f Merge pull request #20904 from owncloud/view-mime-filter
Fix mimetype filter in getDirectoryContent
2015-12-07 10:20:43 +01:00
Morris Jobke cbe6eeffa1 last change of OC_Config to the proper interface in tests/ 2015-12-03 14:03:05 +01:00
Morris Jobke 542ce7dd0d Reduce OC_Config usage in tests/ 2015-12-03 13:48:19 +01:00
Robin Appelman 19b2fe6a3a Fix mimetype filter in getDirectoryContent 2015-12-03 13:09:13 +01:00
Morris Jobke e9c8f82fc5 Replace OC_Config in tests with IConfig calls 2015-12-03 09:38:41 +01:00
Robin Appelman 0062888aaf Also add metadata for postDelete hooks triggered from the view 2015-12-02 13:51:26 +01:00
Thomas Müller 8d218bf3ef Merge pull request #20875 from owncloud/remove-changepropagator
remove old propagation logic
2015-12-02 13:03:31 +01:00
Robin Appelman 62cc316c6a remove old propagation logic 2015-12-01 16:50:20 +01:00
Robin Appelman 0d63e95a5d Add metadata to post delete hooks 2015-12-01 13:22:58 +01:00
Thomas Müller 318e5e2864 More group DB 2015-11-30 10:55:13 +01:00
Thomas Müller 757aa45db7 Adding more DB groups to test suits
Adding more DB groups to test suits
2015-11-30 10:55:06 +01:00
Thomas Müller 56170dd825 Further unit test suite tweats 2015-11-30 10:55:05 +01:00
Thomas Müller 3bb6dcea64 Apply DB group annotation ... 2015-11-30 10:55:05 +01:00
Robin Appelman ae71f80f4a Skip unavailable storages in scanner 2015-11-27 14:02:50 +01:00
Robin Appelman b025f07fb7 Make Cache\Updater per storage 2015-11-25 14:16:00 +01:00
Robin Appelman a95d4c2b22 update tests 2015-11-19 13:32:04 +01:00