Hinzugefügt:
authorms <ms@ea5c0bd1-69bd-2848-81d8-4f18e57aeed8>
Mon, 12 Jun 2006 15:00:19 +0000 (15:00 +0000)
committerms <ms@ea5c0bd1-69bd-2848-81d8-4f18e57aeed8>
Mon, 12 Jun 2006 15:00:19 +0000 (15:00 +0000)
  * IPTables ins Webinterface - Muss der Benne nochmal drüberkucken!
Geändert:
  * Blinde Datei oh323 gelöscht.
  * Kein sudo-Paket mehr, da bereits in ISO.
  * makegraphs gefixt wegen hddtemp
  * Menü im Webinterface wieder einmal bearbeitet.

git-svn-id: http://svn.ipfire.org/svn/ipfire/trunk@171 ea5c0bd1-69bd-2848-81d8-4f18e57aeed8

14 files changed:
config/cfgroot/header.pl
doc/packages-to-remove-from-ftp
html/cgi-bin/iptables.cgi [new file with mode: 0644]
langs/de/cgi-bin/de.pl
langs/en/cgi-bin/en.pl
lfs/oh323 [deleted file]
lfs/procps
lfs/sudo
make.sh
src/ROOTFILES.i386
src/misc-progs/Makefile
src/misc-progs/getipstat.c [new file with mode: 0644]
src/scripts/make-packages.sh
src/scripts/makegraphs

