Skip to content

Handle invalid BridgeManager interface names safely#796

Open
fallintoplace wants to merge 1 commit into
apple:mainfrom
fallintoplace:agent/bridge-manager-input-validation
Open

Handle invalid BridgeManager interface names safely#796
fallintoplace wants to merge 1 commit into
apple:mainfrom
fallintoplace:agent/bridge-manager-input-validation

Conversation

@fallintoplace

Copy link
Copy Markdown

Summary

  • add a throwing BridgeManager.make(...) path for eager interface-name validation
  • stop using precondition for bridge and egress interface validation so invalid input comes back as .invalidArgument
  • switch the Linux CLI bridge call sites to the throwing path and add Linux-only coverage for invalid names

Why

BridgeManager.init currently treats invalid interface names as a programming error and traps the process. That is rough for CLI and API callers because bad user input turns into a crash instead of a normal error.

This change keeps the existing initializer source-compatible, validates before create() and delete() touch host state, and gives the CLI a throwing construction path so invalid names are reported cleanly.

Validation

  • git diff --check
  • local Linux execution was not available on this macOS machine, so the new Linux-only tests are left for CI

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