Fix access denied errors when using KeeShare export/sync (#7322)

This commit is contained in:
Jonathan White 2022-01-28 21:28:01 -05:00 committed by GitHub
parent bce8c84c26
commit 6a12f450e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 8 deletions

View File

@ -155,13 +155,6 @@ ShareObserver::Result ShareExport::intoContainer(const QString& resolvedPath,
const KeeShareSettings::Reference& reference,
const Group* group)
{
QFile file(resolvedPath);
const bool fileOpened = file.open(QIODevice::WriteOnly);
if (!fileOpened) {
qWarning("Opening export file failed");
return {resolvedPath, ShareObserver::Result::Error, file.errorString()};
}
QScopedPointer<Database> targetDb(extractIntoDatabase(reference, group));
if (resolvedPath.endsWith(".kdbx.share")) {
// Write database to memory and sign it

View File

@ -47,7 +47,6 @@ ShareObserver::Result ShareImport::containerInto(const QString& resolvedPath,
const KeeShareSettings::Reference& reference,
Group* targetGroup)
{
// TODO: Read signing certificate as well, but don't check validity
QByteArray dbData;
auto uf = unzOpen64(resolvedPath.toLatin1().constData());
@ -71,6 +70,7 @@ ShareObserver::Result ShareImport::containerInto(const QString& resolvedPath,
return {reference.path, ShareObserver::Result::Error, file.errorString()};
}
dbData = file.readAll();
file.close();
}
QBuffer buffer(&dbData);