Skip to content

privsep: Fix capsicum support on the control socket - #707

Merged
rsmarples merged 1 commit into
masterfrom
capsicum
Aug 14, 2026
Merged

privsep: Fix capsicum support on the control socket#707
rsmarples merged 1 commit into
masterfrom
capsicum

Conversation

@rsmarples

Copy link
Copy Markdown
Member

We need getsockopt support for getpeereid.

We need getsockopt support for getpeereid.
@coderabbitai

coderabbitai Bot commented Aug 14, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 8c929685-20a9-45c6-91b0-e3fd8f44b9a3

📥 Commits

Reviewing files that changed from the base of the PR and between a14857d and 8daf0bf.

📒 Files selected for processing (4)
  • src/control.c
  • src/dhcpcd.c
  • src/privsep.c
  • src/privsep.h

Walkthrough

The change adds a Capsicum descriptor-rights helper, uses it for privileged control-socket setup, and changes interface-specific fallback behavior after EACCES.

Changes

Control socket handling

Layer / File(s) Summary
Descriptor-rights helper
src/privsep.h, src/privsep.c
Declares and implements ps_rights_limit_fd_getsockopt(int). The helper applies read, write, event, accept, getsockopt, and fcntl rights, while ignoring ENOSYS.
Socket setup and fallback
src/control.c, src/dhcpcd.c
Privileged socket setup uses the new helper. Interface-specific fallback retries with AF_UNSPEC only when the initial failure is not EACCES.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 8daf0

The change is localized and no actionable merge-blocking risk remains after normal checks and review.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the capsicum support fix for the control socket, which matches the main changes.
Description check ✅ Passed The description directly explains the added getsockopt support required by getpeereid.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch capsicum

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@rsmarples
rsmarples merged commit 23b6790 into master Aug 14, 2026
22 checks passed
@rsmarples
rsmarples deleted the capsicum branch August 14, 2026 14:27
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