review wave 1: fix the critical restore false-success + security/correctness findings
build-test-release / release (push) Successful in 6m53s
build-test-release / release (push) Successful in 6m53s
From the recursive multi-agent review (18 confirmed findings). This wave clears the critical, four highs, and several mediums/lows: - CRITICAL restore.rs: a Braiins SSH restore reported SUCCESS on a wrong password or unreachable miner. run_with_timeout now captures the exit code and drains stderr on its own thread (also fixing the medium stderr-pipe stall), and a new testable classify_braiins() treats an ssh auth/connection failure (stderr diagnostic, empty stdout, non-zero exit) as failure while still reading a dropped connection / timeout as the expected reboot. Unit-tested. - HIGH restore exclusivity: apply_restore_confirm now refuses when a scan/refresh/ action/flash or another restore is in flight, so this destructive action never overlaps or orphans a running restore handle. - HIGH secrets off the command line: Braiins SSH uses `sshpass -e` (env, not -p), and the access-probe curl passes credentials through a config on stdin (-K -) instead of `-u user:pass`; both were visible in the process list. New masked password field (wxTE_PASSWORD bridge) so the Credentials dialog no longer renders saved passwords in the clear. - MEDIUM correctness: per-board Chip-temp readings are now index-aligned with the boards (a missing middle board shows "-" instead of shifting later boards left). - MEDIUM: saved pool lists (which can hold a pool password) are chmod 0600. - LOW: access-probe curl timeout now reaps the child (no zombie). 95 tests (+classify_braiins) + clippy-clean + selftest green. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Djv3oncM4LxTS5tb61Ako6
This commit is contained in:
@@ -776,6 +776,13 @@ void* wxbr_text_ctrl(void* parent, int multiline) {
|
||||
wxDefaultPosition, wxSize(-1, -1), style);
|
||||
}
|
||||
|
||||
// A single-line text control that masks its content (wxTE_PASSWORD), for secret
|
||||
// entry so a saved password is never rendered in the clear (round 18 #12).
|
||||
void* wxbr_text_ctrl_password(void* parent) {
|
||||
return (void*)new wxTextCtrl((wxWindow*)parent, wxID_ANY, wxT(""),
|
||||
wxDefaultPosition, wxSize(-1, -1), wxTE_PASSWORD);
|
||||
}
|
||||
|
||||
int wxbr_text_ctrl_get(void* win, char* buf, int cap) {
|
||||
wxTextCtrl* t = (wxTextCtrl*)win;
|
||||
wxString v = t->GetValue();
|
||||
|
||||
@@ -36,6 +36,7 @@ mod notsafe {
|
||||
pub fn wxbr_button(parent: *mut c_void, label: *const c_char, id: c_int) -> *mut c_void;
|
||||
pub fn wxbr_bind_click(win: *mut c_void, id: c_int);
|
||||
pub fn wxbr_text_ctrl(parent: *mut c_void, multiline: c_int) -> *mut c_void;
|
||||
pub fn wxbr_text_ctrl_password(parent: *mut c_void) -> *mut c_void;
|
||||
pub fn wxbr_text_ctrl_get(win: *mut c_void, buf: *mut c_char, cap: c_int) -> c_int;
|
||||
pub fn wxbr_text_ctrl_set(win: *mut c_void, value: *const c_char);
|
||||
pub fn wxbr_text_ctrl_write(win: *mut c_void, value: *const c_char);
|
||||
@@ -438,6 +439,11 @@ impl Widget {
|
||||
Widget(unsafe { notsafe::wxbr_text_ctrl(parent.0, multiline as c_int) })
|
||||
}
|
||||
|
||||
/// A single-line text control that masks its content (for password entry).
|
||||
pub fn password_ctrl(parent: Widget) -> Widget {
|
||||
Widget(unsafe { notsafe::wxbr_text_ctrl_password(parent.0) })
|
||||
}
|
||||
|
||||
pub fn get_value(&self) -> String {
|
||||
let mut buf = vec![0i8; 65536];
|
||||
let n = unsafe { notsafe::wxbr_text_ctrl_get(self.0, buf.as_mut_ptr(), buf.len() as c_int) };
|
||||
|
||||
Reference in New Issue
Block a user