Skip to content

Commit 9a0c501

Browse files
authored
Merge pull request #7724 from nextcloud/bugfix/ensureDbAccess
ensure proper read write access to root folder and db files
2 parents e8c632d + 2701a3c commit 9a0c501

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)