fix: robustesse v1.1.6 — timeout runner/doctor, anti-deadlock, securite migrate, win32 is_running, websocket RFC6455, keyring JSON
- runner.rs: timeout 30s sur les commandes capturees (doctor ne pend plus) + pipes stdout/stderr draines dans des threads (anti-deadlock) ; run_untimed() pour les installations longues (npm/cargo/go) — sh() des installateurs l'utilise, les sondes gardent le timeout
- migrate_cmd.rs: rejet des chemins unsafe (path traversal) dans import_bundle
- process.rs: is_running Windows via OpenProcess/GetExitCodeProcess (fiable vs tasklist)
- probe.rs: drain des pipes en threads dans detect_external_version
- web.rs: boucle de traduction i18n (curseur, plus de boucle infinie si la traduction contient {{)
- serve.rs: frames WebSocket RFC 6455 avec vraies longueurs > 125 octets (126/127)
- secrets.rs: index keyring serialise en JSON (cles contenant des virgules)
- sandbox.rs: tests sans fuite de TempDir (plus de mem::forget)
- version 1.1.6, man pages et ROADMAP maj
This commit is contained in:
+13
-8
@@ -17,14 +17,19 @@ pub fn agent_log_path(app: &App, agent_name: &str) -> PathBuf {
|
||||
pub fn is_running(pid: u32) -> bool {
|
||||
#[cfg(windows)]
|
||||
{
|
||||
let out = Command::new("tasklist")
|
||||
.args(["/FI", &format!("PID eq {pid}"), "/NH"])
|
||||
.output();
|
||||
match out {
|
||||
Ok(o) => String::from_utf8_lossy(&o.stdout)
|
||||
.split_whitespace()
|
||||
.any(|w| w == pid.to_string()),
|
||||
Err(_) => false,
|
||||
use windows_sys::Win32::Foundation::{CloseHandle, FALSE, STILL_ACTIVE};
|
||||
use windows_sys::Win32::System::Threading::{
|
||||
GetExitCodeProcess, OpenProcess, PROCESS_QUERY_LIMITED_INFORMATION,
|
||||
};
|
||||
unsafe {
|
||||
let handle = OpenProcess(PROCESS_QUERY_LIMITED_INFORMATION, FALSE, pid);
|
||||
if handle == 0 {
|
||||
return false;
|
||||
}
|
||||
let mut code: u32 = 0;
|
||||
let ok = GetExitCodeProcess(handle, &mut code);
|
||||
CloseHandle(handle);
|
||||
ok != 0 && code == STILL_ACTIVE as u32
|
||||
}
|
||||
}
|
||||
#[cfg(not(windows))]
|
||||
|
||||
Reference in New Issue
Block a user