Das kleine AJAX-Bandbreitenmeter gefixt. Zeigte zu hohe Werte aufgrund eines Berechnu...
authorms <ms@ea5c0bd1-69bd-2848-81d8-4f18e57aeed8>
Mon, 4 Jun 2007 16:50:12 +0000 (16:50 +0000)
committerms <ms@ea5c0bd1-69bd-2848-81d8-4f18e57aeed8>
Mon, 4 Jun 2007 16:50:12 +0000 (16:50 +0000)
Bootsplash-Bilder entfernt.
Snort-Scripte nochmal getestet. Laedt die Updates korrekt und wird auch korrekt gestartet.
Snortctrl geschrieben, welche noch nicht aufgerufen wird.
Grub-Patch verschoben.
Clamav-Update.
CDRom-Auswurf getestet.

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

20 files changed:
config/bootsplash/config/bootsplash-1024x768.cfg [deleted file]
config/bootsplash/images/bootsplash-1024x768.jpg [deleted file]
config/bootsplash/images/silent-1024x768.jpg [deleted file]
config/rootfiles/common/misc-progs
doc/language_issues.de
doc/language_issues.en
doc/packages-list.txt
html/cgi-bin/speed.cgi
html/html/themes/ipfire/include/functions.pl
lfs/clamav
lfs/grub
src/initscripts/init.d/snort
src/install+setup/install/Makefile
src/install+setup/install/cdrom.c [deleted file]
src/install+setup/install/main.c
src/misc-progs/Makefile
src/misc-progs/restartsnort.c [deleted file]
src/misc-progs/snortctrl.c [new file with mode: 0644]
src/misc-progs/squidctrl.c
src/patches/grub-gfxmenu-v8.diff [moved from src/patches/grub-0.97/grub-gfxmenu-v8.diff with 100% similarity]

diff --git a/config/bootsplash/config/bootsplash-1024x768.cfg b/config/bootsplash/config/bootsplash-1024x768.cfg
deleted file mode 100644 (file)
index aeb4393..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-# This is the configuration file for the 1024x768 bootsplash picture.
-#
-# This file is necessary to specify the coordinates of the text box on
-# the splash screen.
-#
-# Comments are welcome by stepan@suse.de
-
-# config file version
-version=3
-
-# should the picture be displayed?
-state=1
-
-# fgcolor is the text forground color.
-# bgcolor is the text background (i.e. transparent) color.
-fgcolor=7
-bgcolor=0
-
-# (tx, ty) are the (x, y) coordinates of the text window in pixels.
-# tw/th is the width/height of the text window in pixels.
-tx=5
-ty=110
-tw=1014
-th=658
-
-# name of the picture file (full path recommended)
-jpeg=/boot/splash/images/bootsplash-1024x768.jpg
-silentjpeg=/boot/splash/images/silent-1024x768.jpg
-
-progress_enable=1
-
-# background
-box silent noover 100 700 920 730 #515151
-box silent inter  100 700 100 730 #ff0300 #fffa04 #ff0300 #fffa04
-box silent        100 700 920 730 #ff0300 #fffa04 #ff0300 #fffa04
-
-# black border
-box silent         100 699 920 699 #b5b5b5
-box silent         100 731 920 731 #b5b5b5
-box silent          99 699  99 731 #b5b5b5
-box silent         920 699 920 731 #b5b5b5
-
-overpaintok=1
diff --git a/config/bootsplash/images/bootsplash-1024x768.jpg b/config/bootsplash/images/bootsplash-1024x768.jpg
deleted file mode 100644 (file)
index 54ab11c..0000000
Binary files a/config/bootsplash/images/bootsplash-1024x768.jpg and /dev/null differ
diff --git a/config/bootsplash/images/silent-1024x768.jpg b/config/bootsplash/images/silent-1024x768.jpg
deleted file mode 100644 (file)
index 209ba2f..0000000
Binary files a/config/bootsplash/images/silent-1024x768.jpg and /dev/null differ
index 6dddeb7..009f2d4 100644 (file)
@@ -12,7 +12,7 @@ usr/local/bin/rebuildhosts
 usr/local/bin/redctrl
 usr/local/bin/monitorTraff
 #usr/local/bin/restartapplejuice
-usr/local/bin/restartsnort
+usr/local/bin/snortctrl
 usr/local/bin/restartssh
 usr/local/bin/restartsyslogd
 usr/local/bin/restartwireless
