mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-28 11:43:25 +02:00
Clamav-Update
Hardwareinformationen fuer Kudzu hinzugefuegt. dhcpctrl-Datei erstellt. git-svn-id: http://svn.ipfire.org/svn/ipfire/trunk@540 ea5c0bd1-69bd-2848-81d8-4f18e57aeed8
This commit is contained in:
2
config/rootfiles/common/hwdata
Normal file
2
config/rootfiles/common/hwdata
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
usr/share/hwdata/usb.ids
|
||||||
|
usr/share/hwdata/pci.ids
|
||||||
@@ -9,6 +9,7 @@ etc/rc.d/init.d/checkfs
|
|||||||
etc/rc.d/init.d/cleanfs
|
etc/rc.d/init.d/cleanfs
|
||||||
etc/rc.d/init.d/connectioncheck
|
etc/rc.d/init.d/connectioncheck
|
||||||
etc/rc.d/init.d/console
|
etc/rc.d/init.d/console
|
||||||
|
etc/rc.d/init.d/dhcp
|
||||||
etc/rc.d/init.d/fcron
|
etc/rc.d/init.d/fcron
|
||||||
etc/rc.d/init.d/firewall
|
etc/rc.d/init.d/firewall
|
||||||
etc/rc.d/init.d/functions
|
etc/rc.d/init.d/functions
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
usr/local/bin/dhcpctrl
|
||||||
usr/local/bin/extrahdctrl
|
usr/local/bin/extrahdctrl
|
||||||
usr/local/bin/getipstat
|
usr/local/bin/getipstat
|
||||||
#usr/local/bin/iowrap
|
#usr/local/bin/iowrap
|
||||||
@@ -10,7 +11,6 @@ usr/local/bin/qosctrl
|
|||||||
usr/local/bin/rebuildhosts
|
usr/local/bin/rebuildhosts
|
||||||
usr/local/bin/redctrl
|
usr/local/bin/redctrl
|
||||||
usr/local/bin/restartapplejuice
|
usr/local/bin/restartapplejuice
|
||||||
usr/local/bin/restartdhcp
|
|
||||||
usr/local/bin/restartntpd
|
usr/local/bin/restartntpd
|
||||||
usr/local/bin/restartsnort
|
usr/local/bin/restartsnort
|
||||||
usr/local/bin/restartssh
|
usr/local/bin/restartssh
|
||||||
|
|||||||
@@ -1224,7 +1224,7 @@ sub buildconf {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
close FILE;
|
close FILE;
|
||||||
system '/usr/local/bin/restartdhcp';
|
system '/usr/local/bin/dhcpctrl restart >/dev/null 2>&1';
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
|
|
||||||
include Config
|
include Config
|
||||||
|
|
||||||
VER = 0.90
|
VER = 0.90.2
|
||||||
|
|
||||||
THISAPP = clamav-$(VER)
|
THISAPP = clamav-$(VER)
|
||||||
DL_FILE = $(THISAPP).tar.gz
|
DL_FILE = $(THISAPP).tar.gz
|
||||||
@@ -44,7 +44,7 @@ objects = $(DL_FILE)
|
|||||||
|
|
||||||
$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
|
$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
|
||||||
|
|
||||||
$(DL_FILE)_MD5 = f04372e49c3c5ff3bd94bbe1fef2eaca
|
$(DL_FILE)_MD5 = 39d1f07a399b551b55096b6ec7325c33
|
||||||
|
|
||||||
install : $(TARGET)
|
install : $(TARGET)
|
||||||
|
|
||||||
@@ -80,7 +80,7 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
|
|||||||
cd $(DIR_APP) && ./configure --prefix=/usr --sysconfdir=/var/ipfire/clamav
|
cd $(DIR_APP) && ./configure --prefix=/usr --sysconfdir=/var/ipfire/clamav
|
||||||
cd $(DIR_APP) && make $(MAKETUNING)
|
cd $(DIR_APP) && make $(MAKETUNING)
|
||||||
cd $(DIR_APP) && make install
|
cd $(DIR_APP) && make install
|
||||||
chown clamav.clamav /usr/share/clamav -R
|
chown clamav.clamav -R /usr/share/clamav/
|
||||||
cp -rf $(DIR_SRC)/config/clamav/* /var/ipfire/clamav/
|
cp -rf $(DIR_SRC)/config/clamav/* /var/ipfire/clamav/
|
||||||
@rm -rf $(DIR_APP)
|
@rm -rf $(DIR_APP)
|
||||||
@$(POSTBUILD)
|
@$(POSTBUILD)
|
||||||
|
|||||||
57
src/initscripts/init.d/dhcp
Normal file
57
src/initscripts/init.d/dhcp
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# Begin $rc_base/init.d/dhcp
|
||||||
|
|
||||||
|
# Based on sysklogd script from LFS-3.1 and earlier.
|
||||||
|
# Rewritten by Gerard Beekmans - gerard@linuxfromscratch.org
|
||||||
|
# Modified for IPFire by Michael Tremer - mitch@ipfire.org
|
||||||
|
|
||||||
|
. /etc/sysconfig/rc
|
||||||
|
. $rc_functions
|
||||||
|
eval $(/usr/local/bin/readhash /var/ipfire/ethernet/settings)
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
start)
|
||||||
|
iptables -F DHCPBLUEINPUT
|
||||||
|
if [ -e /var/ipfire/dhcp/enable_green ]; then
|
||||||
|
devices="${GREEN_DEV}"
|
||||||
|
fi
|
||||||
|
if [ -e /var/ipfire/dhcp/enable_blue ]; then
|
||||||
|
devices=+" ${BLUE_DEV}"
|
||||||
|
|
||||||
|
iptables -A DHCPBLUEINPUT -p tcp --source-port 68 --destination-port 67 -i ${BLUE_DEV} -j ACCEPT > /dev/null 2>&1
|
||||||
|
iptables -A DHCPBLUEINPUT -p udp --source-port 68 --destination-port 67 -i ${BLUE_DEV} -j ACCEPT > /dev/null 2>&1
|
||||||
|
fi
|
||||||
|
|
||||||
|
boot_mesg "Starting DHCP Server..."
|
||||||
|
loadproc /usr/sbin/dhcpd -q ${devices}
|
||||||
|
|
||||||
|
chmod 644 /var/run/dhcpd.pid # Fix because silly dhcpd creates its pid with mode 640
|
||||||
|
;;
|
||||||
|
|
||||||
|
stop)
|
||||||
|
boot_mesg "Stopping DHCP Server..."
|
||||||
|
killproc /usr/sbin/dhcpd
|
||||||
|
;;
|
||||||
|
|
||||||
|
reload)
|
||||||
|
boot_mesg "Reloading DHCP Server..."
|
||||||
|
reloadproc /usr/sbin/dhcpd
|
||||||
|
;;
|
||||||
|
|
||||||
|
restart)
|
||||||
|
$0 stop
|
||||||
|
sleep 1
|
||||||
|
$0 start
|
||||||
|
;;
|
||||||
|
|
||||||
|
status)
|
||||||
|
statusproc /usr/sbin/dhcpd
|
||||||
|
;;
|
||||||
|
|
||||||
|
*)
|
||||||
|
echo "Usage: $0 {start|stop|reload|restart|status}"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# End $rc_base/init.d/dhcp
|
||||||
@@ -6,7 +6,7 @@ COMPILE=$(CC) $(CFLAGS)
|
|||||||
PROGS = iowrap
|
PROGS = iowrap
|
||||||
SUID_PROGS = setdmzholes setportfw setfilters setxtaccess \
|
SUID_PROGS = setdmzholes setportfw setfilters setxtaccess \
|
||||||
squidctrl restartssh ipfirereboot setaliases \
|
squidctrl restartssh ipfirereboot setaliases \
|
||||||
ipsecctrl restartntpd restartdhcp restartsnort \
|
ipsecctrl restartntpd dhcpctrl restartsnort \
|
||||||
restartapplejuice rebuildhosts \
|
restartapplejuice rebuildhosts \
|
||||||
restartsyslogd logwatch openvpnctrl timecheckctrl \
|
restartsyslogd logwatch openvpnctrl timecheckctrl \
|
||||||
restartwireless getipstat qosctrl launch-ether-wake \
|
restartwireless getipstat qosctrl launch-ether-wake \
|
||||||
@@ -85,8 +85,8 @@ rebuildhosts: rebuildhosts.c setuid.o ../install+setup/libsmooth/varval.o
|
|||||||
restartapplejuice: restartapplejuice.c setuid.o ../install+setup/libsmooth/varval.o
|
restartapplejuice: restartapplejuice.c setuid.o ../install+setup/libsmooth/varval.o
|
||||||
$(COMPILE) -I../install+setup/libsmooth/ restartapplejuice.c setuid.o ../install+setup/libsmooth/varval.o -o $@
|
$(COMPILE) -I../install+setup/libsmooth/ restartapplejuice.c setuid.o ../install+setup/libsmooth/varval.o -o $@
|
||||||
|
|
||||||
restartdhcp: restartdhcp.c setuid.o ../install+setup/libsmooth/varval.o
|
dhcpctrl: dhcpctrl.c setuid.o ../install+setup/libsmooth/varval.o
|
||||||
$(COMPILE) -I../install+setup/libsmooth/ restartdhcp.c setuid.o ../install+setup/libsmooth/varval.o -o $@
|
$(COMPILE) -I../install+setup/libsmooth/ dhcpctrl.c setuid.o ../install+setup/libsmooth/varval.o -o $@
|
||||||
|
|
||||||
restartssh: restartssh.c setuid.o ../install+setup/libsmooth/varval.o
|
restartssh: restartssh.c setuid.o ../install+setup/libsmooth/varval.o
|
||||||
$(COMPILE) -I../install+setup/libsmooth/ restartssh.c setuid.o ../install+setup/libsmooth/varval.o -o $@
|
$(COMPILE) -I../install+setup/libsmooth/ restartssh.c setuid.o ../install+setup/libsmooth/varval.o -o $@
|
||||||
|
|||||||
46
src/misc-progs/dhcpctrl.c
Normal file
46
src/misc-progs/dhcpctrl.c
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
/* 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\ndhcpctrl (start|stop|restart|reload)\n\n");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (strcmp(argv[1], "start") == 0) {
|
||||||
|
safe_system("/etc/rc.d/init.d/dhcp start");
|
||||||
|
} else if (strcmp(argv[1], "stop") == 0) {
|
||||||
|
safe_system("/etc/rc.d/init.d/dhcp stop");
|
||||||
|
} else if (strcmp(argv[1], "restart") == 0) {
|
||||||
|
safe_system("/etc/rc.d/init.d/dhcp restart");
|
||||||
|
} else if (strcmp(argv[1], "reload") == 0) {
|
||||||
|
safe_system("/etc/rc.d/init.d/dhcp reload");
|
||||||
|
} else if (strcmp(argv[1], "enable") == 0) {
|
||||||
|
safe_system("ln -fs ../init.d/dhcp /etc/rc.d/rc3.d/S30dhcp >/dev/null 2>&1");
|
||||||
|
safe_system("ln -fs ../init.d/dhcp /etc/rc.d/rc0.d/K30dhcp >/dev/null 2>&1");
|
||||||
|
safe_system("ln -fs ../init.d/dhcp /etc/rc.d/rc6.d/K30dhcp >/dev/null 2>&1");
|
||||||
|
} else if (strcmp(argv[1], "disable") == 0) {
|
||||||
|
safe_system("rm -f /etc/rc.d/rc*.d/*dhcp >/dev/null 2>&1");
|
||||||
|
} else {
|
||||||
|
fprintf(stderr, "\nBad argument given.\n\ndhcpctrl (start|stop|restart|reload)\n\n");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
@@ -1,145 +0,0 @@
|
|||||||
/* SmoothWall helper program - restartdhcp
|
|
||||||
*
|
|
||||||
* This program is distributed under the terms of the GNU General Public
|
|
||||||
* Licence. See the file COPYING for details.
|
|
||||||
*
|
|
||||||
* (c) Lawrence Manning, 2001
|
|
||||||
* Simple program intended to be installed setuid(0) that can be used for
|
|
||||||
* restarting DHCPd.
|
|
||||||
*
|
|
||||||
* $Id: restartdhcp.c,v 1.5.2.1 2004/11/03 13:50:26 alanh Exp $
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "libsmooth.h"
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
#include <fcntl.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/stat.h>
|
|
||||||
#include <signal.h>
|
|
||||||
#include "setuid.h"
|
|
||||||
|
|
||||||
int main(void)
|
|
||||||
{
|
|
||||||
int fd = -1;
|
|
||||||
int fdblue = -1;
|
|
||||||
char buffer[STRING_SIZE];
|
|
||||||
char blue_dev[STRING_SIZE] = "", green_dev[STRING_SIZE] = "";
|
|
||||||
int pid;
|
|
||||||
struct keyvalue *kv = NULL;
|
|
||||||
|
|
||||||
if (!(initsetuid()))
|
|
||||||
exit(1);
|
|
||||||
|
|
||||||
memset(buffer, 0, STRING_SIZE);
|
|
||||||
|
|
||||||
/* Init the keyvalue structure */
|
|
||||||
kv=initkeyvalues();
|
|
||||||
|
|
||||||
/* Read in the current values */
|
|
||||||
if (!readkeyvalues(kv, CONFIG_ROOT "/ethernet/settings"))
|
|
||||||
{
|
|
||||||
fprintf(stderr, "Cannot read ethernet settings\n");
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!findkey(kv, "GREEN_DEV", green_dev))
|
|
||||||
{
|
|
||||||
fprintf(stderr, "Cannot read GREEN_DEV\n");
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!VALID_DEVICE(green_dev))
|
|
||||||
{
|
|
||||||
fprintf(stderr, "Bad GREEN_DEV: %s\n", green_dev);
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Get the BLUE interface details */
|
|
||||||
findkey(kv, "BLUE_DEV", blue_dev);
|
|
||||||
|
|
||||||
freekeyvalues(kv);
|
|
||||||
|
|
||||||
if ((fdblue = open(CONFIG_ROOT "/dhcp/enable_blue", O_RDONLY)) != -1)
|
|
||||||
{
|
|
||||||
close(fdblue);
|
|
||||||
if (!VALID_DEVICE(blue_dev))
|
|
||||||
{
|
|
||||||
fprintf(stderr, "Bad BLUE_DEV: %s\n", blue_dev);
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((fd = open("/var/run/dhcpd.pid", O_RDONLY)) != -1)
|
|
||||||
{
|
|
||||||
if (read(fd, buffer, STRING_SIZE - 1) == -1)
|
|
||||||
fprintf(stderr, "Couldn't read from pid file\n");
|
|
||||||
else
|
|
||||||
{
|
|
||||||
pid = atoi(buffer);
|
|
||||||
if (pid <= 1)
|
|
||||||
fprintf(stderr, "Bad pid value\n");
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (kill(pid, SIGTERM) == -1)
|
|
||||||
fprintf(stderr, "Unable to send SIGTERM\n");
|
|
||||||
else
|
|
||||||
unlink("/var/run/dhcpd.pid");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
safe_system("/bin/killall -KILL dhcpd");
|
|
||||||
close(fd);
|
|
||||||
}
|
|
||||||
|
|
||||||
safe_system("/sbin/iptables -F DHCPBLUEINPUT");
|
|
||||||
|
|
||||||
buffer[0] = '\0';
|
|
||||||
|
|
||||||
if ((fd = open(CONFIG_ROOT "/dhcp/enable_green", O_RDONLY)) != -1)
|
|
||||||
{
|
|
||||||
close(fd);
|
|
||||||
if ((fdblue = open(CONFIG_ROOT "/dhcp/enable_blue", O_RDONLY)) != -1)
|
|
||||||
{
|
|
||||||
close(fdblue);
|
|
||||||
|
|
||||||
snprintf(buffer, STRING_SIZE-1, "/sbin/iptables -A DHCPBLUEINPUT -p tcp --source-port 68 --destination-port 67 -i %s -j ACCEPT > /dev/null 2>&1", blue_dev);
|
|
||||||
safe_system(buffer);
|
|
||||||
snprintf(buffer, STRING_SIZE-1, "/sbin/iptables -A DHCPBLUEINPUT -p udp --source-port 68 --destination-port 67 -i %s -j ACCEPT > /dev/null 2>&1", blue_dev);
|
|
||||||
safe_system(buffer);
|
|
||||||
snprintf(buffer, STRING_SIZE-1, "/usr/sbin/dhcpd -q %s %s", green_dev, blue_dev);
|
|
||||||
} else {
|
|
||||||
snprintf(buffer, STRING_SIZE-1, "/usr/sbin/dhcpd -q %s", green_dev);
|
|
||||||
}
|
|
||||||
safe_system(buffer);
|
|
||||||
} else {
|
|
||||||
if ((fdblue = open(CONFIG_ROOT "/dhcp/enable_blue", O_RDONLY)) != -1)
|
|
||||||
{
|
|
||||||
close(fdblue);
|
|
||||||
|
|
||||||
snprintf(buffer, STRING_SIZE-1, "/sbin/iptables -A DHCPBLUEINPUT -p tcp --source-port 68 --destination-port 67 -i %s -j ACCEPT > /dev/null 2>&1", blue_dev);
|
|
||||||
safe_system(buffer);
|
|
||||||
snprintf(buffer, STRING_SIZE-1, "/sbin/iptables -A DHCPBLUEINPUT -p udp --source-port 68 --destination-port 67 -i %s -j ACCEPT > /dev/null 2>&1", blue_dev);
|
|
||||||
safe_system(buffer);
|
|
||||||
snprintf(buffer, STRING_SIZE-1, "/usr/sbin/dhcpd -q %s", blue_dev);
|
|
||||||
safe_system(buffer);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (buffer[0] != '\0')
|
|
||||||
{
|
|
||||||
/* Silly dhcpd creates pids with mode 640 */
|
|
||||||
sleep (1);
|
|
||||||
if ((fd = open("/var/run/dhcpd.pid", 0)) == -1)
|
|
||||||
{
|
|
||||||
fprintf(stderr, "No pid file\n");
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
fchmod(fd, 00644);
|
|
||||||
close(fd);
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user