index cefdc31..659d41a 100644 (file)
@@ -195,9 +195,9 @@ sub genmenu {
                                 'enabled' => 1,
                                  };
     $substatus->{'70.hddtemp'} = {
-                                 'caption' => '$tr{'HDD temperature graphs'}',
+                                 'caption' => "$tr{'harddisk temperature graphs'}",
                                  'uri' => '/cgi-bin/hddgraph.cgi',
-                                 'title' => "$tr{'HDD temperature graphs'}",
+                                 'title' => "$tr{'harddisk temperature graphs'}",
                                 'enabled' => 1,
                                  };
     $substatus->{'80.connections'} = {
@@ -212,10 +212,10 @@ sub genmenu {
                                  'title' => "$tr{'sstraffic'}",
                                 'enabled' => 1,
                                  };
-    $substatus->{'99.iptfilters'} = {
-                               'caption' => $tr{'iptfilters iptable rules'},
-                               'uri' => '/cgi-bin/iptfilters.cgi',
-                               'title' => "$tr{'iptfilters iptable rules'}",
+    $substatus->{'99.iptable'} = {
+                               'caption' => $tr{'iptable rules'},
+                               'uri' => '/cgi-bin/iptables.cgi',
+                               'title' => "$tr{'iptable rules'}",
                                'enabled' => 1,
                                };
 
@@ -259,7 +259,7 @@ sub genmenu {
                                  'caption' => $tr{'aliases'},
                                  'uri' => '/cgi-bin/aliases.cgi',
                                  'title' => "$tr{'aliases'}",
-                                 'enabled' => 1,
+                                 'enabled' => 0,
                                  };
 
     my %subserviceshash = ();
@@ -451,13 +451,13 @@ sub genmenu {
                                };
 
     if (! blue_used() && ! orange_used()) {
-       $menu->{'05.firewall'}{'subMenu'}->{'04.dmz'}{'enabled'} = 0;
+       $menu->{'05.firewall'}{'subMenu'}->{'40.dmz'}{'enabled'} = 0;
     }
     if (! blue_used()) {
-       $menu->{'05.firewall'}{'subMenu'}->{'03.wireless'}{'enabled'} = 0;
+       $menu->{'05.firewall'}{'subMenu'}->{'30.wireless'}{'enabled'} = 0;
     }
     if (! $ethsettings{'CONFIG_TYPE'} =~ /^(2|3|6|7)$/ && $ethsettings{'RED_TYPE'} eq 'STATIC' ) {
-       $menu->{'03.network'}{'subMenu'}->{'04.aliases'}{'enabled'} = 0;
+       $menu->{'03.network'}{'subMenu'}->{'70.aliases'}{'enabled'} = 1;
     }
 }
 
diff --git a/html/cgi-bin/iptables.cgi b/html/cgi-bin/iptables.cgi
new file mode 100644 (file)
index 0000000..d62c84e
--- /dev/null
@@ -0,0 +1,104 @@
+#!/usr/bin/perl
+#
+# IPFire CGIs
+#
+# This code is distributed under the terms of the GPL
+#
+
+require '/var/ipfire/general-functions.pl';
+require "${General::swroot}/lang.pl";
+require "${General::swroot}/header.pl";
+
+my @iplines;
+my $lines = 0;
+my @ipmanlines;
+my $manlines = 0;
+my @ipnatlines;
+my $natlines = 0;
+
+system('/usr/local/bin/getipstat');
+
+&Header::showhttpheaders();
+&Header::openpage($Lang::tr{'ipts'}, 1, '');
+&Header::openbigbox('100%', 'LEFT');
+&Header::openbox('100%', 'LEFT', $Lang::tr{'ipts'}.':');
+print <<END
+
+    <DIV align='left'>
+    <PRE>
+END
+;
+       open (FILE, '/home/httpd/html/iptables.txt');
+       while (<FILE>)
+       {
+               $iplines[$lines] = $_;
+               $lines++;
+       }
+       close (FILE);
+       foreach $_ (@iplines) {
+               print "$_"; }
+
+print <<END
+    </PRE>
+    </DIV>
+    <BR> 
+
+END
+;
+&Header::closebox();
+
+## MANGLE
+&Header::openbox('100%', 'LEFT', $Lang::tr{'iptmangles'}.':');
+print <<END
+
+    <DIV align='left'>
+    <PRE>
+END
+;
+       open (FILEMAN, '/home/httpd/html/iptablesmangle.txt');
+       while (<FILEMAN>)
+       {
+               $ipmanlines[$manlines] = $_;
+               $manlines++;
+       }
+       close (FILEMAN);
+       foreach $_ (@ipmanlines) {
+               print "$_"; }
+
+print <<END
+    </PRE>
+    </DIV>
+    <BR> 
+
+END
+;
+&Header::closebox();
+
+## NAT
+&Header::openbox('100%', 'LEFT', $Lang::tr{'iptnats'}.':');
+print <<END
+
+    <DIV align='left'>
+    <PRE>
+END
+;
+       open (FILENAT, '/home/httpd/html/iptablesnat.txt');
+       while (<FILENAT>)
+       {
+               $ipnatlines[$natlines] = $_;
+               $natlines++;
+       }
+       close (FILENAT);
+       foreach $_ (@ipnatlines) {
+               print "$_"; }
+
+print <<END
+    </PRE>
+    </DIV>
+    <BR> 
+
+END
+;
+&Header::closebox();
+&Header::closebigbox();
+&Header::closepage();
index d0fc043..2ed318a 100644 (file)
 'harddisk temperature' => 'Festplattentemperatur',
 'harddisk temperature graphs' => 'Festplattentemperatur-Diagramme',
 'hdd temperature in' => 'Festplattentemperatur in',
+'ipts' => 'IPTables',
+'iptable rules' => 'IPTable-Regeln',
+'iptmangles' => 'IPTable Mangles',
+'iptnats' => 'IPTable Network Address Translation',
 
 ); 
 
index 4e6124d..d9e66c4 100644 (file)
 'harddisk temperature' => 'Harddisk temperature',
 'harddisk temperature graphs' => 'harddisk temperature graphs',
 'hdd temperature in' => 'Harddisk temperature in',
+'ipts' => 'IPTables',
+'iptable rules' => 'IPTable rules',
+'iptmangles' => 'IPTable Mangles',
+'iptnats' => 'IPTable Network Address Translation',
 
 );
