version 1.2, 2010/03/25 01:28:34
|
version 1.4, 2010/12/30 18:40:19
|
Line 57 print "In lciptables\n" unless $noprint;
|
Line 57 print "In lciptables\n" unless $noprint;
|
|
|
# ----------------------------- Make sure this process is running from user=www |
# ----------------------------- Make sure this process is running from user=www |
my $wwwid=getpwnam('www'); |
my $wwwid=getpwnam('www'); |
&DisableRoot; |
|
if ($wwwid!=$>) { |
if ($wwwid!=$<) { |
print("User ID mismatch. This program must be run as user 'www'\n") |
print("User ID mismatch. This program must be run as user 'www'\n") |
unless $noprint; |
unless $noprint; |
&Exit(1); |
&Exit(1); |
} |
} |
|
|
# ----------------------------------- Retrieve IP addreses for hosts in cluster |
# ----------------------------------- Retrieve IP addreses for hosts in cluster |
&DisableRoot; |
|
|
|
my %iphost; |
my %iphost; |
if (@ARGV != 1) { |
if (@ARGV != 1) { |
Line 97 unless (&try_to_lock("/tmp/lock_lciptabl
|
Line 97 unless (&try_to_lock("/tmp/lock_lciptabl
|
|
|
my $lond_port = &LONCAPA::Firewall::get_lond_port(); |
my $lond_port = &LONCAPA::Firewall::get_lond_port(); |
|
|
($>,$<)=($wwwid,0); |
|
&EnableRoot(); |
&EnableRoot(); |
|
|
my @fw_chains = &LONCAPA::Firewall::get_fw_chains(); |
my @fw_chains = &LONCAPA::Firewall::get_fw_chains(); |
my $iptables = &LONCAPA::Firewall::get_pathto_iptables(); |
my $iptables = &LONCAPA::Firewall::get_pathto_iptables(); |
my $firewall_result = |
my $firewall_result = |
&LONCAPA::Firewall::firewall_close_port($iptables,\@fw_chains,$lond_port,[$lond_port]); |
&LONCAPA::Firewall::firewall_close_port($iptables,\@fw_chains,$lond_port,\%iphost,[$lond_port]); |
if ($firewall_result) { |
if ($firewall_result) { |
print "$firewall_result\n"; |
print "$firewall_result\n"; |
} |
} |