mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-04-04 21:17:43 +03:00
Preserve Secret Service exposed group setting on merge
* Fixes #9371 - adds secret service custom data key to the list of protected custom data (will not be overwritten on merge)
This commit is contained in:
parent
30d4e36a8b
commit
2dfc0e540c
2 changed files with 5 additions and 15 deletions
|
@ -190,7 +190,7 @@ void CustomData::updateLastModified(QDateTime lastModified)
|
||||||
|
|
||||||
bool CustomData::isProtected(const QString& key) const
|
bool CustomData::isProtected(const QString& key) const
|
||||||
{
|
{
|
||||||
return key.startsWith(CustomData::BrowserKeyPrefix) || key.startsWith(CustomData::Created);
|
return key.startsWith(BrowserKeyPrefix) || key == Created || key == FdoSecretsExposedGroup;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CustomData::isAutoGenerated(const QString& key) const
|
bool CustomData::isAutoGenerated(const QString& key) const
|
||||||
|
|
|
@ -21,15 +21,6 @@
|
||||||
#include "core/Database.h"
|
#include "core/Database.h"
|
||||||
#include "core/Metadata.h"
|
#include "core/Metadata.h"
|
||||||
|
|
||||||
namespace Keys
|
|
||||||
{
|
|
||||||
namespace Db
|
|
||||||
{
|
|
||||||
constexpr auto FdoSecretsExposedGroup = "FDO_SECRETS_EXPOSED_GROUP";
|
|
||||||
} // namespace Db
|
|
||||||
|
|
||||||
} // namespace Keys
|
|
||||||
|
|
||||||
namespace FdoSecrets
|
namespace FdoSecrets
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -98,20 +89,19 @@ namespace FdoSecrets
|
||||||
return exposedGroup(db.data());
|
return exposedGroup(db.data());
|
||||||
}
|
}
|
||||||
|
|
||||||
void FdoSecretsSettings::setExposedGroup(const QSharedPointer<Database>& db,
|
void FdoSecretsSettings::setExposedGroup(const QSharedPointer<Database>& db, const QUuid& group)
|
||||||
const QUuid& group) // clazy:exclude=function-args-by-value
|
|
||||||
{
|
{
|
||||||
setExposedGroup(db.data(), group);
|
setExposedGroup(db.data(), group);
|
||||||
}
|
}
|
||||||
|
|
||||||
QUuid FdoSecretsSettings::exposedGroup(Database* db) const
|
QUuid FdoSecretsSettings::exposedGroup(Database* db) const
|
||||||
{
|
{
|
||||||
return {db->metadata()->customData()->value(Keys::Db::FdoSecretsExposedGroup)};
|
return {db->metadata()->customData()->value(CustomData::FdoSecretsExposedGroup)};
|
||||||
}
|
}
|
||||||
|
|
||||||
void FdoSecretsSettings::setExposedGroup(Database* db, const QUuid& group) // clazy:exclude=function-args-by-value
|
void FdoSecretsSettings::setExposedGroup(Database* db, const QUuid& group)
|
||||||
{
|
{
|
||||||
db->metadata()->customData()->set(Keys::Db::FdoSecretsExposedGroup, group.toString());
|
db->metadata()->customData()->set(CustomData::FdoSecretsExposedGroup, group.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace FdoSecrets
|
} // namespace FdoSecrets
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue