Whenever the command is run and a "legacy cipher" seems to be detected
when the legacy option is disabled, it's highly likely that the file is
actually unencrypted but the database contains a encrypted version
higher than 0 for some reason.
The command now detects this case and automatically sets the encrypted
version to 0 so that the file can be read again.
Signed-off-by: Vincent Petry <vincent@nextcloud.com>
$output->writeln("<error>Repairing is not possible when \"encryption_skip_signature_check\" is set. Please disable this flag in the configuration.</error>\n");
@ -187,6 +194,14 @@ class FixEncryptedVersion extends Command {
\fclose($handle);
return true;
} catch (ServerNotAvailableException $e) {
// not a "bad signature" error and likely "legacy cipher" exception
// this could mean that the file is maybe not encrypted but the encrypted version is set
if (!$this->supportLegacy && $ignoreCorrectEncVersionCall === true) {
$output->writeln("<info>Attempting to fix the path: \"$path\"</info>");