Fix permissions changing on database save

* Saving a database in unsafe mode retains the existing permissions on the kdbx file
* New databases (save as, save backup, new database) and new key files are saved with 0600 permissions (user read/write), fixes #2575
This commit is contained in:
Jonathan White
2020-06-06 09:55:45 -04:00
parent 1ad0184473
commit fbebf30b98
3 changed files with 16 additions and 4 deletions

View File

@@ -680,7 +680,7 @@ void TestGuiFdoSecrets::testCollectionCreate()
QCOMPARE(spyCollectionCreated.count(), 1);
{
auto args = spyCollectionCreated.takeFirst();
args = spyCollectionCreated.takeFirst();
QCOMPARE(args.size(), 1);
QCOMPARE(args.at(0).value<Collection*>(), coll);
}
@@ -754,7 +754,7 @@ void TestGuiFdoSecrets::testCollectionDelete()
QCOMPARE(spyCollectionDeleted.count(), 1);
{
auto args = spyCollectionDeleted.takeFirst();
args = spyCollectionDeleted.takeFirst();
QCOMPARE(args.size(), 1);
QCOMPARE(args.at(0).value<Collection*>(), rawColl);
}
@@ -977,7 +977,7 @@ void TestGuiFdoSecrets::testItemDelete()
QCOMPARE(spyItemDeleted.count(), 1);
{
auto args = spyItemDeleted.takeFirst();
args = spyItemDeleted.takeFirst();
QCOMPARE(args.size(), 1);
QCOMPARE(args.at(0).value<Item*>(), rawItem);
}