Skip to content

Grant the CallHistoryDB folder so phone_calls_fetch can read the write-ahead log - #220

Merged
mattt merged 2 commits into
mainfrom
mattt/phone-folder-grant
Sep 17, 2026
Merged

mattt merged 2 commits into
mainfrom
mattt/phone-folder-grant

Conversation

@mattt

@mattt mattt commented Sep 17, 2026

Copy link
Copy Markdown
Owner

phone_calls_fetch failed with SQLite error: authorization denied on every call. CallHistory.storedata is a WAL-mode database, so SQLite also opens the -wal and -shm files 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 with sandbox-exec denying only the two companion files; the same read with immutable=1 succeeds, which is why the Messages service never hit this.

Following #198, the Phone service now asks for the CallHistoryDB folder 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 to immutable=1; without a log, the main file already holds every record.

…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".
@mattt
mattt merged commit 5bf6fdc into main Sep 17, 2026
1 check passed
@mattt
mattt deleted the mattt/phone-folder-grant branch September 17, 2026 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant