Various minor bug fixes / enhancements

* Fix issues when Config options were renamed
* Fix compile issues when using clang 10
* Rearrange database menu icons and import database menu icons
* Set minimum size of MainWindow to 800 to prevent search bar from hiding
* Fix not saving password generator options when closing the standalone generator
* Add headers to health check reports
* Don't show hidden content dots when notes are hidden but empty.

* Fix saving new database files in SMB shares on Windows, fixes #4809

* Gracefully handle duplicate attachments :
Instead of bailing out with an error, prepend a random string to the name of duplicate attachment records. This prevents data loss from other programs that mishandled KDBX XML writing. Fixes #2493

* Properly handle blocked import of signed KeeShare database, fixes #4413
This commit is contained in:
Jonathan White 2020-06-04 08:11:12 -04:00
parent e36cba703e
commit c830f85c09
19 changed files with 101 additions and 80 deletions

View file

@ -875,11 +875,13 @@ QPair<QString, QString> KdbxXmlReader::parseEntryBinary(Entry* entry)
}
if (keySet && valueSet) {
if (entry->attachments()->hasKey(key)) {
raiseError(tr("Duplicate attachment found"));
} else {
entry->attachments()->set(key, value);
if (entry->attachments()->hasKey(key) && entry->attachments()->value(key) != value) {
// NOTE: This only impacts KDBX 3.x databases
// Prepend a random string to the key to make it unique and prevent data loss
key = key.prepend(QUuid::createUuid().toString().mid(1, 8) + "_");
qWarning("Duplicate attachment name found, renamed to: %s", qPrintable(key));
}
entry->attachments()->set(key, value);
} else {
raiseError(tr("Entry binary key or value missing"));
}