index 4efbb96..25a2b16 100644 (file)
@@ -264,6 +264,7 @@ WARNING: translation string unused: proxy no proxy local
 WARNING: translation string unused: psk
 WARNING: translation string unused: read sectors
 WARNING: translation string unused: reboot schedule
+WARNING: translation string unused: rebooting
 WARNING: translation string unused: refresh update list
 WARNING: translation string unused: released
 WARNING: translation string unused: removable device advice
@@ -284,6 +285,7 @@ WARNING: translation string unused: shaping list options
 WARNING: translation string unused: shared memory
 WARNING: translation string unused: shutdown control
 WARNING: translation string unused: shutdown2
+WARNING: translation string unused: shutting down
 WARNING: translation string unused: sitekeyfile
 WARNING: translation string unused: smbreload
 WARNING: translation string unused: squid extension methods
index 6e10c72..cff2b82 100644 (file)
@@ -273,6 +273,7 @@ WARNING: translation string unused: psk
 WARNING: translation string unused: quick control
 WARNING: translation string unused: read sectors
 WARNING: translation string unused: reboot schedule
+WARNING: translation string unused: rebooting
 WARNING: translation string unused: refresh update list
 WARNING: translation string unused: released
 WARNING: translation string unused: reportfile
@@ -292,6 +293,7 @@ WARNING: translation string unused: show areas
 WARNING: translation string unused: show lines
 WARNING: translation string unused: shutdown control
 WARNING: translation string unused: shutdown2
+WARNING: translation string unused: shutting down
 WARNING: translation string unused: sitekeyfile
 WARNING: translation string unused: smbreload
 WARNING: translation string unused: squid extension methods
index 84de4ab..e609565 100644 (file)
@@ -54,6 +54,7 @@
 * cdrtools-2.01
 * cftp-0.12
 * clamav-0.90.2
+* clamav-0.90.3
 * coreutils-5.96
 * cpio-2.6
 * cups-1.2.2
index 3436dd3..951fe84 100644 (file)
@@ -52,10 +52,10 @@ if(( $rxb_diff == $rxb_now ) && ( $txb_diff == $txb_now ))
 else
 {
        $rx_kbs = $rxb_diff / 1024;
-       $rx_kbs = $rx_kbs / 2.2;
+       $rx_kbs = $rx_kbs / 3.2;
        $rx_kbs = int($rx_kbs);
        $tx_kbs = $txb_diff / 1024;
-       $tx_kbs = $tx_kbs / 2.2;
+       $tx_kbs = $tx_kbs / 3.2;
        $tx_kbs = int($tx_kbs);
 }
 
index c83897e..5e61c3d 100644 (file)
@@ -202,7 +202,7 @@ END
                             document.forms['speed'].rxkb.value  = root2_node.firstChild.data;
                
                                        // document.getElementsByTagName("input")[0].style.color = "#00FF00";
-                                       url    = "/cgi/bin/speed.cgi?rxb_last=" + root3_node.firstChild.data + "&txb_last=" + root4_node.firstChild.data;
+                                       url    = "/cgi-bin/speed.cgi?rxb_last=" + root3_node.firstChild.data + "&txb_last=" + root4_node.firstChild.data;
                
                              window.setTimeout("LoadInetInfo(url)", 3000);
                        }
index d10bfd5..8ea1ab0 100644 (file)
@@ -26,7 +26,7 @@
 
 include Config
 
-VER        = 0.90.2
+VER        = 0.90.3
 
 THISAPP    = clamav-$(VER)
 DL_FILE    = $(THISAPP).tar.gz
@@ -44,7 +44,7 @@ objects = $(DL_FILE)
 
 $(DL_FILE) = $(DL_FROM)/$(DL_FILE)
 
-$(DL_FILE)_MD5 = 39d1f07a399b551b55096b6ec7325c33
+$(DL_FILE)_MD5 = d42ccf7a32daeb7c7cc3c8c23a7793ea
 
 install : $(TARGET)
 
index 385d7c1..01da488 100644 (file)
--- a/lfs/grub
+++ b/lfs/grub
@@ -77,7 +77,7 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
 
        # This fails, but doesn't matter
        -cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/grub-0.97-disk_geometry-1.patch
