View | Details | Raw Unified | Return to bug 203869 | Differences between
and this patch

Collapse All | Expand All

(-)Makefile (working copy) (-1 / +2 lines)
Lines 11-17 Link Here
11
MAINTAINER=    amdmi3@FreeBSD.org
11
MAINTAINER=    amdmi3@FreeBSD.org
12
COMMENT=       Software for blocking bruteforce attacks with ipfw
12
COMMENT=       Software for blocking bruteforce attacks with ipfw
13
LIB_DEPENDS=   libpcre.so:${PORTSDIR}/devel/pcre
13
LIB_DEPENDS=   libpcre.so:${PORTSDIR}/devel/pcre \
14
               libiniparser.so:${PORTSDIR}/devel/iniparser
14
PKGMESSAGE=    ${WRKDIR}/pkg-message
15
PKGMESSAGE=    ${WRKDIR}/pkg-message
15
SUB_FILES=     pkg-message
16
SUB_FILES=     pkg-message
(-)files/patch-Makefile (working copy) (-3 / +24 lines)
Lines 1-11 Link Here
1
--- Makefile.orig      2006-08-20 10:22:37.000000000 +0400
1
--- Makefile.orig      2006-08-20 10:22:37.000000000 +0400
2
+++ Makefile   2009-03-24 22:12:58.000000000 +0300
2
+++ Makefile   2009-03-24 22:12:58.000000000 +0300
3
@@ -18,7 +18,7 @@
3
@@ -1,27 +1,21 @@
4
 bruteblock: $(BRUTEBLOCK_OBJS) iniparse/libiniparser.a
4
 LOCALBASE?=/usr/local
5
-CFLAGS+=-s -Wall -I${LOCALBASE}/include
6
+CFLAGS+=-Wall -I${LOCALBASE}/include
7
 LDFLAGS+=-s
8
-EXTRA_LIBS=-L${LOCALBASE}/lib -Liniparse -lpcre -liniparser
9
+EXTRA_LIBS=-L${LOCALBASE}/lib -lpcre -liniparser -lutil
10
 CC?=gcc
11
 AR?=ar
12
13
 BRUTEBLOCK_OBJS=bruteblock.o utils.o ipfw2.o
14
-BRUTEBLOCKD_OBJS=bruteblockd.o utils.o ipfw2.o pidfile.o
15
-INIPARSE_SRC=iniparse/dictionary.c iniparse/iniparser.c iniparse/strlib.c
16
-INIPARSE_H=iniparse/dictionary.h iniparse/iniparser.h iniparse/strlib.h
17
+BRUTEBLOCKD_OBJS=bruteblockd.o utils.o ipfw2.o
18
19
 all: bruteblock bruteblockd
20
21
-iniparse/libiniparser.a: $(INIPARSE_SRC) $(INIPARSE_H)
22
-      @cd iniparse  && make
23
-
24
-bruteblock: $(BRUTEBLOCK_OBJS) iniparse/libiniparser.a
25
+bruteblock: $(BRUTEBLOCK_OBJS)
5
       $(CC) $(LDFLAGS) -o $@ $(BRUTEBLOCK_OBJS) $(EXTRA_LIBS)
26
       $(CC) $(LDFLAGS) -o $@ $(BRUTEBLOCK_OBJS) $(EXTRA_LIBS)
6
-bruteblockd: $(BRUTEBLOCKD_OBJS) pidfile.h
27
-bruteblockd: $(BRUTEBLOCKD_OBJS) pidfile.h
7
+bruteblockd: $(BRUTEBLOCKD_OBJS) iniparse/libiniparser.a pidfile.h
28
+bruteblockd: $(BRUTEBLOCKD_OBJS)
8
       $(CC) $(LDFLAGS) -o $@ $(BRUTEBLOCKD_OBJS) $(EXTRA_LIBS)
29
       $(CC) $(LDFLAGS) -o $@ $(BRUTEBLOCKD_OBJS) $(EXTRA_LIBS)
(-)files/patch-bruteblock.c (working copy) (-3 / +53 lines)
Lines 1-12 Link Here
1
--- bruteblock.c.orig  2006-08-20 08:22:37.000000000 +0200
1
--- bruteblock.c.orig  2006-08-20 08:22:37.000000000 +0200
2
+++ bruteblock.c       2014-10-15 16:19:19.000000000 +0200
2
+++ bruteblock.c       2014-10-15 16:19:19.000000000 +0200
3
@@ -10,7 +10,7 @@
4
 #include <pcre.h>
5
 #include <syslog.h>
6
7
-#include "iniparse/iniparser.h"
8
+#include <iniparser.h>
9
10
 #define MAXHOSTS 5000
11
 #define BUFFER_SIZE 30000
3
@@ -99,7 +99,7 @@
12
@@ -99,7 +99,7 @@
4
                               snprintf(table, sizeof(table), "%d", ipfw2_table_no);
13
                               snprintf(table, sizeof(table), "%d", ipfw2_table_no);
5
                               argv[1] = table;
14
                               argv[1] = table;
6
                               argv[2] = command;
15
                               argv[2] = command;
7
-                              snprintf(utime, sizeof(utime), "%d",
16
-                              snprintf(utime, sizeof(utime), "%d",
8
-                              time(NULL) + reset_ip);
17
+                              snprintf(utime, sizeof(utime), "%zu",
9
+                              snprintf(utime, sizeof(utime), "%lld",
18
                               time(NULL) + reset_ip);
10
+                              (long long)(time(NULL) + reset_ip));
11
                               argv[4] = utime;
19
                               argv[4] = utime;
12
                               argv[3] = host;
20
                               argv[3] = host;
21
@@ -128,7 +128,7 @@
22
       for (i = 0; i < MAXHOSTS; i++) {
23
               /* skip empty sets */
24
               if (hosts_table[i].count) {
25
-                      printf("table: ip=%s,count=%d,time=%d\n",
26
+                      printf("table: ip=%s,count=%d,time=%zu\n",
27
                       hosts_table[i].ipaddr, hosts_table[i].count,
28
                       hosts_table[i].access_time);
29
               }
30
@@ -150,12 +150,12 @@
31
       int             erroffset;
32
       int             ovector    [OVECCOUNT];
33
       char           *regexp;
34
-      unsigned char  *buffer;
35
+      char           *buffer;
36
       dictionary     *ini;
37
       char            config_path[PATH_MAX];
38
       char           *config_pathp = config_path;
39
40
-      buffer = (unsigned char *)malloc(BUFFER_SIZE);
41
+      buffer = (char *)malloc(BUFFER_SIZE);
42
43
       if (ac < 2) {
44
               usage();
45
@@ -182,7 +182,7 @@
46
               syslog(LOG_ALERT, "Cannot parse configuration file \"%s\"", config_path);
47
               exit(EX_CONFIG);
48
       }
49
-      regexp = iniparser_getstr(ini, ":regexp");
50
+      regexp = iniparser_getstring(ini, ":regexp", NULL);
51
       if (!regexp) {
52
               syslog(LOG_ALERT, "Configuration error - 'regexp' key not found in \"%s\"",
53
               config_path);
54
@@ -230,7 +230,7 @@
55
56
       for(i=0;i<10;i++){
57
               snprintf(buffer, BUFFER_SIZE, ":regexp%d", i);
58
-              regexp = iniparser_getstr(ini, buffer);
59
+              regexp = iniparser_getstring(ini, buffer, NULL);
60
               if (regexp) {
61
                       re[re_count] = pcre_compile(
62
                       regexp, /* the pattern */

Return to bug 203869