mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-05-03 08:42:55 +02:00
fixed wirelesscontrol and included in core 8
git-svn-id: http://svn.ipfire.org/svn/ipfire/branches/2.1/trunk@1223 ea5c0bd1-69bd-2848-81d8-4f18e57aeed8
This commit is contained in:
@@ -2,8 +2,8 @@ bin/ntfs-3g
|
|||||||
#lib/libntfs-3g.a
|
#lib/libntfs-3g.a
|
||||||
#lib/libntfs-3g.la
|
#lib/libntfs-3g.la
|
||||||
lib/libntfs-3g.so
|
lib/libntfs-3g.so
|
||||||
lib/libntfs-3g.so.21
|
lib/libntfs-3g.so.23
|
||||||
lib/libntfs-3g.so.21.0.0
|
lib/libntfs-3g.so.23.0.0
|
||||||
sbin/mount.ntfs-3g
|
sbin/mount.ntfs-3g
|
||||||
#usr/include/ntfs-3g
|
#usr/include/ntfs-3g
|
||||||
#usr/include/ntfs-3g/attrib.h
|
#usr/include/ntfs-3g/attrib.h
|
||||||
|
|||||||
@@ -4,3 +4,4 @@ lib/modules/2.6.16.57-ipfire-smp/kernel/drivers/net/r8169.ko
|
|||||||
lib/modules/2.6.16.57-ipfire-smp/kernel/drivers/net/r8168.ko
|
lib/modules/2.6.16.57-ipfire-smp/kernel/drivers/net/r8168.ko
|
||||||
srv/web/ipfire/cgi-bin/logs.cgi/log.dat
|
srv/web/ipfire/cgi-bin/logs.cgi/log.dat
|
||||||
etc/ntp
|
etc/ntp
|
||||||
|
usr/local/bin/wirelessctrl
|
||||||
|
|||||||
@@ -2,3 +2,5 @@
|
|||||||
. /opt/pakfire/lib/functions.sh
|
. /opt/pakfire/lib/functions.sh
|
||||||
extract_files
|
extract_files
|
||||||
depmod -a
|
depmod -a
|
||||||
|
echo "DROPWIRELESSFORWARD=on" >> /var/ipfire/optionsfw/settings
|
||||||
|
echo "DROPWIRELESSINPUT=on" >> /var/ipfire/optionsfw/settings
|
||||||
|
|||||||
@@ -25,30 +25,6 @@ FILE *fd = NULL;
|
|||||||
char blue_dev[STRING_SIZE] = "";
|
char blue_dev[STRING_SIZE] = "";
|
||||||
char command[STRING_SIZE];
|
char command[STRING_SIZE];
|
||||||
|
|
||||||
void exithandler(void)
|
|
||||||
{
|
|
||||||
struct keyvalue *kv = NULL;
|
|
||||||
char buffer[STRING_SIZE];
|
|
||||||
if(strlen(blue_dev))
|
|
||||||
{
|
|
||||||
if(findkey(kv, "DROPWIRELESSINPUT", buffer) && !strcmp(buffer,"on")){
|
|
||||||
snprintf(command, STRING_SIZE-1, "/sbin/iptables -A WIRELESSINPUT -i %s -j LOG --log-prefix 'DROP_Wirelessinput'", blue_dev);
|
|
||||||
safe_system(command);
|
|
||||||
}
|
|
||||||
if(findkey(kv, "DROPWIRELESSFORWARD", buffer) && !strcmp(buffer,"on")){
|
|
||||||
snprintf(command, STRING_SIZE-1, "/sbin/iptables -A WIRELESSFORWARD -i %s -j LOG --log-prefix 'DROP_Wirelessforward'", blue_dev);
|
|
||||||
safe_system(command);
|
|
||||||
}
|
|
||||||
snprintf(command, STRING_SIZE-1, "/sbin/iptables -A WIRELESSINPUT -i %s -j DROP -m comment --comment 'DROP_Wirelessinput'", blue_dev);
|
|
||||||
safe_system(command);
|
|
||||||
snprintf(command, STRING_SIZE-1, "/sbin/iptables -A WIRELESSINPUT -i %s -j DROP -m comment --comment 'DROP_Wirelessforward'", blue_dev);
|
|
||||||
safe_system(command);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (fd)
|
|
||||||
fclose(fd);
|
|
||||||
}
|
|
||||||
|
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
char green_dev[STRING_SIZE] = "";
|
char green_dev[STRING_SIZE] = "";
|
||||||
@@ -110,8 +86,24 @@ int main(void)
|
|||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* register exit handler to ensure the block rule is always present */
|
if(strlen(blue_dev))
|
||||||
atexit(exithandler);
|
{
|
||||||
|
if(findkey(kv, "DROPWIRELESSINPUT", buffer) && !strcmp(buffer,"on")){
|
||||||
|
snprintf(command, STRING_SIZE-1, "/sbin/iptables -A WIRELESSINPUT -i %s -j LOG --log-prefix 'DROP_Wirelessinput'", blue_dev);
|
||||||
|
safe_system(command);
|
||||||
|
}
|
||||||
|
if(findkey(kv, "DROPWIRELESSFORWARD", buffer) && !strcmp(buffer,"on")){
|
||||||
|
snprintf(command, STRING_SIZE-1, "/sbin/iptables -A WIRELESSFORWARD -i %s -j LOG --log-prefix 'DROP_Wirelessforward'", blue_dev);
|
||||||
|
safe_system(command);
|
||||||
|
}
|
||||||
|
snprintf(command, STRING_SIZE-1, "/sbin/iptables -A WIRELESSINPUT -i %s -j DROP -m comment --comment 'DROP_Wirelessinput'", blue_dev);
|
||||||
|
safe_system(command);
|
||||||
|
snprintf(command, STRING_SIZE-1, "/sbin/iptables -A WIRELESSFORWARD -i %s -j DROP -m comment --comment 'DROP_Wirelessforward'", blue_dev);
|
||||||
|
safe_system(command);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (fd)
|
||||||
|
fclose(fd);
|
||||||
|
|
||||||
if (!(fd = fopen(CONFIG_ROOT "/wireless/config", "r")))
|
if (!(fd = fopen(CONFIG_ROOT "/wireless/config", "r")))
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user