Skip to content

Commit

Permalink
Merge pull request #7726 from nextcloud/backport/7724/stable-3.15
Browse files Browse the repository at this point in the history
[stable-3.15] ensure proper read write access to root folder and db files
  • Loading branch information
mgallien authored Jan 7, 2025
2 parents 313bb1c + c01de5c commit 8f7971b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/gui/folder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,15 @@ void Folder::startVfs()

// Immediately mark the sqlite temporaries as excluded. They get recreated
// on db-open and need to get marked again every time.
QString stateDbFile = _journal.databaseFilePath();
const auto stateDbFile = _journal.databaseFilePath();
const auto stateDbWalFile = QString(stateDbFile + QStringLiteral("-wal"));
const auto stateDbShmFile = QString(stateDbFile + QStringLiteral("-shm"));

FileSystem::setFileReadOnly(stateDbFile, false);
FileSystem::setFileReadOnly(stateDbWalFile, false);
FileSystem::setFileReadOnly(stateDbShmFile, false);
FileSystem::setFolderPermissions(path(), FileSystem::FolderPermissions::ReadWrite);

_journal.open();
_vfs->fileStatusChanged(stateDbFile + "-wal", SyncFileStatus::StatusExcluded);
_vfs->fileStatusChanged(stateDbFile + "-shm", SyncFileStatus::StatusExcluded);
Expand Down

0 comments on commit 8f7971b

Please sign in to comment.