fix: cross-platform CA trust (Arch/Fedora + Windows) #41

Merged
razvandimescu merged 4 commits from fix/cross-platform-ca-trust into main 2026-04-08 20:18:01 +08:00
Showing only changes of commit 600fc3b876 - Show all commits

View File

@@ -1421,8 +1421,7 @@ fn trust_ca_linux(ca_path: &std::path::Path) -> Result<(), String> {
})?; })?;
let dest = std::path::Path::new(store.anchor_dir).join(store.anchor_file); let dest = std::path::Path::new(store.anchor_dir).join(store.anchor_file);
std::fs::copy(ca_path, &dest) std::fs::copy(ca_path, &dest).map_err(|e| format!("copy CA to {}: {}", dest.display(), e))?;
.map_err(|e| format!("copy CA to {}: {}", dest.display(), e))?;
run_refresh(store.name, store.refresh_install)?; run_refresh(store.name, store.refresh_install)?;
eprintln!(" Trusted Numa CA system-wide ({})", store.name); eprintln!(" Trusted Numa CA system-wide ({})", store.name);
@@ -1439,10 +1438,7 @@ fn untrust_ca_linux() -> Result<(), String> {
match std::fs::remove_file(&dest) { match std::fs::remove_file(&dest) {
Ok(()) => { Ok(()) => {
let _ = run_refresh(store.name, store.refresh_uninstall); let _ = run_refresh(store.name, store.refresh_uninstall);
eprintln!( eprintln!(" Removed Numa CA from system trust store ({})", store.name);
" Removed Numa CA from system trust store ({})",
store.name
);
} }
Err(e) if e.kind() == std::io::ErrorKind::NotFound => {} Err(e) if e.kind() == std::io::ErrorKind::NotFound => {}
Err(_) => {} // best-effort uninstall Err(_) => {} // best-effort uninstall