mirror of
https://github.com/webmin/webmin.git
synced 2026-05-04 22:30:33 +01:00
Completed Webmin command to open up ports
https://www.virtualmin.com/node/18624
This commit is contained in:
@@ -36,3 +36,5 @@ Added a button to rename an existing custom chain.
|
||||
---- Changes since 1.510 ----
|
||||
Better handle the case where a rule has a --comment format description, but # format comments are enabled.
|
||||
Added support for physdev module options, for matching based on the bridged interface.
|
||||
---- Changes since 1.550 ----
|
||||
Added the open-ports.pl command which can be run from the shell to open ports on the firewall.
|
||||
|
||||
@@ -69,11 +69,13 @@ PORT: foreach $p (@ARGV) {
|
||||
if ($r->{'chain'} eq 'INPUT' &&
|
||||
$r->{'j'} && $r->{'j'}->[1] eq 'ACCEPT' &&
|
||||
$r->{'p'} && $r->{'p'}->[0] eq '' &&
|
||||
$r->{'p'}->[1] eq 'tcp') {
|
||||
$r->{'p'}->[1] eq 'tcp') {
|
||||
# Found tcp rule .. check ports
|
||||
@rports = ( );
|
||||
$rrange = undef;
|
||||
if ($r->{'dports'} && $r->{'dports'}->[0] eq '') {
|
||||
push(@rports, split(/,/, $r->{'dports'}->[1]));
|
||||
$rrange = $r->{'dports'}->[1];
|
||||
}
|
||||
if ($r->{'dport'} && $r->{'dport'}->[0] eq '') {
|
||||
($s, $e) = split(":", $r->{'dport'}->[1]);
|
||||
@@ -83,8 +85,10 @@ PORT: foreach $p (@ARGV) {
|
||||
elsif ($s) {
|
||||
push(@rports, $s);
|
||||
}
|
||||
$rrange = $r->{'dport'}->[1];
|
||||
}
|
||||
if (&indexof($p, @rports) >= 0) {
|
||||
if (&indexof($p, @rports) >= 0 ||
|
||||
$p eq $rrange) {
|
||||
print STDERR ".. already allowed\n";
|
||||
next PORT;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user