Repository navigation
fix(daemon): read the peer pid on FreeBSD via LOCAL_PEERCRED - #2967
Merged
Merged
Conversation
cbm_daemon_ipc_connection_peer_pid() had branches for Linux (SO_PEERCRED), macOS (LOCAL_PEERPID) and NetBSD (LOCAL_PEEREID), but FreeBSD defines none of them, so it fell through to `return 0`, and runtime_accept_connection() closes every connection whose peer pid is 0: on FreeBSD the daemon rejected every client. Read the peer credentials with getsockopt(SOL_LOCAL, LOCAL_PEERCRED) into a struct xucred and accept only the expected layout version, the caller's effective uid and a positive pid, mirroring the Linux branch. The branch and its <sys/ucred.h> include compile only on FreeBSD. Carried forward from #2492, which also raised three timeouts on every platform; those are left out (CBM_STARTUP_TIMEOUT_MS covers slow hosts). Co-authored-by: Yury Romanov <[email protected]> Signed-off-by: Martin Vogel <[email protected]>
DeusData
added a commit
to htarnacki/codebase-memory-mcp
that referenced
this pull request
Nov 13, 2026
Brings in main up to 09bd6bb (DeusData#2967 FreeBSD peer pid, DeusData#2974 graph variation and content loss fixes). Resolutions: - scripts/memory-core-baseline.txt (textual conflict): both sides lowered counts in the same hunk. pass_parallel.c keeps this branch's 29 (arena QNs); pass_pkgmap.c takes main's 80 (DeusData#2974 dropped one raw free in cbm_pkgmap_build; this branch's pass_pkgmap.c additions add no raw site). Both values re-derived by scanning the merged tree with scripts/lint-memory-core.py; the lint passes. - src/pipeline/pass_pkgmap.c (auto-merged): main's deterministic manifest order in cbm_pkgmap_build and this branch's Scala package index sit in separate functions; the merged file is main plus this branch's change unchanged (same per-file patch-id). - tests/test_edge_imports.c, tests/test_pipeline.c (auto-merged): both sides' new tests are kept and registered; main's new tests call no function this branch re-signed. Same per-file patch-id as this branch's change. Every other file equals main. Signed-off-by: Martin Vogel <[email protected]>
4 tasks done
DeusData
added a commit
to ankitsusheel/codebase-memory-mcp
that referenced
this pull request
Nov 14, 2026
Brings the branch up to main d68f491 (DeusData#2967, DeusData#2968, DeusData#2970, DeusData#2974). src/pipeline/registry.c: main (DeusData#2968) gives registry_resolve_scoped the calling definition's test verdict (`caller_test`), adds cbm_registry_resolve_ref for references (USAGE, READS, WRITES) and routes calls through a static resolve_call_lang. This branch wraps the lookups with the VB.NET case-insensitive retry. Resolved by keeping both: vb_resolve_folded takes `caller_test` and passes it to its own lookup, and the retry hooks cbm_registry_resolve_lang (false), cbm_registry_resolve_ref and resolve_call_lang (the caller's verdict), exactly as main's first lookup in each. Without the hook in cbm_registry_resolve_ref, VB.NET references would have stopped folding. internal/cbm/vendored/grammars/MANIFEST.md: main added the sql row next to the vbnet row this branch edits; both rows kept. scripts/vendored-checksums.txt: regenerated with scripts/security-vendored.sh --update; only the MANIFEST.md line differs from main. Adapted with the merge: the VB.NET registry test passes `false` as the new caller_test argument of cbm_registry_resolve_call_scoped (a production caller). Signed-off-by: Martin Vogel <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Carries forward the FreeBSD peer-credential fix from #2492 by @romanov, credited with a Co-authored-by trailer.
cbm_daemon_ipc_connection_peer_pid()has branches for Linux (SO_PEERCRED), macOS (LOCAL_PEERPID) and NetBSD (LOCAL_PEEREID). FreeBSD defines none of them, so it returned 0, andruntime_accept_connection()closes every connection whose peer pid is 0: on FreeBSD the daemon rejected every client. The new branch readsstruct xucredviagetsockopt(SOL_LOCAL, LOCAL_PEERCRED)and accepts only the expected layout version, the caller's effective uid and a positive pid, mirroring the Linux branch.Left out from #2492: three timeout increases that applied to every platform (
CBM_STARTUP_TIMEOUT_MSalready covers slow hosts).Proof on FreeBSD 14.4 and 15.1, from a temporary probe on never-merged scratch branches that feeds the binary the smoke test's initialize / initialized / tools/list input:
On macOS, Linux and Windows the branch is compiled out (the preprocessed ipc.c is byte-identical on macOS).