[Pkg-owncloud-commits] [owncloud] 337/457: Check if the part files has keys when the original file does not
David Prévot
taffit at moszumanska.debian.org
Sun Jun 28 20:06:36 UTC 2015
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch stable8
in repository owncloud.
commit e6681857d2bb79adc8bed3c9a512fec2d4069c59
Author: Joas Schilling <nickvergessen at owncloud.com>
Date: Mon Jun 8 15:36:54 2015 +0200
Check if the part files has keys when the original file does not
---
lib/private/encryption/keys/storage.php | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/lib/private/encryption/keys/storage.php b/lib/private/encryption/keys/storage.php
index fa31785..848d5c0 100644
--- a/lib/private/encryption/keys/storage.php
+++ b/lib/private/encryption/keys/storage.php
@@ -72,7 +72,17 @@ class Storage implements IStorage {
public function getFileKey($path, $keyId, $encryptionModuleId) {
$realFile = $this->util->stripPartialFileExtension($path);
$keyDir = $this->getFileKeyDir($encryptionModuleId, $realFile);
- return $this->getKey($keyDir . $keyId);
+ $key = $this->getKey($keyDir . $keyId);
+
+ if ($key === '' && $realFile !== $path) {
+ // Check if the part file has keys and use them, if no normal keys
+ // exist. This is required to fix copyBetweenStorage() when we
+ // rename a .part file over storage borders.
+ $keyDir = $this->getFileKeyDir($encryptionModuleId, $path);
+ $key = $this->getKey($keyDir . $keyId);
+ }
+
+ return $key;
}
/**
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git
More information about the Pkg-owncloud-commits
mailing list