-       cd $(DIR_APP) && patch -Np0 < $(DIR_SRC)/src/patches/grub-0.97/grub-gfxmenu-v8.diff
+       cd $(DIR_APP) && patch -Np0 < $(DIR_SRC)/src/patches/grub-gfxmenu-v8.diff
 
        cd $(DIR_APP) && perl -pi -e 's,/usr/lib/grub/i386-pc,/usr/share/grub/i386-pc,' docs/grub.texi
        cd $(DIR_APP) && sed -i 's/AM_INIT_AUTOMAKE/&\nAM_PROG_AS/' configure.ac
index 7dd334c..0087cb5 100755 (executable)
@@ -55,32 +55,36 @@ DNS2=`cat /var/ipfire/red/dns2`
 if [ "$DNS2" ]; then
        echo "var DNS_SERVERS [$DNS1,$DNS2]" >> /etc/snort/vars
 else
-       echo "car DNS_SERVERS $DNS1" >> /etc/snort/vars
+       echo "var DNS_SERVERS $DNS1" >> /etc/snort/vars
 fi 
 
 case "$1" in
        start)
                for DEVICE in $DEVICES; do
                        boot_mesg "Starting Intrusion Detection System on $DEVICE..."
-                       loadproc /usr/sbin/snort -c snort.conf -i $DEVICE -D -l /var/log/snort --pid-path /var/run/snort_$DEVICE.pid
+                       /usr/sbin/snort -c /etc/snort/snort.conf -i $DEVICE -D -l /var/log/snort --pid-path /var/run/snort_$DEVICE.pid
+                       evaluate_retval
                done
                ;;
+               
        stop)
                for DEVICE in $DEVICES; do
                        boot_mesg "Stopping Intrusion Detection System on $DEVICE..."
                        killproc -p /var/run/snort_$DEVICE.pid /var/run
                done
                ;;
+               
        status)
                statusproc /usr/sbin/snort
                ;;
+               
        restart)
                $0 stop
                $0 start
                ;;
                
        *)
-               echo "Usage: $0 {start|stop|restart|status|update}"
+               echo "Usage: $0 {start|stop|restart|status}"
                exit 1
                ;;
 esac
index 5ee5b3c..6f3a66f 100644 (file)
@@ -23,8 +23,7 @@ clean :
 
 ######
 
-OBJS=main.o ide.o cdrom.o nic.o net.o config.o ../libsmooth/libsmooth.o \
-       usb.o scsi.o unattended.o
+OBJS=main.o ide.o nic.o net.o config.o ../libsmooth/libsmooth.o usb.o scsi.o unattended.o
 
 install: $(OBJS)
        $(LINK) $(OBJS) -o $@ $(LIBS)
diff --git a/src/install+setup/install/cdrom.c b/src/install+setup/install/cdrom.c
deleted file mode 100644 (file)
index fdd526f..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/* SmoothWall install program.
- *
- * This program is distributed under the terms of the GNU General Public
- * Licence.  See the file COPYING for details.
- *
- * (c) Lawrence Manning, 2001
- * CDROM menu. Get "misc" driver name etc. 
- *
- */
-
-#include "install.h"
-
-extern FILE *flog;
-extern char *mylog;
-
-extern char **ctr;
-
-/* Ejects the CDROM.  returns 0 for failure, 1 for success. */
-int ejectcdrom(char *dev)
-{
-       char command;
-       sprintf(command, "eject -r /dev/%s", dev);
-       if (mysystem(command))
-               return 0;
-       else
-               return 1;
-}
index 6460a19..e8e8371 100644 (file)
@@ -606,7 +606,8 @@ int main(int argc, char *argv[])
        mysystem("ln -s grub.conf /harddisk/boot/grub/menu.lst");
        
        mysystem("umount /cdrom");
