|
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 */ |