mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-08-02 03:26:14 -04:00
FdoSecrets: skip entries in recycle bin when searching (fix #7933)
This commit is contained in:
parent
121d54c96a
commit
107dcae26c
5 changed files with 49 additions and 10 deletions
|
@ -1564,6 +1564,39 @@ void TestGuiFdoSecrets::testModifyingExposedGroup()
|
|||
}
|
||||
}
|
||||
|
||||
void TestGuiFdoSecrets::testNoExposeRecycleBin()
|
||||
{
|
||||
// when the recycle bin is underneath the exposed group
|
||||
// be careful not to expose entries in there
|
||||
|
||||
FdoSecrets::settings()->setExposedGroup(m_db, m_db->rootGroup()->uuid());
|
||||
m_db->metadata()->setRecycleBinEnabled(true);
|
||||
|
||||
auto entry = m_db->rootGroup()->entries().first();
|
||||
VERIFY(entry);
|
||||
m_db->recycleEntry(entry);
|
||||
processEvents();
|
||||
|
||||
auto service = enableService();
|
||||
VERIFY(service);
|
||||
|
||||
auto coll = getDefaultCollection(service);
|
||||
VERIFY(coll);
|
||||
|
||||
// exposing subgroup does not expose entries in other groups
|
||||
DBUS_GET(itemPaths, coll->items());
|
||||
QSet<Entry*> exposedEntries;
|
||||
for (const auto& itemPath : itemPaths) {
|
||||
exposedEntries << m_plugin->dbus()->pathToObject<Item>(itemPath)->backend();
|
||||
}
|
||||
VERIFY(!exposedEntries.contains(entry));
|
||||
|
||||
// searching should not return the entry
|
||||
DBUS_GET2(unlocked, locked, service->SearchItems({{"Title", entry->title()}}));
|
||||
COMPARE(locked, {});
|
||||
COMPARE(unlocked, {});
|
||||
}
|
||||
|
||||
void TestGuiFdoSecrets::lockDatabaseInBackend()
|
||||
{
|
||||
m_dbWidget->lock();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue