From 73399036c388d68658c6dcb23fbccf0397a04aff Mon Sep 17 00:00:00 2001 From: Joe Abbate Date: Sun, 1 Dec 2024 21:29:16 +0000 Subject: [PATCH 1/2] Change anyhow import to fix FreeBSD --- implants/lib/eldritch/src/process/netstat_impl.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/implants/lib/eldritch/src/process/netstat_impl.rs b/implants/lib/eldritch/src/process/netstat_impl.rs index fec5a79f..71a3b6d4 100644 --- a/implants/lib/eldritch/src/process/netstat_impl.rs +++ b/implants/lib/eldritch/src/process/netstat_impl.rs @@ -1,4 +1,4 @@ -use anyhow::Result; +use anyhow::{anyhow, Result}; use starlark::values::{dict::Dict, Heap}; #[cfg(target_os = "freebsd")] @@ -68,7 +68,7 @@ mod tests { if bytes_copied > 1 { Ok(()) } else { - Err(anyhow::anyhow!("Failed to copy any bytes")) + Err(anyhow!("Failed to copy any bytes")) } } @@ -115,6 +115,6 @@ mod tests { } } } - Err(anyhow::anyhow!("Failed to find socket")) + Err(anyhow!("Failed to find socket")) } } From ba253311dde87d37fd973859c476dcaf3ff5e36a Mon Sep 17 00:00:00 2001 From: Joe Abbate Date: Sun, 1 Dec 2024 22:15:53 +0000 Subject: [PATCH 2/2] Oh im just going to change one line --- implants/lib/eldritch/src/process/netstat_impl.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/implants/lib/eldritch/src/process/netstat_impl.rs b/implants/lib/eldritch/src/process/netstat_impl.rs index 71a3b6d4..97742dff 100644 --- a/implants/lib/eldritch/src/process/netstat_impl.rs +++ b/implants/lib/eldritch/src/process/netstat_impl.rs @@ -1,9 +1,9 @@ -use anyhow::{anyhow, Result}; +use anyhow::Result; use starlark::values::{dict::Dict, Heap}; #[cfg(target_os = "freebsd")] pub fn netstat(_: &Heap) -> Result> { - Err(anyhow!("Not implemented for FreeBSD")) + Err(anyhow::anyhow!("Not implemented for FreeBSD")) } #[cfg(not(target_os = "freebsd"))] @@ -68,7 +68,7 @@ mod tests { if bytes_copied > 1 { Ok(()) } else { - Err(anyhow!("Failed to copy any bytes")) + Err(anyhow::anyhow!("Failed to copy any bytes")) } } @@ -115,6 +115,6 @@ mod tests { } } } - Err(anyhow!("Failed to find socket")) + Err(anyhow::anyhow!("Failed to find socket")) } }