fix: add actionable FDA guidance for TCC authorization denial#9
fix: add actionable FDA guidance for TCC authorization denial#9
Conversation
📝 WalkthroughWalkthroughThe PR enhances error handling and user documentation for Full Disk Access authorization issues when accessing the macOS TCC.db file. Changes include adding helpful error messages to diagnose permission problems and documenting troubleshooting steps in the README. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/tcc.rs (1)
121-127: Minor: Redundant substring check.The check for
"open authorization denied"is redundant since"authorization denied"would already match that case. This doesn't affect correctness but could be simplified.♻️ Suggested simplification
let source_lower = source.to_lowercase(); let is_open_denied = source_lower.contains("authorization denied") - || source_lower.contains("open authorization denied") || source_lower.contains("not authorized"); if !is_open_denied { return None; }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/tcc.rs` around lines 121 - 127, The is_open_denied check in src/tcc.rs redundantly tests for "open authorization denied" because source_lower.contains("authorization denied") already covers that case; update the boolean expression using the existing symbols (source_lower and is_open_denied) to remove the redundant contains call so it only checks for "authorization denied" || "not authorized", keeping the rest of the early-return logic unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@src/tcc.rs`:
- Around line 121-127: The is_open_denied check in src/tcc.rs redundantly tests
for "open authorization denied" because source_lower.contains("authorization
denied") already covers that case; update the boolean expression using the
existing symbols (source_lower and is_open_denied) to remove the redundant
contains call so it only checks for "authorization denied" || "not authorized",
keeping the rest of the early-return logic unchanged.
Summary
Improve TCC database open error handling so authorization-denied failures show actionable Full Disk Access guidance for terminal-based workflows.
Changes
DbOpenhint mapping insrc/tcc.rsfor authorization/open-denied SQLite errors on TCC DB paths only.sudodoes not bypass TCC.Validation
cargo fmtcargo clippy -- -D warningscargo testLinked Issues
Summary by CodeRabbit
Documentation
Bug Fixes