From c9c49bfef8ff39eb052d9bddb796882290467c98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=B4me=20Chilliet?= Date: Thu, 4 May 2023 17:50:51 +0200 Subject: [PATCH] Log failures to delete legacy file key MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Côme Chilliet --- apps/encryption/lib/Crypto/Encryption.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/encryption/lib/Crypto/Encryption.php b/apps/encryption/lib/Crypto/Encryption.php index 465856fd28d..0bcaa167907 100644 --- a/apps/encryption/lib/Crypto/Encryption.php +++ b/apps/encryption/lib/Crypto/Encryption.php @@ -309,7 +309,12 @@ class Encryption implements IEncryptionModule { $publicKeys = $this->keyManager->addSystemKeys($this->accessList, $publicKeys, $this->getOwner($path)); $shareKeys = $this->crypt->multiKeyEncrypt($this->fileKey, $publicKeys); - $this->keyManager->deleteLegacyFileKey($this->path); + if (!$this->keyManager->deleteLegacyFileKey($this->path)) { + $this->logger->warning( + 'Failed to delete legacy filekey for {path}', + ['app' => 'encryption', 'path' => $path] + ); + } foreach ($shareKeys as $uid => $keyFile) { $this->keyManager->setShareKey($this->path, $uid, $keyFile); }