mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-07-27 00:35:27 -04:00
Fix updating reference passwords from KeePassXC-Browser (#2218)
* Allow updating reference passwords * Fix function change after refactor
This commit is contained in:
parent
94430c300b
commit
0da9efdbd4
4 changed files with 35 additions and 1 deletions
|
@ -371,6 +371,17 @@ void BrowserService::updateEntry(const QString& id,
|
|||
return;
|
||||
}
|
||||
|
||||
// Check if the entry password is a reference. If so, update the original entry instead
|
||||
while (entry->attributes()->isReference(EntryAttributes::PasswordKey)) {
|
||||
const QUuid referenceUuid = entry->attributes()->referenceUuid(EntryAttributes::PasswordKey);
|
||||
if (!referenceUuid.isNull()) {
|
||||
entry = db->rootGroup()->findEntryByUuid(referenceUuid);
|
||||
if (!entry) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
QString username = entry->username();
|
||||
if (username.isEmpty()) {
|
||||
return;
|
||||
|
@ -391,7 +402,9 @@ void BrowserService::updateEntry(const QString& id,
|
|||
|
||||
if (browserSettings()->alwaysAllowUpdate() || dialogResult == MessageBox::Save) {
|
||||
entry->beginUpdate();
|
||||
entry->setUsername(login);
|
||||
if (!entry->attributes()->isReference(EntryAttributes::UserNameKey)) {
|
||||
entry->setUsername(login);
|
||||
}
|
||||
entry->setPassword(password);
|
||||
entry->endUpdate();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue