version 1.23, 2021/12/20 03:13:29
|
version 1.26, 2024/04/24 21:34:44
|
Line 365 sub firewall_is_active {
|
Line 365 sub firewall_is_active {
|
} |
} |
close(PIPE); |
close(PIPE); |
} |
} |
|
unless ($status) { |
|
if (open(PIPE,'nft list tables |')) { |
|
while(<PIPE>) { |
|
chomp(); |
|
if (/filter$/) { |
|
$status = 1; |
|
last; |
|
} |
|
} |
|
close(PIPE); |
|
} |
|
} |
} |
} |
unless ($status) { |
unless ($status) { |
$status = &uses_firewalld(); |
$status = &uses_firewalld(); |
Line 655 sub get_fw_chains {
|
Line 667 sub get_fw_chains {
|
my $ubuntu_config = "/etc/ufw/ufw.conf"; |
my $ubuntu_config = "/etc/ufw/ufw.conf"; |
my $firewalld = &uses_firewalld($distro); |
my $firewalld = &uses_firewalld($distro); |
if ($firewalld) { |
if ($firewalld) { |
my ($dist,$version) = ($distro =~ /^([\D]+)(\d+)$/); |
my ($dist,$version) = ($distro =~ /^([\D]+)(\d+)(?:|\-stream)$/); |
if (((($dist eq 'rhes') || ($dist eq 'centos') || ($dist eq 'rocky') || ($dist eq 'alma')) && |
if (((($dist eq 'rhes') || ($dist eq 'centos') || ($dist eq 'rocky') || ($dist eq 'alma')) && |
($version >= 8)) || (($dist eq 'oracle') && ($version >= 7))) { |
($version >= 8)) || (($dist eq 'oracle') && ($version >= 7))) { |
push(@fw_chains,'INPUT'); |
push(@fw_chains,'INPUT'); |
Line 676 sub get_fw_chains {
|
Line 688 sub get_fw_chains {
|
} else { |
} else { |
if ($distro =~ /^(debian|ubuntu|suse|sles)/) { |
if ($distro =~ /^(debian|ubuntu|suse|sles)/) { |
@posschains = ('INPUT'); |
@posschains = ('INPUT'); |
} elsif ($distro =~ /^(fedora|rhes|centos|scientific|oracle|rocky|alma)(\d+)$/) { |
} elsif ($distro =~ /^(fedora|rhes|centos|scientific|oracle|rocky|alma)(\d+)(?:|\-stream)$/) { |
if ((($1 eq 'fedora') && ($2 > 15)) || (($1 ne 'fedora') && ($2 >= 7))) { |
if ((($1 eq 'fedora') && ($2 > 15)) || (($1 ne 'fedora') && ($2 >= 7))) { |
@posschains = ('INPUT'); |
@posschains = ('INPUT'); |
} else { |
} else { |
Line 689 sub get_fw_chains {
|
Line 701 sub get_fw_chains {
|
print("Unable to find iptables file containing static definitions.\n"); |
print("Unable to find iptables file containing static definitions.\n"); |
} |
} |
} |
} |
if ($distro =~ /^(fedora|rhes|centos|scientific|oracle|rocky|alma)(\d+)$/) { |
if ($distro =~ /^(fedora|rhes|centos|scientific|oracle|rocky|alma)(\d+)(?:|\-stream)$/) { |
unless ((($1 eq 'fedora') && ($2 > 15)) || (($1 ne 'fedora') && ($2 >= 7))) { |
unless ((($1 eq 'fedora') && ($2 > 15)) || (($1 ne 'fedora') && ($2 >= 7))) { |
push(@fw_chains,'RH-Firewall-1-INPUT'); |
push(@fw_chains,'RH-Firewall-1-INPUT'); |
} |
} |