-       ejectcdrom(sourcedrive);
+       snprintf(commandstring, STRING_SIZE, "eject /dev/%s", sourcedrive);
+       mysystem(commandstring);
 
        if (!unattended) {
                sprintf(message, ctr[TR_CONGRATULATIONS_LONG],
index b134606..25b2c7c 100644 (file)
@@ -6,7 +6,7 @@ COMPILE=$(CC) $(CFLAGS)
 PROGS = iowrap
 SUID_PROGS = setdmzholes setportfw setfilters setxtaccess \
        squidctrl restartssh ipfirereboot setaliases \
-       ipsecctrl timectrl dhcpctrl restartsnort \
+       ipsecctrl timectrl dhcpctrl snortctrl \
        monitorTraff restartapplejuice rebuildhosts \
        restartsyslogd logwatch openvpnctrl \
        restartwireless getipstat qosctrl launch-ether-wake \
@@ -100,8 +100,8 @@ restartssh: restartssh.c setuid.o ../install+setup/libsmooth/varval.o
 squidctrl: squidctrl.c setuid.o ../install+setup/libsmooth/varval.o
        $(COMPILE) -I../install+setup/libsmooth/ squidctrl.c setuid.o ../install+setup/libsmooth/varval.o -o $@
 
-restartsnort: restartsnort.c setuid.o ../install+setup/libsmooth/varval.o
-       $(COMPILE) -I../install+setup/libsmooth/ restartsnort.c setuid.o ../install+setup/libsmooth/varval.o -o $@
+snortctrl: snortctrl.c setuid.o ../install+setup/libsmooth/varval.o
+       $(COMPILE) -I../install+setup/libsmooth/ snortctrl.c setuid.o ../install+setup/libsmooth/varval.o -o $@
 
 restartsyslogd: restartsyslogd.c setuid.o ../install+setup/libsmooth/varval.o
        $(COMPILE) -I../install+setup/libsmooth/ restartsyslogd.c setuid.o ../install+setup/libsmooth/varval.o -o $@
diff --git a/src/misc-progs/restartsnort.c b/src/misc-progs/restartsnort.c
deleted file mode 100644 (file)
index 036626c..0000000
+++ /dev/null
@@ -1,326 +0,0 @@
-/* SmoothWall helper program - restartsnort\r
- *\r
- * This program is distributed under the terms of the GNU General Public\r
- * Licence.  See the file COPYING for details.\r
- *\r
- * (c) Lawrence Manning, 2001\r
- * Restarting snort.\r
- * \r
- * $Id: restartsnort.c,v 1.8.2.3 2005/10/16 12:36:14 rkerr Exp $\r
- * \r
- */\r
\r
-#include <stdio.h>\r
-#include <string.h>\r
-#include <stdlib.h>\r
-#include <unistd.h>\r
-#include <sys/types.h>\r
-#include <sys/stat.h>\r
-#include <string.h>\r
-#include <fcntl.h>\r
-#include <signal.h>\r
-#include "libsmooth.h"\r
-#include "setuid.h"\r
-\r
-struct keyvalue *kv = NULL;\r
-FILE *varsfile = NULL;\r
-\r
-void exithandler(void)\r
-{\r
-       if (varsfile)\r
-               fclose (varsfile);\r
-\r
-       if (kv)\r
-               freekeyvalues(kv);\r
-}\r
-\r
-int killsnort(char *interface)\r
-{\r
-       int fd;\r
-       char pidname[STRING_SIZE] = "";\r
-       char buffer[STRING_SIZE] = "";\r
-       int pid;\r
-\r
-       sprintf(pidname, "/var/run/snort_%s.pid", interface);\r
-\r
-       if ((fd = open(pidname, O_RDONLY)) != -1)\r
-       {\r
-               if (read(fd, buffer, STRING_SIZE - 1) == -1)\r
-                       fprintf(stderr, "Couldn't read from pid file\n");\r
-               else\r
-               {\r
-                       pid = atoi(buffer);\r
-                       if (pid <= 1)\r
-                               fprintf(stderr, "Bad pid value\n");\r
-                       else\r
-                       {\r
-                               if (kill(pid, SIGTERM) == -1)\r
-                                       fprintf(stderr, "Unable to send SIGTERM\n");\r
-                               close (fd);\r
-                               return 0;\r
-                       }\r
-               }\r
-               close(fd);\r
-       }\r
-       return 1;\r
-}\r
-\r
-int main(int argc, char *argv[])\r
-{\r
-       int fd = -1;\r
-       FILE *ifacefile, *ipfile, *dns1file, *dns2file;\r
-       char iface[STRING_SIZE] = "";\r
-       char locip[STRING_SIZE] = "";\r
-       char dns1[STRING_SIZE] = "";\r
-       char dns2[STRING_SIZE] = "";\r
-       char command[STRING_SIZE] = "";\r
-       char greendev[STRING_SIZE] = "";\r
-       char orangedev[STRING_SIZE] = "";\r
-       char bluedev[STRING_SIZE] = "";\r
-       char greenip[STRING_SIZE] = "";\r
-       char orangeip[STRING_SIZE] = "";\r
-       char blueip[STRING_SIZE] = "";\r
-       struct stat st;\r
-       int i;\r
-       int restartred = 0, restartgreen = 0, restartblue = 0, restartorange = 0;\r
-       \r
-       if (!(initsetuid()))\r
-               exit(1);\r
-       \r
-       atexit(exithandler);\r
-\r
-       for (i=0; i<argc; i++) {\r
-               if (!strcmp(argv[i], "red"))\r
-                       restartred = 1;\r
-               if (!strcmp(argv[i], "orange"))\r
-                       restartorange = 1;\r
-               if (!strcmp(argv[i], "blue"))\r
-                       restartblue = 1;\r
-               if (!strcmp(argv[i], "green"))\r
-                       restartgreen = 1;\r
-       }\r
-       \r
-       kv = initkeyvalues();\r
-       if (!(readkeyvalues(kv, CONFIG_ROOT "/ethernet/settings")))\r
-               exit(1);\r
-\r
-       if (! findkey(kv, "GREEN_DEV", greendev)) {\r
-               fprintf(stderr, "Couldn't find GREEN device\n");\r
-               exit(1);\r
-       }\r
-       if (! strlen (greendev) > 0) {\r
-               fprintf(stderr, "Couldn't find GREEN device\n");\r
-               exit(1);\r
-       }\r
-       if (!VALID_DEVICE(greendev))\r
-       {\r
-               fprintf(stderr, "Bad GREEN_DEV: %s\n", greendev);\r
-               exit(1);\r
-       }\r
-       if (!(findkey(kv, "GREEN_ADDRESS", greenip))) {\r
-               fprintf(stderr, "Couldn't find GREEN address\n");\r
-               exit(1);\r
-       }\r
-       if (!VALID_IP(greenip)) {\r
-               fprintf(stderr, "Bad GREEN_ADDRESS: %s\n", greenip);\r
-               exit(1);\r
-       }\r
-\r
-       if (findkey(kv, "ORANGE_DEV", orangedev) && strlen (orangedev) > 0) {\r
-               if (!VALID_DEVICE(orangedev))\r
-               {\r
-                       fprintf(stderr, "Bad ORANGE_DEV: %s\n", orangedev);\r
-                       exit(1);\r
-               }\r
-               if (!(findkey(kv, "ORANGE_ADDRESS", orangeip))) {\r
-                       fprintf(stderr, "Couldn't find ORANGE address\n");\r
-                       exit(1);\r
-               }\r
-               if (!VALID_IP(orangeip)) {\r
-                       fprintf(stderr, "Bad ORANGE_ADDRESS: %s\n", orangeip);\r
-                       exit(1);\r
-               }\r
-       }\r
-\r
-       if (findkey(kv, "BLUE_DEV", bluedev) && strlen (bluedev) > 0) {\r
-               if (!VALID_DEVICE(bluedev))\r
-               {\r
-                       fprintf(stderr, "Bad BLUE_DEV: %s\n", bluedev);\r
-                       exit(1);\r
-               }\r
-               if (!(findkey(kv, "BLUE_ADDRESS", blueip))) {\r
-                       fprintf(stderr, "Couldn't find BLUE address\n");\r
-                       exit(1);\r
-               }\r
-               if (!VALID_IP(blueip)) {\r
-                       fprintf(stderr, "Bad BLUE_ADDRESS: %s\n", blueip);\r
-                       exit(1);\r
-               }\r
-       }\r
-\r
-       stat(CONFIG_ROOT "/red/active", &st);\r
-\r
-       if (S_ISREG(st.st_mode)) {\r
-               if (!(ifacefile = fopen(CONFIG_ROOT "/red/iface", "r")))\r
-               {\r
-                       fprintf(stderr, "Couldn't open iface file\n");\r
-                       exit(0);\r
-               }\r
-\r
-               if (fgets(iface, STRING_SIZE, ifacefile))\r
-               {\r
-                       if (iface[strlen(iface) - 1] == '\n')\r
-                               iface[strlen(iface) - 1] = '\0';\r
-               }\r
-               fclose(ifacefile);\r
-               if (!VALID_DEVICE(iface))\r
-               {\r
-                       fprintf(stderr, "Bad iface: %s\n", iface);\r
-                       exit(0);\r
-               }\r
-\r
-               if (!(ipfile = fopen(CONFIG_ROOT "/red/local-ipaddress", "r")))\r
-               {\r
-                       fprintf(stderr, "Couldn't open local ip file\n");\r
-                       exit(0);\r
-               }\r
-               if (fgets(locip, STRING_SIZE, ipfile))\r
-               {\r
-                       if (locip[strlen(locip) - 1] == '\n')\r
-                               locip[strlen(locip) - 1] = '\0';\r
-               }\r
-               fclose (ipfile);\r
-               if (strlen(locip) && !VALID_IP(locip))\r
-               {\r
-                       fprintf(stderr, "Bad local IP: %s\n", locip);\r
-                       exit(1);\r
-               }\r
-       \r
-               if (!(dns1file = fopen(CONFIG_ROOT "/red/dns1", "r")))\r
-               {\r
-                       fprintf(stderr, "Couldn't open dns1 file\n");\r
-                       exit(0);\r
-               }\r
-               if (fgets(dns1, STRING_SIZE, dns1file))\r
-               {\r
-                       if (dns1[strlen(dns1) - 1] == '\n')\r
-                               dns1[strlen(dns1) - 1] = '\0';\r
-               }\r
-               fclose (dns1file);\r
-               if (strlen(dns1) && !VALID_IP(dns1))\r
-               {\r
-                       fprintf(stderr, "Bad DNS1 IP: %s\n", dns1);\r
-                       exit(1);\r
-               }\r
-                       \r
-               if (!(dns2file = fopen(CONFIG_ROOT "/red/dns2", "r")))\r
-               {\r
-                       fprintf(stderr, "Couldn't open dns2 file\n");\r
-                       exit(1);\r
-               }\r
-               if (fgets(dns2, STRING_SIZE, dns2file))\r
-               {\r
-                       if (dns2[strlen(dns2) - 1] == '\n')\r
-                               dns2[strlen(dns2) - 1] = '\0';\r
-               }\r
-               fclose (dns2file);\r
-               if (strlen(dns2) && !VALID_IP(dns2))\r
-               {\r
-                       fprintf(stderr, "Bad DNS2 IP: %s\n", dns2);\r
-                       exit(1);\r
-               }\r
-       }\r
-\r
-       if (restartred)\r
-               killsnort(iface);\r
-\r
-       if (restartblue)\r
-               killsnort(bluedev);\r
-       \r
-       if (restartorange)\r
-               killsnort(orangedev);\r
-\r
-       if (restartgreen)\r
-               killsnort(greendev);\r
-        \r
-       if (!(varsfile = fopen("/etc/snort/vars", "w")))\r
-       {\r
-               fprintf(stderr, "Couldn't create vars file\n");\r
-               exit(1);\r
-       }\r
-       if (strlen(blueip)) {\r
-               if (strlen(orangeip)) {\r
-                       if (strlen(locip)) {\r
-                               fprintf(varsfile, "var HOME_NET [%s,%s,%s,%s]\n", greenip, orangeip, blueip, locip);\r
-                       } else {\r
-                               fprintf(varsfile, "var HOME_NET [%s,%s,%s]\n", greenip, orangeip, blueip);\r
-                       }\r
-               } else {\r
-                       if (strlen(locip)) {\r
-                               fprintf(varsfile, "var HOME_NET [%s,%s,%s]\n", greenip, blueip, locip);\r
-                       } else {\r
-                               fprintf(varsfile, "var HOME_NET [%s,%s]\n", greenip, blueip);\r
-                       }\r
-               }\r
-       } else {\r
-               if (strlen(orangeip)) {\r
-                       if (strlen(locip)) {\r
-                               fprintf(varsfile, "var HOME_NET [%s,%s,%s]\n", greenip, orangeip, locip);\r
-                       } else {\r
-                               fprintf(varsfile, "var HOME_NET [%s,%s]\n", greenip, orangeip);\r
-                       }\r
-               } else {\r
-                       if (strlen(locip)) {\r
-                               fprintf(varsfile, "var HOME_NET [%s,%s]\n", greenip, locip);\r
-                       } else {\r
-                               fprintf(varsfile, "var HOME_NET [%s]\n", greenip);\r
-                       }\r
-               }\r
-       }\r
-       if (strlen(dns1))\r
-       {\r
-               if (strlen(dns2))\r
-                       fprintf(varsfile, "var DNS_SERVERS [%s,%s]\n", dns1, dns2);\r
-               else\r
-                       fprintf(varsfile, "var DNS_SERVERS %s\n", dns1);\r
-       } else {\r
-               fprintf(varsfile, "var DNS_SERVERS []\n");\r
-       }\r
-       fclose(varsfile);\r
-       varsfile = NULL;\r
-       \r
-       if (restartred && strlen(iface) && (fd = open(CONFIG_ROOT "/snort/enable", O_RDONLY)) != -1)\r
-       {\r
-               close(fd);\r
-               snprintf(command, STRING_SIZE -1,\r
-                       "/usr/sbin/snort -c /etc/snort/snort.conf -D -u snort -g snort -d -e -o -p -b -A fast -m 022 -i %s",\r
-                       iface);\r
-               safe_system(command);\r
-       }\r
-       if (restartblue && strlen(bluedev) && (fd = open(CONFIG_ROOT "/snort/enable_blue", O_RDONLY)) != -1 && bluedev)\r
-        {\r
-               close(fd);\r
-               snprintf(command, STRING_SIZE -1,\r
-                       "/usr/sbin/snort -c /etc/snort/snort.conf -D -u snort -g snort -d -e -o -p -b -A fast -m 022 -i %s",\r
-                       bluedev);\r
-               safe_system(command);\r
-       }\r
-       if (restartorange && strlen(orangedev) && (fd = open(CONFIG_ROOT "/snort/enable_orange", O_RDONLY)) != -1 && orangedev)\r
-       {\r
-               close(fd);\r
-               snprintf(command, STRING_SIZE -1,\r
-                       "/usr/sbin/snort -c /etc/snort/snort.conf -D -u snort -g snort -d -e -o -p -b -A fast -m 022 -i %s",\r
-                       orangedev);\r
-               safe_system(command);\r
-       }\r
-       if (restartgreen && (fd = open(CONFIG_ROOT "/snort/enable_green", O_RDONLY)) != -1)\r
-       {\r
-               close(fd);\r
-               snprintf(command, STRING_SIZE -1,\r
-                       "/usr/sbin/snort -c /etc/snort/snort.conf -D -u snort -g snort -d -e -o -p -b -A fast -m 022 -i %s",\r
-                       greendev);\r
-               safe_system(command);\r
-       }\r
-\r
-  return 0;\r
-}\r
diff --git a/src/misc-progs/snortctrl.c b/src/misc-progs/snortctrl.c
new file mode 100644 (file)
index 0000000..5702575
--- /dev/null
@@ -0,0 +1,38 @@
+/* This file is part of the IPFire Firewall.
+ *
+ * This program is distributed under the terms of the GNU General Public
+ * Licence.  See the file COPYING for details.
+ *
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <fcntl.h>
+#include "setuid.h"
+
+int main(int argc, char *argv[]) {
+
+       if (!(initsetuid()))
+               exit(1);
+
+       if (argc < 2) {
+               fprintf(stderr, "\nNo argument given.\n\nsnortctrl (start|stop|restart)\n\n");
+               exit(1);
+       }
+
+       if (strcmp(argv[1], "start") == 0) {
+               safe_system("/etc/rc.d/init.d/snort start");
+       } else if (strcmp(argv[1], "stop") == 0) {
+               safe_system("/etc/rc.d/init.d/snort stop");
+       } else if (strcmp(argv[1], "restart") == 0) {
+               safe_system("/etc/rc.d/init.d/snort restart");
+       } else {
+               fprintf(stderr, "\nBad argument given.\n\nsnortctrl (start|stop|restart)\n\n");
+               exit(1);
+       }
+
+       return 0;
+}
index 5568a18..39289b6 100644 (file)
@@ -38,7 +38,7 @@ int main(int argc, char *argv[]) {
        } else if (strcmp(argv[1], "disable") == 0) {
                safe_system("rm -f /etc/rc.d/rc*.d/*squid >/dev/null 2>&1");
        } else {
-               fprintf(stderr, "\nBad argument given.\n\nredctrl (start|stop|restart|flush)\n\n");
+               fprintf(stderr, "\nBad argument given.\n\nsquidctrl (start|stop|restart|flush)\n\n");
                exit(1);
        }