Skip to content

Commit 400a99f

Browse files
author
vsilent
committed
context.to_string()
1 parent 1c30685 commit 400a99f

3 files changed

Lines changed: 8 additions & 2 deletions

File tree

src/firewall/iptables.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ impl IptablesBackend {
4949
let output = Command::new("iptables")
5050
.args(args)
5151
.output()
52-
.context(context)?;
52+
.context(context.to_string())?;
5353

5454
if !output.status.success() {
5555
anyhow::bail!("{}", String::from_utf8_lossy(&output.stderr).trim());

src/firewall/nftables.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,10 @@ pub struct NfTablesBackend {
7070

7171
impl NfTablesBackend {
7272
fn run_nft(&self, args: &[&str], context: &str) -> Result<()> {
73-
let output = Command::new("nft").args(args).output().context(context)?;
73+
let output = Command::new("nft")
74+
.args(args)
75+
.output()
76+
.context(context.to_string())?;
7477

7578
if !output.status.success() {
7679
anyhow::bail!("{}", String::from_utf8_lossy(&output.stderr).trim());

src/ip_ban/engine.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ use anyhow::Result;
1010
use chrono::{Duration, Utc};
1111
use uuid::Uuid;
1212

13+
#[cfg(target_os = "linux")]
14+
use crate::firewall::backend::FirewallBackend;
15+
1316
#[derive(Debug, Clone)]
1417
pub struct OffenseInput {
1518
pub ip_address: String,

0 commit comments

Comments
 (0)