FreeBSD Bugzilla – Attachment 162362 Details for
Bug 203869
security/bruteblock patch to use devel/iniparser lib from ports tree and clean build warnings
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch file to switch use lib iniparser from ports tree, libutil(pidfile.h) from base and clean build warnings(fixed EOF)
bruteblock.txt (text/plain), 4.64 KB, created by
Denys Razumov
on 2015-10-22 16:15:36 UTC
(
hide
)
Description:
Patch file to switch use lib iniparser from ports tree, libutil(pidfile.h) from base and clean build warnings(fixed EOF)
Filename:
MIME Type:
Creator:
Denys Razumov
Created:
2015-10-22 16:15:36 UTC
Size:
4.64 KB
patch
obsolete
>Index: Makefile >=================================================================== >--- Makefile (revision 399895) >+++ Makefile (working copy) >@@ -11,7 +11,8 @@ > MAINTAINER= amdmi3@FreeBSD.org > COMMENT= Software for blocking bruteforce attacks with ipfw > >-LIB_DEPENDS= libpcre.so:${PORTSDIR}/devel/pcre >+LIB_DEPENDS= libpcre.so:${PORTSDIR}/devel/pcre \ >+ libiniparser.so:${PORTSDIR}/devel/iniparser > > PKGMESSAGE= ${WRKDIR}/pkg-message > SUB_FILES= pkg-message >Index: files/patch-Makefile >=================================================================== >--- files/patch-Makefile (revision 399895) >+++ files/patch-Makefile (working copy) >@@ -1,11 +1,35 @@ > --- Makefile.orig 2006-08-20 10:22:37.000000000 +0400 > +++ Makefile 2009-03-24 22:12:58.000000000 +0300 >-@@ -18,7 +18,7 @@ >- bruteblock: $(BRUTEBLOCK_OBJS) iniparse/libiniparser.a >+@@ -1,27 +1,21 @@ >+ LOCALBASE?=/usr/local >+-CFLAGS+=-s -Wall -I${LOCALBASE}/include >++CFLAGS+=-Wall -I${LOCALBASE}/include >+ LDFLAGS+=-s >+-EXTRA_LIBS=-L${LOCALBASE}/lib -Liniparse -lpcre -liniparser >++EXTRA_LIBS=-L${LOCALBASE}/lib -lpcre -liniparser -lutil >+ CC?=gcc >+ AR?=ar >+ >+ BRUTEBLOCK_OBJS=bruteblock.o utils.o ipfw2.o >+-BRUTEBLOCKD_OBJS=bruteblockd.o utils.o ipfw2.o pidfile.o >+-INIPARSE_SRC=iniparse/dictionary.c iniparse/iniparser.c iniparse/strlib.c >+-INIPARSE_H=iniparse/dictionary.h iniparse/iniparser.h iniparse/strlib.h >++BRUTEBLOCKD_OBJS=bruteblockd.o utils.o ipfw2.o >+ >+ all: bruteblock bruteblockd >+ >+-iniparse/libiniparser.a: $(INIPARSE_SRC) $(INIPARSE_H) >+- @cd iniparse && make >+- >+-bruteblock: $(BRUTEBLOCK_OBJS) iniparse/libiniparser.a >++bruteblock: $(BRUTEBLOCK_OBJS) > $(CC) $(LDFLAGS) -o $@ $(BRUTEBLOCK_OBJS) $(EXTRA_LIBS) > > -bruteblockd: $(BRUTEBLOCKD_OBJS) pidfile.h >-+bruteblockd: $(BRUTEBLOCKD_OBJS) iniparse/libiniparser.a pidfile.h >++bruteblockd: $(BRUTEBLOCKD_OBJS) > $(CC) $(LDFLAGS) -o $@ $(BRUTEBLOCKD_OBJS) $(EXTRA_LIBS) >--- files/patch-bruteblock.c (revision 399895) >+++ files/patch-bruteblock.c (working copy) >@@ -1,12 +1,62 @@ > --- bruteblock.c.orig 2006-08-20 08:22:37.000000000 +0200 > +++ bruteblock.c 2014-10-15 16:19:19.000000000 +0200 >+@@ -10,7 +10,7 @@ >+ #include <pcre.h> >+ #include <syslog.h> >+ >+-#include "iniparse/iniparser.h" >++#include <iniparser.h> >+ >+ #define MAXHOSTS 5000 >+ #define BUFFER_SIZE 30000 > @@ -99,7 +99,7 @@ > snprintf(table, sizeof(table), "%d", ipfw2_table_no); > argv[1] = table; > argv[2] = command; > - snprintf(utime, sizeof(utime), "%d", >-- time(NULL) + reset_ip); >-+ snprintf(utime, sizeof(utime), "%lld", >-+ (long long)(time(NULL) + reset_ip)); >++ snprintf(utime, sizeof(utime), "%zu", >+ time(NULL) + reset_ip); > argv[4] = utime; > argv[3] = host; >+@@ -128,7 +128,7 @@ >+ for (i = 0; i < MAXHOSTS; i++) { >+ /* skip empty sets */ >+ if (hosts_table[i].count) { >+- printf("table: ip=%s,count=%d,time=%d\n", >++ printf("table: ip=%s,count=%d,time=%zu\n", >+ hosts_table[i].ipaddr, hosts_table[i].count, >+ hosts_table[i].access_time); >+ } >+@@ -150,12 +150,12 @@ >+ int erroffset; >+ int ovector [OVECCOUNT]; >+ char *regexp; >+- unsigned char *buffer; >++ char *buffer; >+ dictionary *ini; >+ char config_path[PATH_MAX]; >+ char *config_pathp = config_path; >+ >+- buffer = (unsigned char *)malloc(BUFFER_SIZE); >++ buffer = (char *)malloc(BUFFER_SIZE); >+ >+ if (ac < 2) { >+ usage(); >+@@ -182,7 +182,7 @@ >+ syslog(LOG_ALERT, "Cannot parse configuration file \"%s\"", config_path); >+ exit(EX_CONFIG); >+ } >+- regexp = iniparser_getstr(ini, ":regexp"); >++ regexp = iniparser_getstring(ini, ":regexp", NULL); >+ if (!regexp) { >+ syslog(LOG_ALERT, "Configuration error - 'regexp' key not found in \"%s\"", >+ config_path); >+@@ -230,7 +230,7 @@ >+ >+ for(i=0;i<10;i++){ >+ snprintf(buffer, BUFFER_SIZE, ":regexp%d", i); >+- regexp = iniparser_getstr(ini, buffer); >++ regexp = iniparser_getstring(ini, buffer, NULL); >+ if (regexp) { >+ re[re_count] = pcre_compile( >+ regexp, /* the pattern */
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 203869
:
162202
|
162282
| 162362