| Server IP : 104.21.25.180 / Your IP : 162.159.115.42 Web Server : Apache/2.4.37 System : Linux almalinux.duckdns.org 4.18.0-553.111.1.el8_10.x86_64 #1 SMP Sun Mar 8 20:06:07 EDT 2026 x86_64 User : ricodeal ( 1046) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/libexec/webmin/firewall6/ |
Upload File : |
#!/usr/bin/perl
# newchain.cgi
# Create a new user-defined chain
require './firewall-lib.pl';
&ReadParse();
if (&get_ipvx_version() == 6) {
require './firewall6-lib.pl';
}
else {
require './firewall4-lib.pl';
}
$access{'newchain'} || &error($text{'new_ecannot'});
@tables = &get_iptables_save();
$table = $tables[$in{'table'}];
&can_edit_table($table->{'name'}) || &error($text{'etable'});
&error_setup($text{'new_err'});
&lock_file($ipvx_save);
$in{'chain'} =~ /^\S+$/ || &error($text{'new_ename'});
$table->{'defaults'}->{$in{'chain'}} && &error($text{'new_etaken'});
$table->{'defaults'}->{$in{'chain'}} = '-';
&run_before_command();
&save_table($table);
&run_after_command();
©_to_cluster();
&unlock_file($ipvx_save);
&webmin_log("create", "chain", undef, { 'chain' => $in{'chain'},
'table' => $table->{'name'} });
&redirect("index.cgi?version=${ipvx_arg}&table=$in{'table'}");