version 1.8, 2011/02/25 19:41:59
|
version 1.9, 2011/04/26 03:43:17
|
Line 369 sub get_lond_port {
|
Line 369 sub get_lond_port {
|
|
|
sub get_fw_chains { |
sub get_fw_chains { |
my ($iptables) = @_; |
my ($iptables) = @_; |
|
my $perlvarref=&LONCAPA::Configuration::read_conf(); |
|
my $distro; |
|
if (ref($perlvarref) eq 'HASH') { |
|
my $path = $perlvarref->{'lonDaemons'}; |
|
if ($path) { |
|
if (open(PIPE,"$path/distprobe|")) { |
|
$distro = <PIPE>; |
|
close(PIPE); |
|
} |
|
} |
|
} |
my @fw_chains; |
my @fw_chains; |
my $suse_config = "/etc/sysconfig/SuSEfirewall2"; |
my $suse_config = "/etc/sysconfig/SuSEfirewall2"; |
my $ubuntu_config = "/etc/ufw/ufw.conf"; |
my $ubuntu_config = "/etc/ufw/ufw.conf"; |
Line 379 sub get_fw_chains {
|
Line 390 sub get_fw_chains {
|
if (-e $ubuntu_config) { |
if (-e $ubuntu_config) { |
@posschains = ('ufw-user-input','INPUT'); |
@posschains = ('ufw-user-input','INPUT'); |
} else { |
} else { |
@posschains = ('RH-Firewall-1-INPUT','INPUT'); |
if ($distro =~ /^(debian|ubuntu|suse|sles)/) { |
|
@posschains = ('INPUT'); |
|
} else { |
|
@posschains = ('RH-Firewall-1-INPUT','INPUT'); |
|
} |
if (!-e '/etc/sysconfig/iptables') { |
if (!-e '/etc/sysconfig/iptables') { |
if (!-e '/var/lib/iptables') { |
if (!-e '/var/lib/iptables') { |
print("Unable to find iptables file containing static definitions\n"); |
unless ($distro =~ /^(debian|ubuntu)/) { |
|
print("Unable to find iptables file containing static definitions\n"); |
|
} |
|
} |
|
if ($distro =~ /^(fedora|rhes|centos|scientific)/) { |
|
push(@fw_chains,'RH-Firewall-1-INPUT'); |
} |
} |
push(@fw_chains,'RH-Firewall-1-INPUT'); |
|
} |
} |
} |
} |
if ($iptables eq '') { |
if ($iptables eq '') { |