Skip to content

Commit

Permalink
improve log messages for encryption rename (#40875)
Browse files Browse the repository at this point in the history
  • Loading branch information
pako81 authored Jul 14, 2023
1 parent 253b4ae commit a16f52f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/private/Files/Storage/Wrapper/Encryption.php
Original file line number Diff line number Diff line change
Expand Up @@ -310,17 +310,17 @@ public function rename($path1, $path2) {
if ($renameOk) {
$sourceKeyDeleteOk = $this->keyStorage->deleteAllFileKeys($source);
if (!$sourceKeyDeleteOk) {
$this->logger->error("Renaming {$path1} to {$path2} succeeded, but key {$target} wasn't deleted from the original location in {$source}");
$this->logger->error("Renaming {$path1} to {$path2} succeeded, but key for file {$target} wasn't removed from its original location");
}
} else {
$this->logger->error("Renaming {$path1} to {$path2} failed");
$targetKeyDeleteOk = $this->keyStorage->deleteAllFileKeys($target);
if (!$targetKeyDeleteOk) {
$this->logger->error("Copied key {$source} wasn't removed from the target location in {$target}");
$this->logger->error("Copied key for file {$source} wasn't removed from its target location");
}
}
} else {
$this->logger->error("Failed to copied keys from {$source} to {$target} while renaming {$path1} to {$path2}");
$this->logger->error("Failed to copy keys while renaming {$path1} to {$path2}");
}

return $renameOk && $copyKeysOk;
Expand Down

0 comments on commit a16f52f

Please sign in to comment.