Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/keepassxreboot/keepassxc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavier Valls <xaviervallspla@gmail.com>2021-05-15 16:11:19 +0300
committerJonathan White <support@dmapps.us>2021-05-30 15:44:09 +0300
commit1fdfc153bede248f82fd652b005e31179b3cd68b (patch)
treecdb6b697bc0cdd8c19f5206f568cf228f8adca4c
parent9ae5b491362bf1fe6b0790a2baadcefb910a2058 (diff)
Fix unreachable setting of file permissions (#6514)
Fixes #6080
-rw-r--r--src/core/Database.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/core/Database.cpp b/src/core/Database.cpp
index ccd0ffb21..be9adfa45 100644
--- a/src/core/Database.cpp
+++ b/src/core/Database.cpp
@@ -486,8 +486,9 @@ bool Database::restoreDatabase(const QString& filePath)
// Only try to restore if the backup file actually exists
if (QFile::exists(backupFilePath)) {
QFile::remove(filePath);
- return QFile::copy(backupFilePath, filePath);
- QFile::setPermissions(filePath, perms);
+ if (QFile::copy(backupFilePath, filePath)) {
+ return QFile::setPermissions(filePath, perms);
+ }
}
return false;
}