summaryrefslogtreecommitdiffstats
path: root/apps/encryption
diff options
context:
space:
mode:
authorVincent Petry <vincent@nextcloud.com>2022-12-20 17:16:12 +0100
committerGitHub <noreply@github.com>2022-12-20 17:16:12 +0100
commit3bcbc4701a0f0bd4800fd7f89403e578a610fd0b (patch)
treea1d4aad9518ea2cb68bf0f9d35caf404a04aa69a /apps/encryption
parentf6ff717b56ac9fa69e60991e982dfdd4c26a95f3 (diff)
parente3a0e646980b6f75b904e21bf127868aa8e2d66c (diff)
downloadnextcloud-server-3bcbc4701a0f0bd4800fd7f89403e578a610fd0b.tar.gz
nextcloud-server-3bcbc4701a0f0bd4800fd7f89403e578a610fd0b.zip
Merge pull request #34724 from nextcloud/encryption-read-before-cache
fix reading newly written encrypted files before their cache entry is written
Diffstat (limited to 'apps/encryption')
-rw-r--r--apps/encryption/lib/Command/FixEncryptedVersion.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/apps/encryption/lib/Command/FixEncryptedVersion.php b/apps/encryption/lib/Command/FixEncryptedVersion.php
index 925dc3dd805..a6f2a55bb79 100644
--- a/apps/encryption/lib/Command/FixEncryptedVersion.php
+++ b/apps/encryption/lib/Command/FixEncryptedVersion.php
@@ -22,6 +22,7 @@
namespace OCA\Encryption\Command;
+use OC\Files\Storage\Wrapper\Encryption;
use OC\Files\View;
use OC\ServerNotAvailableException;
use OCA\Encryption\Util;
@@ -190,6 +191,13 @@ class FixEncryptedVersion extends Command {
*/
private function verifyFileContent(string $path, OutputInterface $output, bool $ignoreCorrectEncVersionCall = true): bool {
try {
+ // since we're manually poking around the encrypted state we need to ensure that this isn't cached in the encryption wrapper
+ $mount = $this->view->getMount($path);
+ $storage = $mount->getStorage();
+ if ($storage && $storage->instanceOfStorage(Encryption::class)) {
+ $storage->clearIsEncryptedCache();
+ }
+
/**
* In encryption, the files are read in a block size of 8192 bytes
* Read block size of 8192 and a bit more (808 bytes)