From 0736b45d9238d553a53698c75139bd666861ae59 Mon Sep 17 00:00:00 2001 From: Bjoern Schiessle Date: Mon, 27 Jul 2015 14:29:07 +0200 Subject: [PATCH] get header size before we open the file to avoid locking exception --- lib/private/files/storage/wrapper/encryption.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/private/files/storage/wrapper/encryption.php b/lib/private/files/storage/wrapper/encryption.php index 61290791fa..155a4fde4e 100644 --- a/lib/private/files/storage/wrapper/encryption.php +++ b/lib/private/files/storage/wrapper/encryption.php @@ -419,10 +419,11 @@ class Encryption extends Wrapper { } if ($shouldEncrypt === true && $encryptionModule !== null) { + $headerSize = $this->getHeaderSize($path); $source = $this->storage->fopen($path, $mode); $handle = \OC\Files\Stream\Encryption::wrap($source, $path, $fullPath, $header, $this->uid, $encryptionModule, $this->storage, $this, $this->util, $this->fileHelper, $mode, - $size, $unencryptedSize, $this->getHeaderSize($path)); + $size, $unencryptedSize, $headerSize); return $handle; }