mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-01-26 14:36:07 -05:00
Fix access denied errors when using KeeShare export/sync (#7322)
This commit is contained in:
parent
bce8c84c26
commit
6a12f450e6
@ -155,13 +155,6 @@ ShareObserver::Result ShareExport::intoContainer(const QString& resolvedPath,
|
|||||||
const KeeShareSettings::Reference& reference,
|
const KeeShareSettings::Reference& reference,
|
||||||
const Group* group)
|
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));
|
QScopedPointer<Database> targetDb(extractIntoDatabase(reference, group));
|
||||||
if (resolvedPath.endsWith(".kdbx.share")) {
|
if (resolvedPath.endsWith(".kdbx.share")) {
|
||||||
// Write database to memory and sign it
|
// Write database to memory and sign it
|
||||||
|
@ -47,7 +47,6 @@ ShareObserver::Result ShareImport::containerInto(const QString& resolvedPath,
|
|||||||
const KeeShareSettings::Reference& reference,
|
const KeeShareSettings::Reference& reference,
|
||||||
Group* targetGroup)
|
Group* targetGroup)
|
||||||
{
|
{
|
||||||
// TODO: Read signing certificate as well, but don't check validity
|
|
||||||
QByteArray dbData;
|
QByteArray dbData;
|
||||||
|
|
||||||
auto uf = unzOpen64(resolvedPath.toLatin1().constData());
|
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()};
|
return {reference.path, ShareObserver::Result::Error, file.errorString()};
|
||||||
}
|
}
|
||||||
dbData = file.readAll();
|
dbData = file.readAll();
|
||||||
|
file.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
QBuffer buffer(&dbData);
|
QBuffer buffer(&dbData);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user