Log failures to delete legacy file key

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
pull/38080/head
Côme Chilliet 2023-05-04 17:50:51 +07:00
parent 146284f170
commit c9c49bfef8
No known key found for this signature in database
GPG Key ID: A3E2F658B28C760A
1 changed files with 6 additions and 1 deletions

@ -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);
}