mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-12-28 08:49:42 -05:00
Set permissions of saved attachments to be private to the current user (#6363)
This commit is contained in:
parent
17326dc3ec
commit
ee92b980bb
@ -245,7 +245,8 @@ void EntryAttachmentsWidget::saveSelectedAttachments()
|
|||||||
|
|
||||||
QFile file(attachmentPath);
|
QFile file(attachmentPath);
|
||||||
const QByteArray attachmentData = m_entryAttachments->value(filename);
|
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) {
|
if (!saveOk) {
|
||||||
errors.append(QString("%1 - %2").arg(filename, file.errorString()));
|
errors.append(QString("%1 - %2").arg(filename, file.errorString()));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user