Grant the CallHistoryDB folder so phone_calls_fetch can read the write-ahead log - #220
Merged
Merged
Conversation
…e-ahead log The store is a WAL-mode database, and a grant on the file alone leaves its -wal and -shm companions unreadable, so every read failed with "authorization denied".
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
phone_calls_fetchfailed withSQLite error: authorization deniedon every call.CallHistory.storedatais a WAL-mode database, so SQLite also opens the-waland-shmfiles next to it on the first read. The security-scoped bookmark covered the store file alone, and the sandbox refused those companions with EPERM, which Apple's SQLite reports as "authorization denied". Reproduced withsandbox-execdenying only the two companion files; the same read withimmutable=1succeeds, which is why the Messages service never hit this.Following #198, the Phone service now asks for the
CallHistoryDBfolder instead of the file, keeps the security scope open for the whole fetch, and asks again when it finds a file-only grant from an earlier version. If SQLite cannot open the log's companions, for example when they are absent and the folder is read-only, the read falls back toimmutable=1; without a log, the main file already holds every record.