fix: verify helper binary on disk after SMAppService registration#36
fix: verify helper binary on disk after SMAppService registration#36
Conversation
SMAppService.register() can report success without actually placing the binary at /Library/PrivilegedHelperTools/. Observed with enterprise security tools like Zscaler that intercept daemon registration. Now checks the binary exists after registration and falls back to the legacy AppleScript install path if missing. Fixes #35
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 25 minutes and 7 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe change modifies the helper installation process to verify the helper binary exists on disk after SMAppService registration succeeds. If registration reports success but the binary is missing, the method now falls back to legacy installation instead of continuing. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@Sources/HelperManager.swift`:
- Around line 273-281: After SMAppService.register() returns success you
currently only check helperPath; change the logic to verify both the helper
binary and the launchd plist exist (use FileManager.default.fileExists(atPath:
helperPath) && FileManager.default.fileExists(atPath: launchdPlistPath)) before
clearing installationError and treating installation as successful; if either
file is missing, log a warning similar to the existing message and call return
installHelperLegacy() so behavior matches the validation in ensureHelperReady()
and prevents clearing installationError prematurely.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 0a7b1ead-f283-483d-b3c0-7965732942d0
📒 Files selected for processing (1)
Sources/HelperManager.swift
Summary
SMAppService.register()reports success, verify the helper binary actually exists on disk at/Library/PrivilegedHelperTools/launchctl bootstrap)Fixes #35
Context
User reported helper connection failures on v2.5.0 (and v2.4.5). Diagnostics showed:
No such file or directory)sudo cp+launchctl bootstrapworked immediatelyRoot cause:
SMAppService.register()can succeed without placing the binary, especially when enterprise security software intercepts the operation.Test plan
Summary by CodeRabbit