Repository navigation
Commit f517455
committed
fix(win): reconcile the C suite with the managed-launcher contract
The first full Windows x64 CI run of this branch (earlier contract-step
walls had always aborted the leg) surfaced 40 failures: the managed
launcher's fail-closed install/update/uninstall gates and the suite's
POSIX-modeled activation tests were both new in this branch and had
never been reconciled, and they hid three real production bugs.
Production fixes:
- ui: config publishes with POSIX rename semantics. MoveFileExW's legacy
replace cannot supersede a destination a reader holds open (the name
lingers until the last handle closes, even with FILE_SHARE_DELETE), so
a config save racing an open reader failed. The temp file is opened
with DELETE access and renamed in-hand (bare-path target, NUL-padded
rename record) before close, falling back to MoveFileExW on any
rename-by-handle failure so non-NTFS config homes keep the previous
behavior.
- subprocess(win): the child's redirected log handle now shares write
access. POSIX places no lock on the redirected log, so a second
producer may append while the child runs; the missing FILE_SHARE_WRITE
mandatory-locked every other writer out, which the index-supervisor
callback-isolation test legitimately exercises.
- cli(win): the portable uninstall path composes the managed binary name
with its .exe suffix; it could never find (or remove) the installed
binary before.
- activation: security-predicate refusals are now diagnosable. The
transaction's predicates refuse without a usable OS last-error, which
collapsed five distinct refusal classes into one blind "status -3,
os 0" at every caller. Each refusing predicate records what refused —
predicate, untrusted SID, and object path — first-wins so the deepest
cause survives, and the staging error line appends it. This is what
identified every Windows refusal in this batch, including the real
install-failure class on drive-root-rooted payload directories
(Authenticated Users holds inherited Modify there; profile-rooted
directories do not).
Windows test dispatch (release binaries unchanged):
- Test builds (CBM_CLI_ENABLE_TEST_API, the existing test-object macro)
compile the portable activation flow on Windows, reachable solely
through the installed activation test seam and announced loudly on
stderr; release binaries compile exclusively the managed transaction,
so the dispatch polarity fails closed. The suite's install/update/
uninstall calls route through a seam-if-absent wrapper, keeping the
shared activation and agent-config semantics unit-covered on Windows;
POSIX arms keep exercising the real activation machinery.
- Two new release-gate tests assert the fail-closed contract with the
seam OFF: a portable payload may not self-update/self-uninstall, and
install refuses to adopt or replace a foreign file at the canonical
launcher path even under --force.
- Test-bug fixes the first valid Windows runs exposed: the version-
cohort crash test reused one conflict record across the probe and the
turnover acquire (whose entry memset erased the probe's detail before
the assertions read it); the activation staged-path assertion now
checks containment rather than a separator (the \\?\ namespace
performs no forward-slash translation); the ui atomic test captures,
cleans up, then asserts so a failure cannot poison later tests; the
PATH-visibility guard is POSIX-only (Windows configures PATH through
the user registry, not a shell rc).
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>1 parent 6ab5e3f commit f517455
9 files changed
Lines changed: 435 additions & 99 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
78 | 79 | | |
79 | 80 | | |
80 | 81 | | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
81 | 113 | | |
82 | 114 | | |
83 | 115 | | |
| |||
382 | 414 | | |
383 | 415 | | |
384 | 416 | | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
385 | 420 | | |
386 | 421 | | |
387 | 422 | | |
| |||
400 | 435 | | |
401 | 436 | | |
402 | 437 | | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
403 | 441 | | |
404 | 442 | | |
405 | 443 | | |
| |||
482 | 520 | | |
483 | 521 | | |
484 | 522 | | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
485 | 532 | | |
486 | 533 | | |
487 | 534 | | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
488 | 538 | | |
489 | 539 | | |
490 | 540 | | |
| |||
560 | 610 | | |
561 | 611 | | |
562 | 612 | | |
| 613 | + | |
563 | 614 | | |
564 | 615 | | |
565 | 616 | | |
566 | 617 | | |
567 | 618 | | |
568 | 619 | | |
569 | 620 | | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
570 | 625 | | |
571 | 626 | | |
572 | 627 | | |
| |||
592 | 647 | | |
593 | 648 | | |
594 | 649 | | |
| 650 | + | |
595 | 651 | | |
596 | 652 | | |
597 | 653 | | |
| |||
605 | 661 | | |
606 | 662 | | |
607 | 663 | | |
| 664 | + | |
608 | 665 | | |
609 | 666 | | |
610 | 667 | | |
611 | 668 | | |
612 | 669 | | |
613 | 670 | | |
| 671 | + | |
614 | 672 | | |
615 | 673 | | |
616 | 674 | | |
| |||
623 | 681 | | |
624 | 682 | | |
625 | 683 | | |
| 684 | + | |
626 | 685 | | |
627 | 686 | | |
628 | 687 | | |
| |||
853 | 912 | | |
854 | 913 | | |
855 | 914 | | |
| 915 | + | |
856 | 916 | | |
857 | 917 | | |
858 | 918 | | |
| |||
865 | 925 | | |
866 | 926 | | |
867 | 927 | | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
868 | 933 | | |
869 | 934 | | |
870 | 935 | | |
871 | 936 | | |
872 | 937 | | |
873 | 938 | | |
874 | 939 | | |
| 940 | + | |
875 | 941 | | |
876 | 942 | | |
877 | 943 | | |
| |||
1171 | 1237 | | |
1172 | 1238 | | |
1173 | 1239 | | |
| 1240 | + | |
1174 | 1241 | | |
1175 | 1242 | | |
1176 | 1243 | | |
| |||
1203 | 1270 | | |
1204 | 1271 | | |
1205 | 1272 | | |
1206 | | - | |
1207 | | - | |
| 1273 | + | |
1208 | 1274 | | |
1209 | 1275 | | |
1210 | 1276 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
88 | 95 | | |
0 commit comments