--persistent ownership check runs after the host is already mutated #3

Closed
opened 2026-08-11 10:25:36 +00:00 by aav · 0 comments
Owner

The --persistent root-ownership check runs last, after the interface, addresses, and /etc/hosts block are already created (src/setup.rs:227 onward). A refusal leaves setup half-applied, and a corrected re-run is rejected because the interface now exists.

Failure scenario: user runs sudo silta setup --persistent with the binary still in target/release. The interface is created, addresses added, and /etc/hosts written, then install_daemon bails on the ownership check and the command exits nonzero. After installing the binary to /usr/local/bin and re-running, apply_setup bails with "feth99 already exists. run silta teardown first", forcing a teardown (killing any live forwards) and a second setup just to add the daemon.

Fix direction: validate the persistence preconditions (binary/config ownership) before mutating any host state.

Source: high-effort code review, CONFIRMED. Area: setup.

The `--persistent` root-ownership check runs last, after the interface, addresses, and /etc/hosts block are already created (src/setup.rs:227 onward). A refusal leaves setup half-applied, and a corrected re-run is rejected because the interface now exists. **Failure scenario:** user runs `sudo silta setup --persistent` with the binary still in target/release. The interface is created, addresses added, and /etc/hosts written, then `install_daemon` bails on the ownership check and the command exits nonzero. After installing the binary to /usr/local/bin and re-running, `apply_setup` bails with "feth99 already exists. run silta teardown first", forcing a teardown (killing any live forwards) and a second setup just to add the daemon. **Fix direction:** validate the persistence preconditions (binary/config ownership) before mutating any host state. Source: high-effort code review, CONFIRMED. Area: setup.
aav self-assigned this 2026-08-11 10:27:24 +00:00
aav closed this issue 2026-08-11 11:03:14 +00:00
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
carvers/silta#3
No description provided.