diff --git a/lfs/oh323 b/lfs/oh323
deleted file mode 100644 (file)
index b92f78b..0000000
--- a/lfs/oh323
+++ /dev/null
@@ -1,92 +0,0 @@
-###############################################################################
-# This file is part of the IPCop Firewall.                                    #
-#                                                                             #
-# IPCop 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 2 of the License, or           #
-# (at your option) any later version.                                         #
-#                                                                             #
-# IPCop 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 IPCop; if not, write to the Free Software                        #
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA    #
-#                                                                             #
-# Makefiles are based on LFSMake, which is                                    #
-# Copyright (C) 2002 Rod Roard <rod@sunsetsystems.com>                        #
-#                                                                             #
-# Modifications by:                                                           #
-# ??-12-2003 Mark Wormgoor < mark@wormgoor.com>                               #
-#          - Modified Makefile for IPCop build                                #
-#                                                                             #
-# $Id: ntp,v 1.6.2.3 2005/02/05 15:38:15 gespinasse Exp $
-#                                                                             #
-###############################################################################
-
-###############################################################################
-# Definitions
-###############################################################################
-
-include Config
-
-VER        = 2.2.9
-
-THISAPP    = postfix-$(VER)
-DL_FILE    = $(THISAPP).tar.gz
-DL_FROM    = ftp://netmirror.org/postfix.org/official
-DIR_APP    = $(DIR_SRC)/$(THISAPP)
-TARGET     = $(DIR_INFO)/$(THISAPP)
-
-###############################################################################
-# Top-level Rules
-###############################################################################
-
-objects = $(DL_FILE)
-
-$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
-
-$(DL_FILE)_MD5 = be78631bd9b6bf7735e43abfa54d69f6
-
-install : $(TARGET)
-
-check : $(patsubst %,$(DIR_CHK)/%,$(objects))
-
-download :$(patsubst %,$(DIR_DL)/%,$(objects))
-
-md5 : $(subst %,%_MD5,$(objects))
-
-dist: 
-       make-packages.sh postfix $(THISAPP)-ipfire-beta-1
-
-###############################################################################
-# Downloading, checking, md5sum
-###############################################################################
-
-$(patsubst %,$(DIR_CHK)/%,$(objects)) :
-       @$(CHECK)
-
-$(patsubst %,$(DIR_DL)/%,$(objects)) :
-       @$(LOAD)
-
-$(subst %,%_MD5,$(objects)) :
-       @$(MD5)
-
-###############################################################################
-# Installation Details
-###############################################################################
-
-$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
-       @$(PREBUILD)
-       @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE)
-       cd $(DIR_APP) && make -f Makefile.init makefiles \
-                               'CCARGS=-DDEF_DAEMON_DIR=\"/usr/lib/postfix\" -DDEF_MANPAGE_DIR=\"/usr/share/man\" -DUSE_TLS -DUSE_SALS_AUTH -DHAS_PGSQL -I/usr/include/openssl -DHAS_MYSQL -I/opt/lampp/include/mysql -I/usr/include/sasl -I/opt/lampp/include' \
-                               'AUXLIBS=-L/usr/lib -L/opt/lampp/lib/mysql -L/opt/lampp/lib -lmysqlclient -lz -lm -lssl -lsasl2 -lcrypto -lpq'
-       cd $(DIR_APP) && make
-       cd $(DIR_APP) && sh postfix-install -non-interactive
-       cp -v /usr/src/config/etc/aliases /etc/aliases
-       cd /etc/ && postmap aliases
-       @rm -rf $(DIR_APP)
-       @$(POSTBUILD)
\ No newline at end of file
index a77d711..34751b3 100644 (file)
 # Makefiles are based on LFSMake, which is                                    #
 # Copyright (C) 2002 Rod Roard <rod@sunsetsystems.com>                        #
 #                                                                             #
-# Modifications by:                                                           #
-# ??-12-2003 Mark Wormgoor < mark@wormgoor.com>                               #
-#          - Modified Makefile for IPCop build                                #
-#                                                                             #
-# $Id: procps,v 1.4.2.4 2005/07/10 16:01:33 franck78 Exp $
-#                                                                             #
 ###############################################################################
 
 ###############################################################################
@@ -36,7 +30,7 @@ VER        = 3.2.5
 
 THISAPP    = procps-$(VER)
 DL_FILE    = $(THISAPP).tar.gz
-DL_FROM    = http://procps.sf.net
+DL_FROM    = $(URL_IPFIRE)
 DIR_APP    = $(DIR_SRC)/$(THISAPP)
 TARGET     = $(DIR_INFO)/$(THISAPP)
 
index 31fd36c..67abe6c 100644 (file)
--- a/lfs/sudo
+++ b/lfs/sudo
@@ -36,7 +36,7 @@ VER        = 1.6.8p12
 
 THISAPP    = sudo-$(VER)
 DL_FILE    = $(THISAPP).tar.gz
