diff options
author | Muhammad Moinur Rahman <bofh@FreeBSD.org> | 2019-01-22 14:57:27 +0000 |
---|---|---|
committer | Muhammad Moinur Rahman <bofh@FreeBSD.org> | 2019-01-22 14:57:27 +0000 |
commit | a1ac8c389227ab918eb178663dbbec04273030f1 (patch) | |
tree | c200a3af47156ab4c76f9548101c5e8dabccbe74 /security/barnyard2 | |
parent | 41ff4e536e680bc94d0949bc7708ddfe6f5646a7 (diff) | |
download | ports-a1ac8c389227ab918eb178663dbbec04273030f1.tar.gz ports-a1ac8c389227ab918eb178663dbbec04273030f1.zip |
Notes
Diffstat (limited to 'security/barnyard2')
-rw-r--r-- | security/barnyard2/Makefile | 7 | ||||
-rw-r--r-- | security/barnyard2/files/patch-decode.c | 24 | ||||
-rw-r--r-- | security/barnyard2/files/patch-map.c | 65 | ||||
-rw-r--r-- | security/barnyard2/files/patch-parser.c | 11 | ||||
-rw-r--r-- | security/barnyard2/files/patch-spo__alert__fwsam.c | 48 | ||||
-rw-r--r-- | security/barnyard2/files/patch-spo__alert__test.c | 11 | ||||
-rw-r--r-- | security/barnyard2/files/patch-spo__alert__unixsock.c | 10 | ||||
-rw-r--r-- | security/barnyard2/files/patch-spo__database.c | 11 | ||||
-rw-r--r-- | security/barnyard2/files/patch-spo__database__cache.c | 92 | ||||
-rw-r--r-- | security/barnyard2/files/patch-spo__syslog__full.c | 11 | ||||
-rw-r--r-- | security/barnyard2/files/patch-spooler.c | 11 |
11 files changed, 298 insertions, 3 deletions
diff --git a/security/barnyard2/Makefile b/security/barnyard2/Makefile index 70ce33ad7587..0c530c118880 100644 --- a/security/barnyard2/Makefile +++ b/security/barnyard2/Makefile @@ -3,7 +3,7 @@ PORTNAME= barnyard2 PORTVERSION= 1.13 DISTVERSIONPREFIX= v2- -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= security MAINTAINER= bofh@FreeBSD.org @@ -11,6 +11,8 @@ COMMENT= Interpreter for Snort unified2 binary output files LICENSE= GPLv2 +USES= autoreconf libtool + USE_GITHUB= yes GH_ACCOUNT= firnsy @@ -32,7 +34,6 @@ OPTIONS_DESC= Enable tcl support for sguil OPTIONS_DEFAULT+= TCL .endif -USES= autoreconf libtool USE_RC_SUBR= barnyard2 GNU_CONFIGURE= yes @@ -71,7 +72,7 @@ PORT_PCAP_CONFIGURE_ON= --with-libpcap-includes=${LOCALBASE}/include \ .include <bsd.port.options.mk> .if ${PORT_OPTIONS:MBRO} -DEPRECATED= Uses legacy GeoIP 1 format which no longer works; switch to GeoIP 2 where possible +DEPRECATED= Uses legacy GeoIP 1 format which no longer works; switch to GeoIP 2 where possible EXPIRATION_DATE=2019-02-15 .endif diff --git a/security/barnyard2/files/patch-decode.c b/security/barnyard2/files/patch-decode.c new file mode 100644 index 000000000000..1da1bc9107f4 --- /dev/null +++ b/security/barnyard2/files/patch-decode.c @@ -0,0 +1,24 @@ +--- src/decode.c.orig 2018-10-06 13:07:26 UTC ++++ src/decode.c +@@ -265,9 +265,9 @@ int DecodePacket(int linktype, Packet *p + return 0; + } + +-static INLINE void DecoderEvent( +- Packet *p, int gid, char *str, int event_flag, int drop_flag) +-{ ++//static INLINE void DecoderEvent( ++// Packet *p, int gid, char *str, int event_flag, int drop_flag) ++//{ + // if((runMode == MODE_IDS) && event_flag) + // { + // SnortEventqAdd(GENERATOR_SNORT_DECODE, gid, 1, +@@ -278,7 +278,7 @@ static INLINE void DecoderEvent( + // InlineDrop(p); + // } + // } +-} ++//} + + /* + * Function: DecodeEthPkt(Packet *, char *, struct pcap_pkthdr*, uint8_t*) diff --git a/security/barnyard2/files/patch-map.c b/security/barnyard2/files/patch-map.c new file mode 100644 index 000000000000..9db465064206 --- /dev/null +++ b/security/barnyard2/files/patch-map.c @@ -0,0 +1,65 @@ +--- src/map.c.orig 2018-10-06 11:14:40 UTC ++++ src/map.c +@@ -818,7 +818,7 @@ void ParseSidMapLine(Barnyard2Config *bc + { + case 0: /* sid */ + t_sn.generator = 1; +- if( (t_sn.id = strtoul(idx, NULL, 10)) == ULONG_MAX) ++ if( ((unsigned long)(t_sn.id = strtoul(idx, NULL, 10))) == ULONG_MAX) + { + FatalError("[%s()], error converting integer [%s] for line [%s] \n", + __FUNCTION__, +@@ -848,7 +848,7 @@ void ParseSidMapLine(Barnyard2Config *bc + { + + case 0: /*gid */ +- if( (t_sn.generator = strtoul(idx,NULL,10)) == ULONG_MAX) ++ if( ((unsigned long)(t_sn.generator = strtoul(idx,NULL,10))) == ULONG_MAX) + { + FatalError("[%s()], error converting integer [%s] for line [%s] \n", + __FUNCTION__, +@@ -859,7 +859,7 @@ void ParseSidMapLine(Barnyard2Config *bc + break; + + case 1: /* sid */ +- if( (t_sn.id = strtoul(idx, NULL, 10)) == ULONG_MAX) ++ if( ((unsigned long)(t_sn.id = strtoul(idx, NULL, 10))) == ULONG_MAX) + { + FatalError("[%s()], error converting integer [%s] for line [%s] \n", + __FUNCTION__, +@@ -869,7 +869,7 @@ void ParseSidMapLine(Barnyard2Config *bc + break; + + case 2: /* revision */ +- if( (t_sn.rev = strtoul(idx, NULL, 10)) == ULONG_MAX) ++ if( ((unsigned long)(t_sn.rev = strtoul(idx, NULL, 10))) == ULONG_MAX) + { + FatalError("[%s()], error converting integer [%s] for line [%s] \n", + __FUNCTION__, +@@ -889,7 +889,7 @@ void ParseSidMapLine(Barnyard2Config *bc + + case 4: /* priority */ + +- if( (t_sn.priority = strtoul(idx, NULL, 10)) == ULONG_MAX) ++ if( (unsigned long)(t_sn.priority = strtoul(idx, NULL, 10)) == ULONG_MAX) + { + FatalError("[%s()], error converting integer [%s] for line [%s] \n", + __FUNCTION__, +@@ -1121,7 +1121,7 @@ void ParseGenMapLine(char *data) + switch(i) + { + case 0: /* gen */ +- if( (t_sn.generator = strtoul(idx, NULL, 10)) == ULONG_MAX) ++ if( (unsigned long)(t_sn.generator = strtoul(idx, NULL, 10)) == ULONG_MAX) + { + FatalError("[%s()], error converting integer [%s] for line [%s] \n", + __FUNCTION__, +@@ -1131,7 +1131,7 @@ void ParseGenMapLine(char *data) + break; + + case 1: /* sid */ +- if( (t_sn.id = strtoul(idx, NULL, 10)) == ULONG_MAX) ++ if( (unsigned long)(t_sn.id = strtoul(idx, NULL, 10)) == ULONG_MAX) + { + FatalError("[%s()], error converting integer [%s] for line [%s] \n", + __FUNCTION__, diff --git a/security/barnyard2/files/patch-parser.c b/security/barnyard2/files/patch-parser.c new file mode 100644 index 000000000000..465a8010e6f2 --- /dev/null +++ b/security/barnyard2/files/patch-parser.c @@ -0,0 +1,11 @@ +--- src/parser.c.orig 2018-10-06 12:48:05 UTC ++++ src/parser.c +@@ -2322,7 +2322,7 @@ int SigSuppressAddElement(SigSuppress_li + { + memset(&comp_set,'\0',(sizeof(u_int8_t)*4)); + +- if( (cNode->gid == sElement->gid)) ++ if (cNode->gid == sElement->gid) + { + switch(sElement->ss_type) + { diff --git a/security/barnyard2/files/patch-spo__alert__fwsam.c b/security/barnyard2/files/patch-spo__alert__fwsam.c new file mode 100644 index 000000000000..0c0fd368d58f --- /dev/null +++ b/security/barnyard2/files/patch-spo__alert__fwsam.c @@ -0,0 +1,48 @@ +--- src/output-plugins/spo_alert_fwsam.c.orig 2018-09-24 20:29:16 UTC ++++ src/output-plugins/spo_alert_fwsam.c +@@ -115,7 +115,7 @@ + #include <sys/filio.h> + #endif + +-typedef int SOCKET; ++//typedef int SOCKET; + + #ifndef INVALID_SOCKET + #define INVALID_SOCKET -1 +@@ -617,7 +617,8 @@ int FWsamReadLine(char *buf,unsigned lon + p=buf; + while(isspace(*p)) + p++; +- if(p>buf); ++ if(p>buf) ++ ; + strcpy(buf,p); + if(*buf) + { +@@ -961,7 +962,7 @@ void AlertFWsam(Packet *p, void *event, + FWsamPacket sampacket; + FWsamStation *station=NULL; + FWsamList *fwsamlist; +- SOCKET stationsocket; ++ int stationsocket; + int i,len,deletestation,stationtry=0; + char *encbuf,*decbuf; + static unsigned long lastbsip[FWSAM_REPET_BLOCKS]; +@@ -1387,7 +1388,7 @@ void AlertFWsam(Packet *p, void *event, + void FWsamCheckOut(FWsamStation *station) + { + FWsamPacket sampacket; +- SOCKET stationsocket; ++ int stationsocket; + int i,len; + char *encbuf,*decbuf; + +@@ -1538,7 +1539,7 @@ int FWsamCheckIn(FWsamStation *station) + int i,len,stationok=TRUE; + FWsamPacket sampacket; + char *encbuf,*decbuf; +- SOCKET stationsocket; ++ int stationsocket; + + + /* create a socket for the station */ diff --git a/security/barnyard2/files/patch-spo__alert__test.c b/security/barnyard2/files/patch-spo__alert__test.c new file mode 100644 index 000000000000..5d87cdf015c3 --- /dev/null +++ b/security/barnyard2/files/patch-spo__alert__test.c @@ -0,0 +1,11 @@ +--- src/output-plugins/spo_alert_test.c.orig 2018-10-06 12:25:46 UTC ++++ src/output-plugins/spo_alert_test.c +@@ -317,7 +317,7 @@ SpoAlertTestData * ParseAlertTestArgs(ch + filename_end--; + + filename_end++; +- filename_end = '\0'; ++ *filename_end = '\0'; + + outfile = ProcessFileOption(barnyard2_conf_for_parsing, filename); + data->file = OpenAlertFile(outfile); diff --git a/security/barnyard2/files/patch-spo__alert__unixsock.c b/security/barnyard2/files/patch-spo__alert__unixsock.c new file mode 100644 index 000000000000..477f5b326d43 --- /dev/null +++ b/security/barnyard2/files/patch-spo__alert__unixsock.c @@ -0,0 +1,10 @@ +--- src/output-plugins/spo_alert_unixsock.c.orig 2018-10-06 12:34:15 UTC ++++ src/output-plugins/spo_alert_unixsock.c +@@ -44,6 +44,7 @@ + #endif /* !WIN32 */ + #include <unistd.h> + #include <errno.h> ++#include <stdlib.h> + + #include "decode.h" + #include "plugbase.h" diff --git a/security/barnyard2/files/patch-spo__database.c b/security/barnyard2/files/patch-spo__database.c new file mode 100644 index 000000000000..4b3508269d81 --- /dev/null +++ b/security/barnyard2/files/patch-spo__database.c @@ -0,0 +1,11 @@ +--- src/output-plugins/spo_database.c.orig 2018-10-06 12:58:28 UTC ++++ src/output-plugins/spo_database.c +@@ -871,7 +871,7 @@ void DatabaseInitFinalize(int unused, vo + { + DatabaseData *data = (DatabaseData *)arg; + +- if ((data == NULL)) ++ if (data == NULL) + { + FatalError("database data uninitialized\n"); + } diff --git a/security/barnyard2/files/patch-spo__database__cache.c b/security/barnyard2/files/patch-spo__database__cache.c new file mode 100644 index 000000000000..98e91845ae10 --- /dev/null +++ b/security/barnyard2/files/patch-spo__database__cache.c @@ -0,0 +1,92 @@ +--- src/output-plugins/spo_database_cache.c.orig 2018-10-06 12:40:44 UTC ++++ src/output-plugins/spo_database_cache.c +@@ -146,7 +146,7 @@ u_int32_t inserted_sigref_object_count = + */ + u_int32_t cacheSignatureReferenceLookup(dbSignatureReferenceObj *iLookup,cacheSignatureReferenceObj *iHead) + { +- if( (iLookup == NULL)) ++ if (iLookup == NULL) + { + /* XXX */ + FatalError("database [%s()], Called with dbReferenceSignatureObj[0x%x] cacheSignatureReferenceObj [0x%x] \n", +@@ -224,7 +224,7 @@ u_int32_t cacheEventSignatureLookup(cach + u_int32_t cacheSignatureLookup(dbSignatureObj *iLookup,cacheSignatureObj *iHead) + { + +- if( (iLookup == NULL)) ++ if (iLookup == NULL) + { + /* XXX */ + FatalError("database [%s()], Called with dbSignatureObj[0x%x] cacheSignatureObj [0x%x] \n", +@@ -266,7 +266,7 @@ u_int32_t cacheSignatureLookup(dbSignatu + cacheSignatureObj * cacheSignatureGetObject(dbSignatureObj *iLookup,cacheSignatureObj *iHead) + { + +- if( (iLookup == NULL)) ++ if (iLookup == NULL) + { + /* XXX */ + FatalError("database [%s()], Called with dbSignatureObj[0x%x] cacheSignatureObj [0x%x] \n", +@@ -325,7 +325,7 @@ u_int32_t cacheEventClassificationLookup + */ + u_int32_t cacheClassificationLookup(dbClassificationObj *iLookup,cacheClassificationObj *iHead) + { +- if( (iLookup == NULL)) ++ if (iLookup == NULL) + { + /* XXX */ + FatalError("database [%s()], Called with dbClassiciationObj[0x%x] cacheClassificationObj [0x%x] \n", +@@ -510,7 +510,7 @@ u_int32_t dbSignatureReferenceLookup(dbS + */ + u_int32_t dbReferenceLookup(dbReferenceObj *iLookup,cacheReferenceObj *iHead) + { +- if( (iLookup == NULL)) ++ if (iLookup == NULL) + { + /* XXX */ + FatalError("database [%s()], Called with dbReferenceObj[0x%x] cacheReferenceObj [0x%x] \n", +@@ -561,7 +561,7 @@ u_int32_t dbReferenceLookup(dbReferenceO + */ + u_int32_t dbSystemLookup(dbSystemObj *iLookup,cacheSystemObj *iHead) + { +- if( (iLookup == NULL)) ++ if (iLookup == NULL) + { + /* XXX */ + FatalError("database [%s()], Called with dbSystemObj[0x%x] cacheSystemObj [0x%x] \n", +@@ -615,7 +615,7 @@ u_int32_t dbSystemLookup(dbSystemObj *iL + u_int32_t dbSignatureLookup(dbSignatureObj *iLookup,cacheSignatureObj *iHead) + { + +- if( (iLookup == NULL)) ++ if (iLookup == NULL) + { + /* XXX */ + FatalError("database [%s()], Called with dbSignatureObj[0x%x] cacheSignatureObj [0x%x] \n", +@@ -702,7 +702,7 @@ u_int32_t dbSignatureLookup(dbSignatureO + */ + u_int32_t dbClassificationLookup(dbClassificationObj *iLookup,cacheClassificationObj *iHead) + { +- if( (iLookup == NULL)) ++ if (iLookup == NULL) + { + /* XXX */ + FatalError("database [%s()], Called with dbReferenceObj[0x%x] cacheClassificationObj [0x%x] \n", +@@ -5206,7 +5206,7 @@ u_int32_t SignatureReferenceCacheUpdateD + return 1; + } + +- if( (iDBList == NULL)) ++ if (iDBList == NULL) + { + /* XXX */ + /* No reference */ +@@ -5410,7 +5410,7 @@ u_int32_t SignatureReferencePopulateData + { + u_int32_t row_validate = 0; + +- if( (data == NULL)) ++ if (data == NULL) + { + /* XXX */ + return 1; diff --git a/security/barnyard2/files/patch-spo__syslog__full.c b/security/barnyard2/files/patch-spo__syslog__full.c new file mode 100644 index 000000000000..29deeb44534a --- /dev/null +++ b/security/barnyard2/files/patch-spo__syslog__full.c @@ -0,0 +1,11 @@ +--- src/output-plugins/spo_syslog_full.c.orig 2018-10-06 12:59:49 UTC ++++ src/output-plugins/spo_syslog_full.c +@@ -1711,7 +1711,7 @@ OpSyslog_Data *OpSyslog_ParseArgs(char * + int UDPConnect(OpSyslog_Data *op_data) + { + +- if( (op_data == NULL)) ++ if (op_data == NULL) + { + /* XXX */ + return 1; diff --git a/security/barnyard2/files/patch-spooler.c b/security/barnyard2/files/patch-spooler.c new file mode 100644 index 000000000000..b8b3cd0c2834 --- /dev/null +++ b/security/barnyard2/files/patch-spooler.c @@ -0,0 +1,11 @@ +--- src/spooler.c.orig 2018-10-06 11:56:32 UTC ++++ src/spooler.c +@@ -1042,7 +1042,7 @@ int spoolerOpenWaldo(Waldo *waldo, uint8 + } + + /* check that a waldo file has been specified */ +- if ( waldo->filepath == NULL ) ++ if ( waldo->filepath[0] == '\0' ) + { + return WALDO_FILE_EEXIST; + } |