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:
authorStefan Sundin <git@stefansundin.com>2021-05-13 06:20:41 +0300
committerJonathan White <support@dmapps.us>2021-05-30 15:44:09 +0300
commit29de94b65674559b55102b8ec4ddbaf06364a274 (patch)
tree9e6ef669369a5f010742d6d391a0d962f73e7799
parent438172bef9366314915a2a91ca1fcd4beb770167 (diff)
Set permissions of saved attachments to be private to the current user (#6363)
-rw-r--r--src/gui/entry/EntryAttachmentsWidget.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gui/entry/EntryAttachmentsWidget.cpp b/src/gui/entry/EntryAttachmentsWidget.cpp
index 836c8ef27..f78b64417 100644
--- a/src/gui/entry/EntryAttachmentsWidget.cpp
+++ b/src/gui/entry/EntryAttachmentsWidget.cpp
@@ -238,7 +238,8 @@ void EntryAttachmentsWidget::saveSelectedAttachments()
QFile file(attachmentPath);
const QByteArray attachmentData = m_entryAttachments->value(filename);
- const bool saveOk = file.open(QIODevice::WriteOnly) && file.write(attachmentData) == attachmentData.size();
+ const bool saveOk = file.open(QIODevice::WriteOnly) && file.setPermissions(QFile::ReadUser | QFile::WriteUser)
+ && file.write(attachmentData) == attachmentData.size();
if (!saveOk) {
errors.append(QString("%1 - %2").arg(filename, file.errorString()));
}