-DL_FROM    = http://www.courtesan.com/sudo/dist
+DL_FROM    = $(URL_IPFIRE)
 DIR_APP    = $(DIR_SRC)/$(THISAPP)
 TARGET     = $(DIR_INFO)/$(THISAPP)
 
@@ -58,9 +58,6 @@ download :$(patsubst %,$(DIR_DL)/%,$(objects))
 
 md5 : $(subst %,%_MD5,$(objects))
 
-dist: 
-       make-packages.sh sudo $(THISAPP)-ipfire-beta-1
-
 ###############################################################################
 # Downloading, checking, md5sum
 ###############################################################################
diff --git a/make.sh b/make.sh
index 8a09d7e..51bb5f9 100644 (file)
--- a/make.sh
+++ b/make.sh
@@ -335,7 +335,7 @@ ipcopmake() {
 
 ipfiredist() {
        if [ -f $BASEDIR/build/usr/src/lfs/$1 ]; then
-          if [ ! `ls -w1 $BASEDIR/packages/*.tar.gz | grep $1` ]; then
+#         if [ ! `ls -w1 $BASEDIR/packages/*.tar.gz | grep $1` ]; then
                echo "`date -u '+%b %e %T'`: Packaging $1" | tee -a $LOGFILE
                cp -f $BASEDIR/src/scripts/make-packages.sh $BASEDIR/build/usr/local/bin
                chroot $LFS /tools/bin/env -i   HOME=/root \
@@ -353,9 +353,9 @@ ipfiredist() {
                if [ $? -ne 0 ]; then
                        exiterror "Packaging $1"
                fi
-          else
-               echo "`date -u '+%b %e %T'`: Packaging: The package $1 already exists"
-          fi
+#         else
+#              echo "`date -u '+%b %e %T'`: Packaging: The package $1 already exists"
+#         fi
        else
                exiterror "No such file or directory: $BASEDIR/build/usr/src/lfs/$1"
        fi
@@ -845,14 +845,10 @@ ipfirepackages() {
   ipfiredist lame
   ipfiredist libtiff
   ipfiredist libxml2
-  ipfiredist mc
   ipfiredist ntop
   ipfiredist postfix
   ipfiredist pwlib
   ipfiredist samba
-  ipfiredist sane
-  ipfiredist spandsp
-  ipfiredist sudo
   ipfiredist xampp
   ipfiredist xinetd
   test -d $BASEDIR/packages || mkdir $BASEDIR/packages
@@ -1119,7 +1115,11 @@ diff)
        ;;
 sync)
        echo -e "Syncing Cache to FTP:"
-       echo -ne "Password for mirror.ipfire.org: "; read PASS
+       if [ -f .pass ]; then
+               PASS="`cat .pass`"
+       else
+               echo -ne "Password for mirror.ipfire.org: "; read PASS
+       fi
        rm -f doc/packages-to-remove-from-ftp
        ncftpls -u web3 -p $PASS ftp://mirror.ipfire.org/html/source-packages/source/ > ftplist
        for i in `ls -w1 cache/`; do
@@ -1143,7 +1143,11 @@ sync)
        ;;
 pub-iso)
        echo -e "Upload the ISO to the beta-mirror!"
-       echo -ne "Password for mirror.ipfire.org: "; read PASS
+       if [ -f .pass ]; then
+               PASS="`cat .pass`"
+       else
+               echo -ne "Password for mirror.ipfire.org: "; read PASS
+       fi
        ncftpls -u web3 -p $PASS ftp://mirror.ipfire.org/html/source-packages/beta/ | grep `svn info | grep Revision | cut -c 11-`
        if [ "$?" -eq "1" ]; then
                        cp $BASEDIR/ipfire-install-1.4.i386.iso $BASEDIR/ipfire-install-1.4.i386-r`svn info | grep Revision | cut -c 11-`.iso
@@ -1162,7 +1166,11 @@ pub-iso)
        ;;
 pub-paks)
        echo -e "Upload the packages to the beta-mirror!"
