Skip to content

Commit 8f7971b

Browse files
authored
Merge pull request #7726 from nextcloud/backport/7724/stable-3.15
[stable-3.15] ensure proper read write access to root folder and db files
2 parents 313bb1c + c01de5c commit 8f7971b

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/gui/folder.cpp

+9-1
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,15 @@ void Folder::startVfs()
543543

544544
// Immediately mark the sqlite temporaries as excluded. They get recreated
545545
// on db-open and need to get marked again every time.
546-
QString stateDbFile = _journal.databaseFilePath();
546+
const auto stateDbFile = _journal.databaseFilePath();
547+
const auto stateDbWalFile = QString(stateDbFile + QStringLiteral("-wal"));
548+
const auto stateDbShmFile = QString(stateDbFile + QStringLiteral("-shm"));
549+
550+
FileSystem::setFileReadOnly(stateDbFile, false);
551+
FileSystem::setFileReadOnly(stateDbWalFile, false);
552+
FileSystem::setFileReadOnly(stateDbShmFile, false);
553+
FileSystem::setFolderPermissions(path(), FileSystem::FolderPermissions::ReadWrite);
554+
547555
_journal.open();
548556
_vfs->fileStatusChanged(stateDbFile + "-wal", SyncFileStatus::StatusExcluded);
549557
_vfs->fileStatusChanged(stateDbFile + "-shm", SyncFileStatus::StatusExcluded);

0 commit comments

Comments
 (0)