From dc21519f683d5bb0f7e5a9dfcfb4806afb895217 Mon Sep 17 00:00:00 2001 From: Alexander Marx Date: Tue, 13 Aug 2013 12:44:01 +0200 Subject: [PATCH] Forward Firewall: added GPL header to all files --- config/forwardfw/convert-dmz | 40 +++++++++++++++++++-------- config/forwardfw/convert-outgoingfw | 42 +++++++++++++++++++--------- config/forwardfw/convert-portfw | 43 +++++++++++++++++++---------- config/forwardfw/convert-xtaccess | 26 +++++++++++++++++ config/forwardfw/firewall-lib.pl | 5 ++-- config/forwardfw/firewall-policy | 23 +++++++++++++++ config/forwardfw/rules.pl | 9 ++---- html/cgi-bin/forwardfw.cgi | 5 ++-- html/cgi-bin/fwhosts.cgi | 6 ++-- html/cgi-bin/optionsfw.cgi | 3 ++ html/cgi-bin/p2p-block.cgi | 13 ++------- 11 files changed, 151 insertions(+), 64 deletions(-) diff --git a/config/forwardfw/convert-dmz b/config/forwardfw/convert-dmz index 6ba054e63..3d9136425 100755 --- a/config/forwardfw/convert-dmz +++ b/config/forwardfw/convert-dmz @@ -1,17 +1,33 @@ #!/usr/bin/perl -######################################################################## -# Script: convert-dmz -# Date: 03.04.2013 -# Author: Alexander Marx (amarx@ipfire.org) -######################################################################## -# -# This script converts old dmz holes rules from old Firewall -# to the new one. This is a 2-step process. -# STEP1: read old config and normalize settings -# STEP2: check valid ip and save valid rules to new firewall -# -######################################################################## +############################################################################### +# # +# IPFire.org - A linux based firewall # +# Copyright (C) 2013 # +# # +# This program is free software: you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation, either version 3 of the License, or # +# (at your option) any later version. # +# # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with this program. If not, see . # +# # +############################################################################### +# Author: Alexander Marx (amarx@ipfire.org) # +############################################################################### +# # +# This script converts old dmz holes rules from old firewall # +# to the new one. This is a 2-step process. # +# STEP1: read old config and normalize settings # +# STEP2: check valid ip and save valid rules to new firewall # +# # +############################################################################### my @current=(); my @alias=(); my %configdmz=(); diff --git a/config/forwardfw/convert-outgoingfw b/config/forwardfw/convert-outgoingfw index 05bf13dad..c9077a871 100755 --- a/config/forwardfw/convert-outgoingfw +++ b/config/forwardfw/convert-outgoingfw @@ -1,17 +1,33 @@ #!/usr/bin/perl -######################################################################## -# Script: convert-outgoingfw -# Date: 21.03.2013 -# Author: Alexander Marx (amarx@ipfire.org) -######################################################################## -# -# This script converts old groups and firewallrules -# to the new one. This is a 3-step process. -# STEP1: convert groups ->LOG /var/log/converters -# STEP2: convert rules ->LOG /var/log/converters -# STEP3: convert P2P rules -# -######################################################################## +############################################################################### +# # +# IPFire.org - A linux based firewall # +# Copyright (C) 2013 # +# # +# This program is free software: you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation, either version 3 of the License, or # +# (at your option) any later version. # +# # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with this program. If not, see . # +# # +############################################################################### +# Author: Alexander Marx (amarx@ipfire.org) # +############################################################################### +# # +# This script converts old groups and firewallrules # +# to the new one. This is a 3-step process. # +# STEP1: convert groups ->LOG /var/log/converters # +# STEP2: convert rules ->LOG /var/log/converters # +# STEP3: convert P2P rules # +# # +############################################################################### require '/var/ipfire/general-functions.pl'; diff --git a/config/forwardfw/convert-portfw b/config/forwardfw/convert-portfw index 691cfb429..e741c3d8d 100755 --- a/config/forwardfw/convert-portfw +++ b/config/forwardfw/convert-portfw @@ -1,18 +1,33 @@ #!/usr/bin/perl - -######################################################################## -# Script: convert-portfw -# Date: 21.03.2013 -# Author: Alexander Marx (amarx@ipfire.org) -######################################################################## -# -# This script converts old portforwarding rules from old Firewall -# to the new one. This is a 3-step process. -# STEP1: read old config and normalize settings -# STEP2: create new rules from old ones -# STEP3: check if rule already exists, when not, put it into -# /var/ipfire/forward/nat -######################################################################## +############################################################################### +# # +# IPFire.org - A linux based firewall # +# Copyright (C) 2013 # +# # +# This program is free software: you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation, either version 3 of the License, or # +# (at your option) any later version. # +# # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with this program. If not, see . # +# # +############################################################################### +# Author: Alexander Marx (amarx@ipfire.org) # +############################################################################### +# # +# This script converts old portforwarding rules from old Firewall # +# to the new one. This is a 3-step process. # +# STEP1: read old config and normalize settings # +# STEP2: create new rules from old ones # +# STEP3: check if rule already exists, when not, put it into # +# /var/ipfire/forward/nat # +############################################################################### require '/var/ipfire/general-functions.pl'; my @values=(); my @built_rules=(); diff --git a/config/forwardfw/convert-xtaccess b/config/forwardfw/convert-xtaccess index 8c3bb56a0..23fb226c6 100755 --- a/config/forwardfw/convert-xtaccess +++ b/config/forwardfw/convert-xtaccess @@ -1,4 +1,30 @@ #!/usr/bin/perl +############################################################################### +# # +# IPFire.org - A linux based firewall # +# Copyright (C) 2013 # +# # +# This program is free software: you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation, either version 3 of the License, or # +# (at your option) any later version. # +# # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with this program. If not, see . # +# # +############################################################################### +# Author: Alexander Marx (amarx@ipfire.org) # +############################################################################### +# # +#This script converts old xtaccess rules to new firewall # +#Logfiles are created under /var/log/converters # +# # +############################################################################### my @current=(); my @alias=(); my %configinputfw=(); diff --git a/config/forwardfw/firewall-lib.pl b/config/forwardfw/firewall-lib.pl index a1f96ba40..e616d7efa 100755 --- a/config/forwardfw/firewall-lib.pl +++ b/config/forwardfw/firewall-lib.pl @@ -2,7 +2,7 @@ ############################################################################### # # # IPFire.org - A linux based firewall # -# Copyright (C) 2012 # +# Copyright (C) 2013 # # # # This program is free software: you can redistribute it and/or modify # # it under the terms of the GNU General Public License as published by # @@ -18,7 +18,8 @@ # along with this program. If not, see . # # # ############################################################################### - +# Author: Alexander Marx (amarx@ipfire.org) # +############################################################################### use strict; no warnings 'uninitialized'; diff --git a/config/forwardfw/firewall-policy b/config/forwardfw/firewall-policy index e142f2d3f..f6c88e4af 100755 --- a/config/forwardfw/firewall-policy +++ b/config/forwardfw/firewall-policy @@ -1,5 +1,28 @@ #!/bin/sh +############################################################################### +# # +# IPFire.org - A linux based firewall # +# Copyright (C) 2013 # +# # +# This program is free software: you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation, either version 3 of the License, or # +# (at your option) any later version. # +# # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with this program. If not, see . # +# # +############################################################################### +# Author: Alexander Marx (amarx@ipfire.org) # +############################################################################### + + eval $(/usr/local/bin/readhash /var/ipfire/forward/settings) eval $(/usr/local/bin/readhash /var/ipfire/optionsfw/settings) eval $(/usr/local/bin/readhash /var/ipfire/ethernet/settings) diff --git a/config/forwardfw/rules.pl b/config/forwardfw/rules.pl index 07f3abd1e..e3592701c 100755 --- a/config/forwardfw/rules.pl +++ b/config/forwardfw/rules.pl @@ -2,7 +2,7 @@ ############################################################################### # # # IPFire.org - A linux based firewall # -# Copyright (C) 2012 # +# Copyright (C) 2013 # # # # This program is free software: you can redistribute it and/or modify # # it under the terms of the GNU General Public License as published by # @@ -18,10 +18,7 @@ # along with this program. If not, see . # # # ############################################################################### -# # -# Hi folks! I hope this code is useful for all. I needed something to handle # -# my VPN Connections in a comfortable way. # -# This script builds firewallrules from the webinterface # +# Author: Alexander Marx (amarx@ipfire.org) # ############################################################################### use strict; @@ -89,7 +86,7 @@ close(CONN1); ################################ # DEBUG/TEST # ################################ -my $MODE=1; # 0 - normal operation +my $MODE=0; # 0 - normal operation # 1 - print configline and rules to console # ################################ diff --git a/html/cgi-bin/forwardfw.cgi b/html/cgi-bin/forwardfw.cgi index bd8cea8ed..88e16086f 100755 --- a/html/cgi-bin/forwardfw.cgi +++ b/html/cgi-bin/forwardfw.cgi @@ -2,7 +2,7 @@ ############################################################################### # # # IPFire.org - A linux based firewall # -# Copyright (C) 2012 # +# Copyright (C) 2013 # # # # This program is free software: you can redistribute it and/or modify # # it under the terms of the GNU General Public License as published by # @@ -18,7 +18,8 @@ # along with this program. If not, see . # # # ############################################################################### - +# Author: Alexander Marx (amarx@ipfire.org) # +############################################################################### use strict; use Sort::Naturally; diff --git a/html/cgi-bin/fwhosts.cgi b/html/cgi-bin/fwhosts.cgi index 879e6b83c..fffa9353e 100755 --- a/html/cgi-bin/fwhosts.cgi +++ b/html/cgi-bin/fwhosts.cgi @@ -2,7 +2,7 @@ ############################################################################### # # # IPFire.org - A linux based firewall # -# Copyright (C) 2011 IPFire Team # +# Copyright (C) 2013 # # # # This program is free software: you can redistribute it and/or modify # # it under the terms of the GNU General Public License as published by # @@ -18,9 +18,7 @@ # along with this program. If not, see . # # # ############################################################################### -# New function for forwarding firewall. To make it comfortable to create # -# rules, we need "spelling names" for single Hosts. If you have any questions # -# # +# Author: Alexander Marx (amarx@ipfire.org) # ############################################################################### use strict; diff --git a/html/cgi-bin/optionsfw.cgi b/html/cgi-bin/optionsfw.cgi index 73a2f59a6..7d34feab0 100644 --- a/html/cgi-bin/optionsfw.cgi +++ b/html/cgi-bin/optionsfw.cgi @@ -11,6 +11,9 @@ # $Id: optionsfw.cgi,v 1.1.2.10 2005/10/03 00:34:10 gespinasse Exp $ # # +######################################################################## +# Modifications for new Firewall (C) 2013 by amarx@ipfire.org +######################################################################## # enable only the following on debugging purpose #use warnings; diff --git a/html/cgi-bin/p2p-block.cgi b/html/cgi-bin/p2p-block.cgi index 9d248a133..79417502b 100755 --- a/html/cgi-bin/p2p-block.cgi +++ b/html/cgi-bin/p2p-block.cgi @@ -2,7 +2,7 @@ ############################################################################### # # # IPFire.org - A linux based firewall # -# Copyright (C) 2012 # +# Copyright (C) 2013 # # # # This program is free software: you can redistribute it and/or modify # # it under the terms of the GNU General Public License as published by # @@ -18,16 +18,7 @@ # along with this program. If not, see . # # # ############################################################################### -# # -# Hi folks! I hope this code is useful for all. I needed something to handle # -# my VPN Connections in a comfortable way. As a prerequisite i needed # -# something that makes sure the vpn roadwarrior are able to have a fixed # -# ip-address. So i developed the ccd extension for the vpn server. # -# # -# Now that the ccd extension is ready i am able to develop the main request. # -# Any feedback is appreciated. # -# # -#Copymaster # +# Author: Alexander Marx (Amarx@ipfire.org) # ############################################################################### use strict; -- 2.39.2