mirror of
https://github.com/webmin/webmin.git
synced 2025-07-21 23:40:34 +00:00
all files unified, all are smylinks now
This commit is contained in:
@ -1,25 +1,26 @@
|
||||
# gentoo-linux-lib.pl
|
||||
# Deal with gentoo's IPtables save file
|
||||
# Deal with gentoo's iptables save file
|
||||
|
||||
# check_iptables()
|
||||
# Returns an error message if something is wrong with iptables on this system
|
||||
sub check_iptables
|
||||
{
|
||||
if (!-r "/etc/init.d/iptables") {
|
||||
return &text('gentoo_escript', "<tt>/etc/init.d/iptables</tt>");
|
||||
if (!-r "/etc/init.d/ip${ipvx}tables") {
|
||||
return &text('gentoo_escript', "<tt>/etc/init.d/ip${ipvx}tables</tt>");
|
||||
}
|
||||
return undef;
|
||||
}
|
||||
|
||||
local %iptconf;
|
||||
&read_env_file("/etc/conf.d/iptables", \%iptconf);
|
||||
$iptables_save_file = $iptconf{'IPTABLES_SAVE'};
|
||||
&read_env_file("/etc/conf.d/ip${ipvx}tables", \%iptconf);
|
||||
$ip6tables_save_file = $iptconf{'ip6tables_SAVE'};
|
||||
$iptables_save_file = $iptconf{'iptables_SAVE'};
|
||||
|
||||
# apply_iptables()
|
||||
# Applies the current iptables configuration from the save file
|
||||
sub apply_iptables
|
||||
{
|
||||
local $out = &backquote_logged("cd / ; /etc/init.d/iptables reload 2>&1");
|
||||
local $out = &backquote_logged("cd / ; /etc/init.d/ip${ipvx}tables reload 2>&1");
|
||||
return $? ? "<pre>$out</pre>" : undef;
|
||||
}
|
||||
|
||||
|
@ -5,14 +5,14 @@
|
||||
# Returns an error message if something is wrong with iptables on this system
|
||||
sub check_iptables
|
||||
{
|
||||
if (!-r "/usr/libexec/iptables.init") {
|
||||
return &text("The iptabes service", "<tt>/usr/libexec/iptables.init</tt>");
|
||||
if (!-r "/usr/libexec/ip${ipvx}tables.init") {
|
||||
return &text("The iptabes service", "<tt>/usr/libexec/ip${ipvx}tables.init</tt>");
|
||||
}
|
||||
if (!$config{'done_check_iptables'}) {
|
||||
local $out = `/usr/libexec/iptables.init status 2>&1`;
|
||||
local $out = `/usr/libexec/ip${ipvx}tables.init status 2>&1`;
|
||||
if ($out !~ /table:|INPUT|FORWARD|OUTPUT/) {
|
||||
return &text('redhat_eoutput',
|
||||
"<tt>/usr/libexec/iptables.init status</tt>");
|
||||
"<tt>/usr/libexec/ip${ipvx}tables.init status</tt>");
|
||||
}
|
||||
$config{'done_check_iptables'} = 1;
|
||||
&save_module_config();
|
||||
@ -20,6 +20,7 @@ if (!$config{'done_check_iptables'}) {
|
||||
return undef;
|
||||
}
|
||||
|
||||
$ip6tables_save_file = "/etc/sysconfig/ip6tables";
|
||||
$iptables_save_file = "/etc/sysconfig/iptables";
|
||||
|
||||
# apply_iptables()
|
||||
@ -35,7 +36,7 @@ $iptables_save_file = "/etc/sysconfig/iptables";
|
||||
# Writes the current iptables configuration to the save file
|
||||
sub unapply_iptables
|
||||
{
|
||||
$out = &backquote_logged("cd / ; /usr/libexec/iptables.init save 2>&1 </dev/null");
|
||||
$out = &backquote_logged("cd / ; /usr/libexec/ip${ipvx}tables.init save 2>&1 </dev/null");
|
||||
$out =~ s/\033[^m]+m//g;
|
||||
return $? || $out =~ /FAILED/ ? "<pre>$out</pre>" : undef;
|
||||
}
|
||||
@ -44,19 +45,19 @@ return $? || $out =~ /FAILED/ ? "<pre>$out</pre>" : undef;
|
||||
sub started_at_boot
|
||||
{
|
||||
&foreign_require("init", "init-lib.pl");
|
||||
return &init::action_status("iptables") == 2;
|
||||
return &init::action_status("ip${ipvx}tables") == 2;
|
||||
}
|
||||
|
||||
sub enable_at_boot
|
||||
{
|
||||
&foreign_require("init", "init-lib.pl");
|
||||
&init::enable_at_boot("iptables"); # Assumes init script exists
|
||||
&init::enable_at_boot("ip${ipvx}tables"); # Assumes init script exists
|
||||
}
|
||||
|
||||
sub disable_at_boot
|
||||
{
|
||||
&foreign_require("init", "init-lib.pl");
|
||||
&init::disable_at_boot("iptables");
|
||||
&init::disable_at_boot("ip${ipvx}tables");
|
||||
}
|
||||
|
||||
1;
|
||||
|
@ -2,14 +2,14 @@
|
||||
# Deal with redhat's /etc/sysconfig/iptables save file and startup script
|
||||
|
||||
&foreign_require("init", "init-lib.pl");
|
||||
$init_script = "$init::config{'init_dir'}/iptables";
|
||||
$init_script = "$init::config{'init_dir'}/ip${ipvx}tables";
|
||||
|
||||
# check_iptables()
|
||||
# Returns an error message if something is wrong with iptables on this system
|
||||
sub check_iptables
|
||||
{
|
||||
&foreign_require("init");
|
||||
&init::action_status("iptables") > 0 || return $text{'redhat_einstalled'};
|
||||
&init::action_status("ip${ipvx}tables") > 0 || return $text{'redhat_einstalled'};
|
||||
return undef if ($gconfig{'os_type'} eq 'trustix-linux');
|
||||
return undef if ($gconfig{'os_type'} eq 'redhat-linux' &&
|
||||
$gconfig{'os_version'} > 10);
|
||||
@ -25,6 +25,7 @@ if (!$config{'done_check_iptables'} && -r $init_script) {
|
||||
return undef;
|
||||
}
|
||||
|
||||
$ip6tables_save_file = "/etc/sysconfig/ip6tables";
|
||||
$iptables_save_file = "/etc/sysconfig/iptables";
|
||||
|
||||
# apply_iptables()
|
||||
@ -37,7 +38,7 @@ if (-r $init_script) {
|
||||
return $? || $out =~ /FAILED/ ? "<pre>$out</pre>" : undef;
|
||||
}
|
||||
else {
|
||||
local $out = &backquote_logged("cd ; service iptables restart 2>&1");
|
||||
local $out = &backquote_logged("cd ; service ip${ipvx}tables restart 2>&1");
|
||||
return $? || $out =~ /FAILED/ ? "<pre>$out</pre>" : undef;
|
||||
}
|
||||
}
|
||||
@ -63,17 +64,17 @@ else {
|
||||
# started_at_boot()
|
||||
sub started_at_boot
|
||||
{
|
||||
return &init::action_status("iptables") == 2;
|
||||
return &init::action_status("ip${ipvx}tables") == 2;
|
||||
}
|
||||
|
||||
sub enable_at_boot
|
||||
{
|
||||
&init::enable_at_boot("iptables"); # Assumes init script exists
|
||||
&init::enable_at_boot("ip${ipvx}tables"); # Assumes init script exists
|
||||
}
|
||||
|
||||
sub disable_at_boot
|
||||
{
|
||||
&init::disable_at_boot("iptables");
|
||||
&init::disable_at_boot("ip${ipvx}tables");
|
||||
}
|
||||
|
||||
1;
|
||||
|
@ -1,27 +0,0 @@
|
||||
# gentoo-linux-lib.pl
|
||||
# Deal with gentoo's ip6tables save file
|
||||
|
||||
# check_ip6tables()
|
||||
# Returns an error message if something is wrong with ip6tables on this system
|
||||
sub check_ip6tables
|
||||
{
|
||||
if (!-r "/etc/init.d/ip6tables") {
|
||||
return &text('gentoo_escript', "<tt>/etc/init.d/ip6tables</tt>");
|
||||
}
|
||||
return undef;
|
||||
}
|
||||
|
||||
local %iptconf;
|
||||
&read_env_file("/etc/conf.d/ip6tables", \%iptconf);
|
||||
$ip6tables_save_file = $iptconf{'ip6tables_SAVE'};
|
||||
|
||||
# apply_ip6tables()
|
||||
# Applies the current ip6tables configuration from the save file
|
||||
sub apply_ip6tables
|
||||
{
|
||||
local $out = &backquote_logged("cd / ; /etc/init.d/ip6tables reload 2>&1");
|
||||
return $? ? "<pre>$out</pre>" : undef;
|
||||
}
|
||||
|
||||
1;
|
||||
|
1
firewall6/gentoo-linux-lib.pl
Symbolic link
1
firewall6/gentoo-linux-lib.pl
Symbolic link
@ -0,0 +1 @@
|
||||
../firewall/gentoo-linux-lib.pl
|
@ -1,63 +0,0 @@
|
||||
# mandriva-linux-lib.pl
|
||||
# Deal with Mandriva's /etc/sysconfig/ip6tables save file and startup script
|
||||
|
||||
# check_ip6tables()
|
||||
# Returns an error message if something is wrong with ip6tables on this system
|
||||
sub check_ip6tables
|
||||
{
|
||||
if (!-r "/usr/libexec/ip6tables.init") {
|
||||
return &text("The iptabes service", "<tt>/usr/libexec/ip6tables.init</tt>");
|
||||
}
|
||||
if (!$config{'done_check_ip6tables'}) {
|
||||
local $out = `/usr/libexec/ip6tables.init status 2>&1`;
|
||||
if ($out !~ /table:|INPUT|FORWARD|OUTPUT/) {
|
||||
return &text('redhat_eoutput',
|
||||
"<tt>/usr/libexec/ip6tables.init status</tt>");
|
||||
}
|
||||
$config{'done_check_ip6tables'} = 1;
|
||||
&save_module_config();
|
||||
}
|
||||
return undef;
|
||||
}
|
||||
|
||||
$ip6tables_save_file = "/etc/sysconfig/ip6tables";
|
||||
|
||||
# apply_ip6tables()
|
||||
# Applies the current ip6tables configuration from the save file
|
||||
#sub apply_ip6tables
|
||||
#{
|
||||
#local $out = &backquote_logged("cd / ; /etc/rc.d/init.d/ip6tables restart 2>&1");
|
||||
#$out =~ s/\033[^m]+m//g;
|
||||
#return $? || $out =~ /FAILED/ ? "<pre>$out</pre>" : undef;
|
||||
#}
|
||||
|
||||
# unapply_ip6tables()
|
||||
# Writes the current ip6tables configuration to the save file
|
||||
sub unapply_ip6tables
|
||||
{
|
||||
$out = &backquote_logged("cd / ; /usr/libexec/ip6tables.init save 2>&1 </dev/null");
|
||||
$out =~ s/\033[^m]+m//g;
|
||||
return $? || $out =~ /FAILED/ ? "<pre>$out</pre>" : undef;
|
||||
}
|
||||
|
||||
# started_at_boot()
|
||||
sub started_at_boot
|
||||
{
|
||||
&foreign_require("init", "init-lib.pl");
|
||||
return &init::action_status("ip6tables") == 2;
|
||||
}
|
||||
|
||||
sub enable_at_boot
|
||||
{
|
||||
&foreign_require("init", "init-lib.pl");
|
||||
&init::enable_at_boot("ip6tables"); # Assumes init script exists
|
||||
}
|
||||
|
||||
sub disable_at_boot
|
||||
{
|
||||
&foreign_require("init", "init-lib.pl");
|
||||
&init::disable_at_boot("ip6tables");
|
||||
}
|
||||
|
||||
1;
|
||||
|
1
firewall6/mandrake-linux-lib.pl
Symbolic link
1
firewall6/mandrake-linux-lib.pl
Symbolic link
@ -0,0 +1 @@
|
||||
../firewall/mandrake-linux-lib.pl
|
@ -1,80 +0,0 @@
|
||||
# redhat-linux-lib.pl
|
||||
# Deal with redhat's /etc/sysconfig/ip6tables save file and startup script
|
||||
|
||||
&foreign_require("init", "init-lib.pl");
|
||||
$init_script = "$init::config{'init_dir'}/ip6tables";
|
||||
|
||||
# check_ip6tables()
|
||||
# Returns an error message if something is wrong with ip6tables on this system
|
||||
sub check_ip6tables
|
||||
{
|
||||
&foreign_require("init");
|
||||
&init::action_status("ip6tables") > 0 || return $text{'redhat_einstalled'};
|
||||
return undef if ($gconfig{'os_type'} eq 'trustix-linux');
|
||||
return undef if ($gconfig{'os_type'} eq 'redhat-linux' &&
|
||||
$gconfig{'os_version'} > 10);
|
||||
if (!$config{'done_check_ip6tables'} && -r $init_script) {
|
||||
local $out = &backquote_command("$init_script status 2>&1");
|
||||
if ($out !~ /table:|INPUT|FORWARD|OUTPUT|is\s+stopped|firewall\s+stopped/) {
|
||||
return &text('redhat_eoutput',
|
||||
"<tt>$init_script status</tt>");
|
||||
}
|
||||
$config{'done_check_ip6tables'} = 1;
|
||||
&save_module_config();
|
||||
}
|
||||
return undef;
|
||||
}
|
||||
|
||||
$ip6tables_save_file = "/etc/sysconfig/ip6tables";
|
||||
|
||||
# apply_ip6tables()
|
||||
# Applies the current ip6tables configuration from the save file
|
||||
sub apply_ip6tables
|
||||
{
|
||||
if (-r $init_script) {
|
||||
local $out = &backquote_logged("cd / ; $init_script restart 2>&1");
|
||||
$out =~ s/\033[^m]+m//g;
|
||||
return $? || $out =~ /FAILED/ ? "<pre>$out</pre>" : undef;
|
||||
}
|
||||
else {
|
||||
local $out = &backquote_logged("cd ; service ip6tables restart 2>&1");
|
||||
return $? || $out =~ /FAILED/ ? "<pre>$out</pre>" : undef;
|
||||
}
|
||||
}
|
||||
|
||||
# unapply_ip6tables()
|
||||
# Writes the current ip6tables configuration to the save file
|
||||
sub unapply_ip6tables
|
||||
{
|
||||
if (-r $init_script) {
|
||||
$out = &backquote_logged("cd / ; $init_script save 2>&1 </dev/null");
|
||||
$out =~ s/\033[^m]+m//g;
|
||||
if ($? && $out =~ /usage/i) {
|
||||
# 'save' argument not supported .. call ip6tables-save manually
|
||||
return &ip6tables_save();
|
||||
}
|
||||
return $? || $out =~ /FAILED/ ? "<pre>$out</pre>" : undef;
|
||||
}
|
||||
else {
|
||||
return &ip6tables_save();
|
||||
}
|
||||
}
|
||||
|
||||
# started_at_boot()
|
||||
sub started_at_boot
|
||||
{
|
||||
return &init::action_status("ip6tables") == 2;
|
||||
}
|
||||
|
||||
sub enable_at_boot
|
||||
{
|
||||
&init::enable_at_boot("ip6tables"); # Assumes init script exists
|
||||
}
|
||||
|
||||
sub disable_at_boot
|
||||
{
|
||||
&init::disable_at_boot("ip6tables");
|
||||
}
|
||||
|
||||
1;
|
||||
|
1
firewall6/redhat-linux-lib.pl
Symbolic link
1
firewall6/redhat-linux-lib.pl
Symbolic link
@ -0,0 +1 @@
|
||||
../firewall/redhat-linux-lib.pl
|
@ -1,80 +0,0 @@
|
||||
# redhat-linux-lib.pl
|
||||
# Deal with redhat's /etc/sysconfig/ip6tables save file and startup script
|
||||
|
||||
&foreign_require("init", "init-lib.pl");
|
||||
$init_script = "$init::config{'init_dir'}/ip6tables";
|
||||
|
||||
# check_ip6tables()
|
||||
# Returns an error message if something is wrong with ip6tables on this system
|
||||
sub check_ip6tables
|
||||
{
|
||||
&foreign_require("init");
|
||||
&init::action_status("ip6tables") > 0 || return $text{'redhat_einstalled'};
|
||||
return undef if ($gconfig{'os_type'} eq 'trustix-linux');
|
||||
return undef if ($gconfig{'os_type'} eq 'redhat-linux' &&
|
||||
$gconfig{'os_version'} > 10);
|
||||
if (!$config{'done_check_ip6tables'} && -r $init_script) {
|
||||
local $out = &backquote_command("$init_script status 2>&1");
|
||||
if ($out !~ /table:|INPUT|FORWARD|OUTPUT|is\s+stopped|firewall\s+stopped/) {
|
||||
return &text('redhat_eoutput',
|
||||
"<tt>$init_script status</tt>");
|
||||
}
|
||||
$config{'done_check_ip6tables'} = 1;
|
||||
&save_module_config();
|
||||
}
|
||||
return undef;
|
||||
}
|
||||
|
||||
$ip6tables_save_file = "/etc/sysconfig/ip6tables";
|
||||
|
||||
# apply_ip6tables()
|
||||
# Applies the current ip6tables configuration from the save file
|
||||
sub apply_ip6tables
|
||||
{
|
||||
if (-r $init_script) {
|
||||
local $out = &backquote_logged("cd / ; $init_script restart 2>&1");
|
||||
$out =~ s/\033[^m]+m//g;
|
||||
return $? || $out =~ /FAILED/ ? "<pre>$out</pre>" : undef;
|
||||
}
|
||||
else {
|
||||
local $out = &backquote_logged("cd ; service ip6tables restart 2>&1");
|
||||
return $? || $out =~ /FAILED/ ? "<pre>$out</pre>" : undef;
|
||||
}
|
||||
}
|
||||
|
||||
# unapply_ip6tables()
|
||||
# Writes the current ip6tables configuration to the save file
|
||||
sub unapply_ip6tables
|
||||
{
|
||||
if (-r $init_script) {
|
||||
$out = &backquote_logged("cd / ; $init_script save 2>&1 </dev/null");
|
||||
$out =~ s/\033[^m]+m//g;
|
||||
if ($? && $out =~ /usage/i) {
|
||||
# 'save' argument not supported .. call ip6tables-save manually
|
||||
return &ip6tables_save();
|
||||
}
|
||||
return $? || $out =~ /FAILED/ ? "<pre>$out</pre>" : undef;
|
||||
}
|
||||
else {
|
||||
return &ip6tables_save();
|
||||
}
|
||||
}
|
||||
|
||||
# started_at_boot()
|
||||
sub started_at_boot
|
||||
{
|
||||
return &init::action_status("ip6tables") == 2;
|
||||
}
|
||||
|
||||
sub enable_at_boot
|
||||
{
|
||||
&init::enable_at_boot("ip6tables"); # Assumes init script exists
|
||||
}
|
||||
|
||||
sub disable_at_boot
|
||||
{
|
||||
&init::disable_at_boot("ip6tables");
|
||||
}
|
||||
|
||||
1;
|
||||
|
1
firewall6/trustix-linux-lib.pl
Symbolic link
1
firewall6/trustix-linux-lib.pl
Symbolic link
@ -0,0 +1 @@
|
||||
../firewall/trustix-linux-lib.pl
|
Reference in New Issue
Block a user