Merge pull request #7724 from nextcloud/bugfix/ensureDbAccess

ensure proper read write access to root folder and db files
This commit is contained in:
Matthieu Gallien 2025-01-07 08:45:26 +01:00 committed by GitHub
commit 9a0c501c7e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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);