-       echo -ne "Password for mirror.ipfire.org: "; read PASS
+       if [ -f .pass ]; then
+               PASS="`cat .pass`"
+       else
+               echo -ne "Password for mirror.ipfire.org: "; read PASS
+       fi
        ncftpput -z -u web3 -p $PASS mirror.ipfire.org /html/source-packages/packages/ packages/*
        if [ "$?" -eq "0" ]; then
                echo -e "The packages were successfully uploaded to the ftp server."
index f3a8035..77d4a5b 100644 (file)
@@ -21010,6 +21010,7 @@ home/httpd/cgi-bin/hddgraph.cgi
 home/httpd/cgi-bin/ids.cgi
 home/httpd/cgi-bin/index.cgi
 home/httpd/cgi-bin/ipinfo.cgi
+home/httpd/cgi-bin/iptables.cgi
 home/httpd/cgi-bin/fwhits.cgi
 home/httpd/cgi-bin/ovpnfunc.pl
 home/httpd/cgi-bin/ovpnmain.cgi
@@ -22519,6 +22520,7 @@ sbin/mingetty
 ##
 ## misc-progs
 ##
+usr/local/bin/getipstat
 usr/local/bin/installfcdsl
 usr/local/bin/installpackage
 usr/local/bin/iowrap
index ce04fb1..828dafa 100644 (file)
@@ -9,7 +9,8 @@ SUID_PROGS = setdmzholes setportfw setfilters setxtaccess restartdhcp restartsno
        ipfirebkcfg ipfirerscfg installpackage installfcdsl ipsecctrl \
        setaliases ipfirebackup restartntpd \
        restartapplejuice setdate rebuildhosts \
-       restartsyslogd logwatch openvpnctrl timecheckctrl restartwireless
+       restartsyslogd logwatch openvpnctrl timecheckctrl \
+       restartwireless getipstat
 
 install : all
        install -m 755  $(PROGS) /usr/local/bin
@@ -80,5 +81,8 @@ ipsecctrl: ipsecctrl.c setuid.o ../install+setup/libsmooth/varval.o
 timecheckctrl: timecheckctrl.c setuid.o ../install+setup/libsmooth/varval.o
        $(COMPILE) -I../install+setup/libsmooth/ timecheckctrl.c setuid.o ../install+setup/libsmooth/varval.o -o $@
 
+getipstat: getipstat.c setuid.o ../install+setup/libsmooth/varval.o
+       $(COMPILE) -I../install+setup/libsmooth/ getipstat.c setuid.o ../install+setup/libsmooth/varval.o -o $@
+
 ipfirebackup: ipfirebackup.c setuid.o 
        $(COMPILE) -lcrypt ipfirebackup.c setuid.o -o $@
diff --git a/src/misc-progs/getipstat.c b/src/misc-progs/getipstat.c
new file mode 100644 (file)
index 0000000..808eec8
--- /dev/null
@@ -0,0 +1,27 @@
+/* IPFire helper program - IPStat
+ *
+ * Get the list from IPTABLES -L
+ * 
+ */
+         
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <fcntl.h>
+#include "setuid.h"
+
+
+int main(void)
+{
+       if (!(initsetuid()))
+               exit(1);
+       
+       safe_system("/sbin/iptables -L -v -n > /home/httpd/html/iptables.txt");
+       safe_system("/sbin/iptables -L -v -n -t nat > /home/httpd/html/iptablesnat.txt");
+       safe_system("/sbin/iptables -t mangle -L -v -n > /home/httpd/html/iptablesmangle.txt");
+       
+       return 0;
+}
+
index 0cdc292..e4b6847 100755 (executable)
@@ -26,7 +26,7 @@ cd /paks/$1/ROOT && tar cvfz /paks/$1/files.tgz *
 cd /paks/$1/CONF && tar cvfz /paks/$1/conf.tgz *
 
 cd /paks/$1 && tar cvfz ../$2.tar.gz files.tgz conf.tgz install.sh uninstall.sh
-cd .. && md5sum $2.tar.gz >> $2.tar.gz.md5
+cd .. && md5sum $2.tar.gz > $2.tar.gz.md5
 
 rm -fr /paks/$1
 
index 8cd4de0..67bacd4 100644 (file)
@@ -56,6 +56,7 @@ my $rrdlog = "/var/log/rrd";
 my $graphs = "/home/httpd/html/graphs";
 $ENV{PATH}="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin";
 my $hdd_device = "/dev/harddisk";
+my $temp = '';
 
 sub gettraffic {
        my $interface = $_[0];