Skip to content

Commit

Permalink
minor firewall-cmd fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mrash committed Feb 21, 2015
1 parent c3da666 commit ef279f5
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions t/basic_tests.pl
Expand Up @@ -100,7 +100,7 @@ ()
$ipt_opts{'ipt_rules_file'} = $rules_file;
if ($skip_ipt_exec_check == $SKIP_IPT_EXEC_CHECK) {
$ipt_opts{'iptables'} = $dummy_path;
$ipt_opts{'firewall-cmd'} = $dummy_path;
$ipt_opts{'firewall-cmd'} = $dummy_path if $use_fw_cmd;
$ipt_opts{'skip_ipt_exec_check'} = $skip_ipt_exec_check;
}
} else {
Expand Down Expand Up @@ -364,17 +364,21 @@ ()
$opts_cp{'iptables'} = $iptables_bin;

if ($use_fw_cmd) {
$cmd =~ s/^$dummy_path/$fw_cmd_bin/;
$cmd =~ s|^$dummy_path|$fw_cmd_bin|;
} else {
if ($ipt_obj->{'use_ipv6'}) {
%opts_cp = %ipt6_opts;
$opts_cp{'iptables'} = $ip6tables_bin;
$cmd =~ s/^$dummy_path/$ip6tables_bin/;
$cmd =~ s|^$dummy_path|$ip6tables_bin|;
} else {
$cmd =~ s/^$dummy_path/$iptables_bin/;
$cmd =~ s|^$dummy_path|$iptables_bin|;
}
}
$opts_cp{'firewall-cmd'} = $fw_cmd_bin if $use_fw_cmd;
if ($use_fw_cmd) {
$opts_cp{'firewall-cmd'} = $fw_cmd_bin;
} else {
$opts_cp{'firewall-cmd'} = '';
}
$opts_cp{'skip_ipt_exec_check'} = 0;

my $obj = IPTables::Parse->new(%opts_cp);
Expand Down

0 comments on commit ef279f5

Please sign in to comment.