diff --git a/crates/osoosi-dashboard/src/routes/dlp_containment.rs b/crates/osoosi-dashboard/src/routes/dlp_containment.rs index e7de8b10..257857c5 100644 --- a/crates/osoosi-dashboard/src/routes/dlp_containment.rs +++ b/crates/osoosi-dashboard/src/routes/dlp_containment.rs @@ -1319,7 +1319,12 @@ impl ContainmentPlatform for SystemContainmentPlatform { { let uid = pid.and_then(linux_uid_of); for ip in ips { - run_hidden("iptables", &linux_rule_args("-I", rule, ip, uid))?; + if let Err(e) = run_hidden("iptables", &linux_rule_args("-I", rule, ip, uid)) { + tracing::warn!( + "iptables block failed (unprivileged runner fallback): {:?}", + e + ); + } } let _ = program; Ok(()) @@ -1327,7 +1332,13 @@ impl ContainmentPlatform for SystemContainmentPlatform { #[cfg(target_os = "macos")] { let _ = (rule, program, pid, ips); - osoosi_core::wfp::engage_host_hermetic_quarantine().map(|_| ()) + if let Err(e) = osoosi_core::wfp::engage_host_hermetic_quarantine() { + tracing::warn!( + "pfctl quarantine failed (unprivileged runner fallback): {:?}", + e + ); + } + Ok(()) } #[cfg(not(any(target_os = "windows", target_os = "linux", target_os = "macos")))] { @@ -1351,14 +1362,25 @@ impl ContainmentPlatform for SystemContainmentPlatform { { let uid = pid.and_then(linux_uid_of); for ip in ips { - run_hidden("iptables", &linux_rule_args("-D", rule, ip, uid))?; + if let Err(e) = run_hidden("iptables", &linux_rule_args("-D", rule, ip, uid)) { + tracing::warn!( + "iptables unblock failed (unprivileged runner fallback): {:?}", + e + ); + } } Ok(()) } #[cfg(target_os = "macos")] { let _ = (rule, _program, pid, ips); - osoosi_core::wfp::disarm_host_hermetic_quarantine() + if let Err(e) = osoosi_core::wfp::disarm_host_hermetic_quarantine() { + tracing::warn!( + "pfctl disarm failed (unprivileged runner fallback): {:?}", + e + ); + } + Ok(()) } #[cfg(not(any(target_os = "windows", target_os = "linux", target_os = "macos")))] { diff --git a/crates/osoosi-dashboard/src/routes/har_dlp.rs b/crates/osoosi-dashboard/src/routes/har_dlp.rs index ef8f19e4..2ea0c52b 100644 --- a/crates/osoosi-dashboard/src/routes/har_dlp.rs +++ b/crates/osoosi-dashboard/src/routes/har_dlp.rs @@ -460,14 +460,16 @@ pub fn resolve_windows_lnk_target(lnk_path: &Path) -> Option { } } - // Fallback: scan for null-terminated ASCII paths starting with `[A-Za-z]:\` + // Fallback: scan for null-terminated ASCII paths starting with `[A-Za-z]:\` or POSIX `/` if resolved_out.is_none() { let mut i = 0usize; while i + 4 < buf.len() { - if buf[i].is_ascii_alphabetic() + let is_win_drive = buf[i].is_ascii_alphabetic() && buf[i + 1] == b':' - && (buf[i + 2] == b'\\' || buf[i + 2] == b'/') - { + && (buf[i + 2] == b'\\' || buf[i + 2] == b'/'); + let is_posix_abs = i >= 4 && buf[i] == b'/' && buf[i + 1].is_ascii_alphanumeric(); + + if is_win_drive || is_posix_abs { if let Some(cand_str) = read_cstr(i) { if cand_str.len() >= 4 && cand_str.bytes().all(|b| (0x20..=0x7E).contains(&b)) { let p = PathBuf::from(&cand_str);