X7ROOT File Manager
Current Path:
/usr/libexec/webmin/firewalld
usr
/
libexec
/
webmin
/
firewalld
/
📁
..
📄
CHANGELOG
(201 B)
📄
bootup.cgi
(456 B)
📄
config
(46 B)
📄
config.info
(88 B)
📄
config.info.ca
(103 B)
📄
config.info.de
(100 B)
📄
config.info.fr
(121 B)
📄
config.info.no
(96 B)
📄
config.info.pl
(98 B)
📄
create_zone.cgi
(2.09 KB)
📄
default_zone.cgi
(560 B)
📄
delete_rules.cgi
(915 B)
📄
delete_zone.cgi
(1.03 KB)
📄
edit_forward.cgi
(2.55 KB)
📄
edit_port.cgi
(1.78 KB)
📄
edit_serv.cgi
(1.23 KB)
📄
firewalld-lib.pl
(13.2 KB)
📁
images
📄
index.cgi
(5.79 KB)
📄
install_check.pl
(469 B)
📁
lang
📄
list_rules.cgi
(4.84 KB)
📄
log_parser.pl
(794 B)
📄
module.info
(176 B)
📄
module.info.af
(0 B)
📄
module.info.af.auto
(116 B)
📄
module.info.ar
(0 B)
📄
module.info.ar.auto
(184 B)
📄
module.info.be
(0 B)
📄
module.info.be.auto
(177 B)
📄
module.info.bg
(0 B)
📄
module.info.bg.auto
(193 B)
📄
module.info.ca
(117 B)
📄
module.info.cs
(0 B)
📄
module.info.cs.auto
(140 B)
📄
module.info.da
(0 B)
📄
module.info.da.auto
(128 B)
📄
module.info.de
(124 B)
📄
module.info.el
(0 B)
📄
module.info.el.auto
(252 B)
📄
module.info.es
(0 B)
📄
module.info.es.auto
(131 B)
📄
module.info.eu
(0 B)
📄
module.info.eu.auto
(123 B)
📄
module.info.fa
(0 B)
📄
module.info.fa.auto
(185 B)
📄
module.info.fi
(0 B)
📄
module.info.fi.auto
(125 B)
📄
module.info.fr
(0 B)
📄
module.info.fr.auto
(134 B)
📄
module.info.he
(0 B)
📄
module.info.he.auto
(177 B)
📄
module.info.hr
(0 B)
📄
module.info.hr.auto
(125 B)
📄
module.info.hu
(0 B)
📄
module.info.hu.auto
(158 B)
📄
module.info.it
(0 B)
📄
module.info.it.auto
(128 B)
📄
module.info.ja
(0 B)
📄
module.info.ja.auto
(162 B)
📄
module.info.ko
(0 B)
📄
module.info.ko.auto
(143 B)
📄
module.info.lt
(0 B)
📄
module.info.lt.auto
(151 B)
📄
module.info.lv
(0 B)
📄
module.info.lv.auto
(131 B)
📄
module.info.ms
(0 B)
📄
module.info.ms.auto
(140 B)
📄
module.info.mt
(0 B)
📄
module.info.mt.auto
(124 B)
📄
module.info.nl
(0 B)
📄
module.info.nl.auto
(124 B)
📄
module.info.no
(0 B)
📄
module.info.no.auto
(129 B)
📄
module.info.pl
(132 B)
📄
module.info.pt
(0 B)
📄
module.info.pt.auto
(118 B)
📄
module.info.pt_BR
(0 B)
📄
module.info.pt_BR.auto
(124 B)
📄
module.info.ro
(0 B)
📄
module.info.ro.auto
(128 B)
📄
module.info.ru
(0 B)
📄
module.info.ru.auto
(185 B)
📄
module.info.sk
(0 B)
📄
module.info.sk.auto
(139 B)
📄
module.info.sl
(0 B)
📄
module.info.sl.auto
(126 B)
📄
module.info.sv
(0 B)
📄
module.info.sv.auto
(127 B)
📄
module.info.th
(0 B)
📄
module.info.th.auto
(211 B)
📄
module.info.tr
(0 B)
📄
module.info.tr.auto
(163 B)
📄
module.info.uk
(0 B)
📄
module.info.uk.auto
(181 B)
📄
module.info.ur
(0 B)
📄
module.info.ur.auto
(229 B)
📄
module.info.vi
(0 B)
📄
module.info.vi.auto
(165 B)
📄
module.info.zh
(0 B)
📄
module.info.zh.auto
(109 B)
📄
module.info.zh_TW
(0 B)
📄
module.info.zh_TW.auto
(115 B)
📄
open-ports.pl
(2.37 KB)
📄
restart.cgi
(346 B)
📄
save_forward.cgi
(1.55 KB)
📄
save_ifaces.cgi
(643 B)
📄
save_port.cgi
(1.13 KB)
📄
save_rules.cgi
(796 B)
📄
save_serv.cgi
(1.03 KB)
📄
start.cgi
(326 B)
📄
stop.cgi
(324 B)
📄
zone_form.cgi
(968 B)
Editing: open-ports.pl
#!/usr/bin/perl # Open some ports on the firewall. Exit statuses are : # 0 - Nothing needed to be done # 1 - Given ports were opened up # 2 - IPtables is not installed or supported # 3 - No firewall is active # 4 - Could not apply configuration # 5 - Bad args use strict; use warnings; no warnings 'redefine'; no warnings 'uninitialized'; our ($module_name, $no_acl_check); $no_acl_check++; $ENV{'WEBMIN_CONFIG'} = "/etc/webmin"; $ENV{'WEBMIN_VAR'} = "/var/webmin"; if ($0 =~ /^(.*\/)[^\/]+$/) { chdir($1); } require './firewalld-lib.pl'; if ($module_name ne 'firewalld') { print STDERR "Command must be run with full path\n"; exit(5); } # Parse args my $no_apply = 0; if ($ARGV[0] eq "--no-apply") { $no_apply = 1; shift(@ARGV); } if (!@ARGV) { print STDERR "Missing ports to open\n"; exit(5); } foreach my $p (@ARGV) { if ($p !~ /^\d+$/ && $p !~ /^\d+:\d+$/ && $p !~ /^\d+(,\d+)*$/) { print STDERR "Port $p must be number or start:end range\n"; exit(5); } } # Check Firewalld support if (&foreign_installed($module_name, 1) != 2) { print STDERR "Firewalld is not available\n"; exit(2); } if (!&is_firewalld_running()) { print STDERR "Firewalld is not running\n"; exit(2); } # Check if any zones are active my @azones = &list_firewalld_zones(1); if (!@azones) { print STDERR "No active FirewallD zones found\n"; exit(3); } # Get the default zone my @zones = &list_firewalld_zones(); my ($zone) = grep { $_->{'default'} } @zones; if (!$zone) { print STDERR "Default FirewallD zone not found\n"; exit(3); } my @added = ( ); foreach my $p (@ARGV) { # For each port, find existing rules $p =~ s/^(\d+):(\d+)/$1-$2/; print STDERR "Checking for port $p ..\n"; if (&indexof($p."/tcp", @{$zone->{'ports'}}) >= 0) { print STDERR ".. already allowed\n"; } else { # Need to add my $err = &create_firewalld_port($zone, $p, "tcp"); if ($err) { print STDERR ".. failed : $err\n"; } else { push(@added, $p); } } } if (@added) { # Added some ports - apply them print STDERR "Opened ports ",join(" ", @added),"\n"; my $ex = 1; if (!$no_apply) { my $err = &apply_firewalld(); if ($err) { print "Failed to apply configuration : $err\n"; $ex = 4; } else { print "Applied configuration successfully\n"; } } &webmin_log("openports", undef, undef, { 'ports' => \@added }); exit($ex); } else { print STDERR "All ports are already open\n"; exit(0); }
Upload File
Create Folder