Skip to content

fix(cli): attribute activation refusals to the recorded safety check (#1416) - #1449

Open
DeusData wants to merge 1 commit into
mainfrom
fix/1416-activation-refusal-attribution
Open

fix(cli): attribute activation refusals to the recorded safety check (#1416)#1449
DeusData wants to merge 1 commit into
mainfrom
fix/1416-activation-refusal-attribution

Conversation

@DeusData

@DeusData DeusData commented Aug 4, 2026

Copy link
Copy Markdown
Owner

Part of #1416 (the misattribution half — the actionable-error fix).

Reproduced on the Windows VM

A directory carrying the stock Authenticated Users:(M) inheritance from a drive root (any plain mkdir under C:\, most secondary-drive paths) trips the activation transaction's ACL safety check. The refusal was recorded internally — predicate, SID, path — but install/uninstall/doctor surfaced only:

error: active CBM sessions and operations could not be stopped safely; no activation was committed.

Both reporters killed processes, rebooted, and hunted phantom handles because the message points at sessions that never existed.

Fix

cli_activation_diagnostic now prefixes the recorded refusal note plus one remediation line (remove the flagged grant via icacls, or choose an owner-private --dir/CBM_CACHE_DIR). The sessions wording remains for genuine stop/reservation failures, which record no note. No change to what is accepted or refused — attribution only.

Verification

  • Portable regression test via a new CBM_ENABLE_TEST_SEAMS refusal-note setter: note ⇒ diagnostic names the check, no note ⇒ sessions text intact. RED → GREEN → RED-on-revert.
  • cli suite 258 passed, lint-ci clean.
  • End-to-end on the Windows VM (UTM, clangarm64): tainted-ancestry uninstall/doctor now name the ACL check.

Deliberately NOT in this PR (maintainer decision pending)

Whether the ACL gate should tolerate ancestor-inherited cross-account grants when the final directory is owner-private with a protected DACL — that decides whether default secondary-drive installs work at all, and it's a security-posture question, not a bug fix. Decision matrix goes to the maintainer separately. The #1351 empty-ACL destruction did not reproduce in any VM variant (files stayed owner-usable through daemon-refusal, failed install, failed uninstall); reporter question outstanding.

…1416)

Windows users hit 'active CBM sessions and operations could not be
stopped safely; no activation was committed' from install, uninstall
and doctor with ZERO CBM processes running - they rebooted, killed
phantom handles, and deleted runtime folders chasing sessions that did
not exist. The real failure was the activation transaction's Windows
ACL safety check refusing a directory carrying cross-account mutation
grants (commonly the stock Authenticated Users:(M) inheritance from a
drive root - reproduced on the Windows VM with a plain mkdir under C:\
and with an icacls-granted parent), and the refusal detail was recorded
internally but never shown.

cli_activation_diagnostic now prefixes the recorded refusal note - the
predicate, SID and path - plus one remediation line (remove the flagged
grant or use an owner-private directory). The sessions wording remains
for genuine stop/reservation failures, which record no note.

Adds a CBM_ENABLE_TEST_SEAMS setter for the refusal note so the
attribution is testable portably; the regression test asserts the note
reaches the diagnostic (and that the no-note path keeps the sessions
text). RED before the fix, GREEN after, RED again on revert. Verified
end-to-end on the Windows VM: uninstall/doctor against an ACL-tainted
tree now name the ACL check instead of sessions.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
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