Skip to content

Kept the CMDB insertion-failure test hook out of the production library - #99

Merged
djbclark merged 2 commits into
cmdb-fail-closedfrom
cmdb-test-seam
Nov 14, 2026
Merged

djbclark merged 2 commits into
cmdb-fail-closedfrom
cmdb-test-seam

Conversation

@djbclark

Copy link
Copy Markdown
Owner

CMDBTestFailInsertion was a writable, exported function pointer in production libpromises, consulted on every CMDB load (adversary D3 on frdminc/tendcf#41). It now exists only when TEST_UNIT_TEST is defined: cmdb_test.c includes cmdb.c with it defined, as split_process_line_test.c already does for processes_select.c. In production the check is a constant false and the symbol and its cmdb.h declaration are gone. The 24 test cases are unchanged. A second commit points .gitmodules at https://github.com/djbclark/libntech, since the gitlink is a fork commit; fork-only, upstream PRs keep upstream's URL.

Stacked on cmdb-fail-closed. Gate (scratch branch, same jobs as for PR 98) and the symbol check: see the comment below once it has run.

Prior art / docs checked: rg of the tree for test hooks found one pattern (TEST_UNIT_TEST in processes_select.c, set by split_process_line_test.c), followed here; no weak symbols or other macros exist. Fork issues and PRs searched for the hook, nothing else.

🤖 Generated with Claude Code

djbclark and others added 2 commits November 14, 2026 16:56
CMDBTestFailInsertion was a writable, exported function pointer in
libpromises, consulted on every CMDB load. It now exists only when
TEST_UNIT_TEST is defined, and cmdb_test.c includes cmdb.c with that
defined, the way split_process_line_test.c does for processes_select.c.
In production the check is a constant false and the symbol and its
declaration in cmdb.h are gone. The test cases are unchanged.

Changelog: None
Ticket: none

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The libntech gitlink is a commit of the fork's tendcf-integration branch,
which NorthernTechHQ/libntech does not have, so a plain clone could not
fetch it. Fork-only: PRs offered upstream keep upstream's URL.

Changelog: None
Ticket: none

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Nov 14, 2026

Copy link
Copy Markdown

Automatic reviews are disabled for this repository. Configure in Code Review Settings.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-14T21:58:14.820702Z 8d8dc94 PR opened
🔒 Security Review ✅ Completed 2026-11-14T22:00:26.010669Z 8d8dc94 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@djbclark

Copy link
Copy Markdown
Owner Author

Gate on scratch branch ci-gate/seam-8d8dc94 (PR head 8d8dc94 + the gate workflow): https://github.com/djbclark/core/actions/runs/43645462050 green. Unit 81/81 (cmdb_test 24/24), 06_host_specific_data 18/18, def.json 26 pass + the known soft failure CFE-2956. Symbol check: nm -A libpromises/.libs/cmdb.o has no CMDBTestFailInsertion (0 matches); tests/unit/cmdb_test.o has it as a local b symbol.

@djbclark
djbclark merged commit d3d1aa2 into cmdb-fail-closed Nov 14, 2026
2 checks passed
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