daemon: creating a staging dir for installs#949
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
🚧 Files skipped from review as they are similar to previous changes (3)
📝 WalkthroughWalkthroughStaged installation: new path constants and CLI preflight checks; daemon enforces lstat/ownership/realpath allowlist, stages bundles, performs atomic replace with backup and rollback, and marks the staging directory as tamper-protected. ChangesStaged Installation Flow
Possibly related PRs
🎯 4 (Complex) | ⏱️ ~60 minutes 🚥 Pre-merge checks | ✅ 2✅ 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.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@Source/santactl/Commands/SNTCommandInstall.mm`:
- Around line 130-135: The current check calls
realpath(installFromPath.UTF8String, resolved) but always logs the contents of
resolved even when realpath returned NULL (undefined behavior); update the block
in SNTCommandInstall.mm to first test the return of realpath and handle the
error separately from the canonical-path mismatch: if realpath returns NULL call
TEE_LOGE with a clear message including strerror(errno) and the original
installFromPath.UTF8String, and exit; otherwise compare resolved to
kSantaMigrationAppCanonicalPath and if they differ log a different error message
that prints resolved and exit. Ensure you reference the same symbols (realpath,
resolved, kSantaMigrationAppCanonicalPath, TEE_LOGE, installFromPath) when
making the change.
In `@Source/santad/SNTDaemonControlController.mm`:
- Around line 933-934: The LOGE invocation in SNTDaemonControlController.mm is
missing a comma before the variadic argument rollbackErr causing a
syntax/compile error; update the LOGE call (the one logging "CRITICAL: rollback
failed: %@...") to include the missing comma between the format string and
rollbackErr so the format placeholder is bound to the argument and the error is
logged correctly.
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 9aaeb437-7dfe-4fff-b00b-bd054665c0f8
📒 Files selected for processing (5)
Source/common/SNTCommonEnums.hSource/santactl/Commands/SNTCommandInstall.mmSource/santad/EventProviders/SNTEndpointSecurityTamperResistance.mmSource/santad/EventProviders/SNTEndpointSecurityTamperResistanceTest.mmSource/santad/SNTDaemonControlController.mm
Test plan:
Fixes SNT-385