Commit Graph

159 Commits

Author SHA1 Message Date
Stefan Weil b1a856d7b7 lib: Fix typos (found by codespell)
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2016-04-07 19:51:27 +02:00
Bjoern Schiessle e4b451491b make sure that we always remove the file again from the cache after the version was created 2016-03-31 21:52:23 +02:00
Frank Karlitschek f5709b511b Merge pull request #23445 from owncloud/enc_small_improvement
small performance improvement: no need to calculate the header size
2016-03-31 20:38:42 +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
Bjoern Schiessle 7b9d53b7ea no need to calculate the header size, if the first block contain a header we already know the size 2016-03-21 15:47:24 +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
Thomas Müller b56dbd0607 Merge pull request #22816 from owncloud/external-unavailable-recheck
allow availability recheck for external storages
2016-03-04 15:29:17 +01:00
Robin Appelman 6990100e6e allow availability recheck for external storages 2016-03-03 14:19:34 +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
Lukas Reschke 933f60e314 Update author information
Probably nice for the people that contributed to 9.0 to see themselves in the AUTHORS file :)
2016-03-01 17:25:15 +01:00
Thomas Müller efc966698f Merge pull request #22579 from owncloud/fix_broken_unencrypted_size
Heal unencrypted file sizes at download time (second approach)
2016-02-25 14:34:48 +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
Vincent Petry a9e0cfad8b Check delete permission before attemping copy+delete
Some move operations when cross-storage will be replaced by copy and
delete. Before attempting this, first check whether the source storage
has delete permissions.

This also prevents renaming system-wide external storages.
2016-02-19 12:59:10 +01:00
Vincent Petry 8f96ef147f Don't apply quota in stream wrapper for part files
When overwriting shared files as recipient, the part file is written on
the uploader's storage before overwriting the target file.

If the uploader has no quota left, they should still be able to
overwrite that file with Webdav. To make this work, they need to be able
to write the part file to their own storage first.
2016-02-17 11:52:49 +01:00
Bjoern Schiessle 9dc759b4dc remember signature version and only set it on update to make sure that other
apps like files_versions still get the old signature version
2016-02-10 13:27:32 +01:00
Vincent Petry 3736f13826 Check if partial cache entry or not in encryption wrapper 2016-02-09 23:43:27 +01:00
Lukas Reschke 5ccb9dfa7e Use database for keeping track of the version 2016-02-09 23:43:27 +01:00
Björn Schießle cf3a8f274f make it backward compatible to work with signed and un-signed files 2016-02-09 23:43:25 +01:00
Vincent Petry 19980be116 Fix part file partial cache logic in encryption code
The encryption code uses partial cache entries for the part file (which
are not stored in the database) but are useful for other parts of the
code to retrieve the file size again.

This means that in the fixed code $info was empty, so getData() could
not be called.

The fix makes sure to support both cases when the cache entry exists and
doesn't.
2016-02-09 09:47:34 +01:00
Robin Appelman fb76d7de69 remove unused Storage->getLocalFolder 2016-02-05 16:48:08 +01:00
Robin Appelman bdf51d9ea4 only trigger locking on lockingstorages 2016-01-14 13:01:43 +01:00
Robin Appelman d2c579e167 fix quota wrapper 2016-01-14 12:54:42 +01:00
Robin Appelman 6d321f5f6b Return a class from cache operations instead of an array 2016-01-14 12:54:42 +01:00
Thomas Müller 682821c71e Happy new year! 2016-01-12 15:02:18 +01:00
Vincent Petry 4b68dd372d Do not check storage availability for getOwner
Because the owner is always known thanks to the file cache and other
places, we don't need the remote storage to be actually available.
2015-12-09 17:31:14 +01:00
Robin Appelman b025f07fb7 Make Cache\Updater per storage 2015-11-25 14:16:00 +01:00
Robin Appelman 888df3933d take the etag of child mounts into account for the folder etag
this replaces shared etag propagation
2015-11-19 13:32:00 +01:00
Björn Schießle 6d0a324144 make sure that we update the unencrypted size for the versions 2015-11-04 10:59:05 +01:00
Robin Appelman 33eb13e415 The root of a storage always exists 2015-10-29 11:21:50 +01:00
Lukas Reschke 8f09d5b67c Update license headers 2015-10-26 14:04:01 +01:00
Bjoern Schiessle dd6cb67030 check if fopen was successful before continue 2015-10-15 16:27:38 +02:00
Bjoern Schiessle c7883b1769 only wrap source if fopen was successful 2015-10-15 16:27:38 +02:00
Thomas Müller 0385a62363 Merge pull request #19597 from owncloud/update-license-headers
update licence headers via script
2015-10-06 11:18:35 +02:00
Morris Jobke 8366ce2767 deduplicate @xenopathic 2015-10-06 09:52:19 +02:00
Morris Jobke b945d71384 update licence headers via script 2015-10-05 21:15:52 +02:00
Robin Appelman b1ce53f890 use a normal rename when moving from the same storage in the encryption wrapper 2015-10-05 20:55:57 +02:00
Bjoern Schiessle e7232a848b versions should always use the keys of the original file, no need to create new one 2015-10-01 10:10:19 +02:00
Jörn Friedrich Dreyer 8b90a55831 use correct variable
wow ... just wow ...
2015-09-23 23:41:39 +02:00
Jörn Friedrich Dreyer d54d9a573f Revert "use correct variable"
This reverts commit 52cbaff061.
2015-09-23 14:09:52 +02:00
Jörn Friedrich Dreyer 52cbaff061 use correct variable
wow ... just wow ...
2015-09-23 13:59:37 +02:00
Björn Schießle 6e210d960c Merge pull request #18423 from owncloud/occ_encrypt_all
occ command line tool to encrypt all files
2015-08-28 20:44:55 +02:00
Bjoern Schiessle e51fe617d8 copy always file by file to encrypt/decrypt it if needed 2015-08-26 14:58:22 +02:00
Robin McCorkell 3bb793b6a7 Implement password authentication mechanisms
Introduces the basic password authentication mechanism, along with a
mechanism based on ownCloud credentials stored in the user session.

Change to lib/private is an extension of PermissionsMask, as
isSharable() override was missing.

Session credentials auth mechanism now disables sharing on applied
storages, as credentials will not be available.
2015-08-19 14:20:09 +01:00
Vincent Petry b3a1aef934 Merge pull request #13641 from owncloud/cache-storage-status
Store storage availability in database
2015-08-07 17:31:03 +02:00
Bjoern Schiessle 51a67a54e0 always update file cache, the cache can handle partial data correctly if the file doesn't already exists in the file cache 2015-07-31 17:14:32 +02:00
Vincent Petry 6ada1e3276 Merge pull request #17902 from owncloud/fix_17898
get header size before we open the file to avoid locking exception
2015-07-27 16:58:32 +02:00
Bjoern Schiessle 0736b45d92 get header size before we open the file to avoid locking exception 2015-07-27 14:29:07 +02:00
Joas Schilling 9cee8ff9f8 Only set is encrypted when encryption is enabled 2015-07-23 15:18:59 +02:00