File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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( ) ) ;
Original file line number Diff line number Diff line change @@ -70,7 +70,10 @@ pub struct NfTablesBackend {
7070
7171impl 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( ) ) ;
Original file line number Diff line number Diff line change @@ -10,6 +10,9 @@ use anyhow::Result;
1010use chrono:: { Duration , Utc } ;
1111use uuid:: Uuid ;
1212
13+ #[ cfg( target_os = "linux" ) ]
14+ use crate :: firewall:: backend:: FirewallBackend ;
15+
1316#[ derive( Debug , Clone ) ]
1417pub struct OffenseInput {
1518 pub ip_address : String ,
You can’t perform that action at this time.
0 commit comments