2 ===================================================================
3 RCS file: /cvs/gpe/base/gpe-shield/backend.c,v
4 retrieving revision 1.8
5 diff -u -r1.8 backend.c
6 --- backend.c 21 Jun 2004 08:54:53 -0000 1.8
7 +++ backend.c 16 Aug 2004 12:17:54 -0000
9 #define IPTABLES_CMD1 "/usr/sbin/iptables"
10 #define IPTABLES_CMD2 "/sbin/iptables"
11 #define IPTABLES_CMD3 "/usr/local/sbin/iptables"
12 +#define IPTABLES_CMD4 "/usr/bin/iptables"
14 static const char* IPTABLES_CMD = NULL;
20 - char* cmd = g_strdup_printf("%s %s",IPTABLES_CMD,"--flush");
23 + cmd = g_strdup_printf("%s %s",IPTABLES_CMD,"--flush");
27 cmd = g_strdup_printf("%s %s",IPTABLES_CMD,"-P INPUT ACCEPT"); /* reset input policy */
38 pfd[0].events = (POLLIN | POLLRDNORM | POLLRDBAND | POLLPRI);
40 while (poll (pfd, 1, -1) > 0)
42 if ((pfd[0].revents & POLLERR) || (pfd[0].revents & POLLHUP))
44 IPTABLES_CMD = IPTABLES_CMD2;
45 else if (!access(IPTABLES_CMD3,X_OK))
46 IPTABLES_CMD = IPTABLES_CMD3;
48 + else if (!access(IPTABLES_CMD4,X_OK))
49 + IPTABLES_CMD = IPTABLES_CMD4;
61 + if (IPTABLES_CMD == NULL)
63 + fprintf(stderr, "Iptables not found, exiting.\n");
71 while (wait_message ()) ;