Index: head/security/barnyard2/Makefile =================================================================== --- head/security/barnyard2/Makefile (revision 490953) +++ head/security/barnyard2/Makefile (revision 490954) @@ -1,91 +1,92 @@ # $FreeBSD$ PORTNAME= barnyard2 PORTVERSION= 1.13 DISTVERSIONPREFIX= v2- -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= security MAINTAINER= bofh@FreeBSD.org COMMENT= Interpreter for Snort unified2 binary output files LICENSE= GPLv2 +USES= autoreconf libtool + USE_GITHUB= yes GH_ACCOUNT= firnsy OPTIONS_DEFINE= 64BIT ARUBA BRO GRE IPV6 MPLS PORT_PCAP DOCS EXAMPLES OPTIONS_RADIO= DATABASE OPTIONS_RADIO_DATABASE= MYSQL MYSQL_SSL ODBC PGSQL NO_OPTIONS_SORT=yes 64BIT_DESC= Enable 64bit compilation (experimental) ARUBA_DESC= Enable aruba support BRO_DESC= Enable bro support (libbroccoli) GRE_DESC= Enable gre support MYSQL_SSL_DESC= Enable mysql ssl support (experimental) PORT_PCAP_DESC= Use libpcap from ports .if defined(SLAVE) OPTIONS_DEFINE+= TCL OPTIONS_DESC= Enable tcl support for sguil OPTIONS_DEFAULT+= TCL .endif -USES= autoreconf libtool USE_RC_SUBR= barnyard2 GNU_CONFIGURE= yes SUB_FILES= pkg-message PORTDOCS1= README RELEASE.NOTES PORTDOCS2= INSTALL README.aruba README.database README.sguil README.sig_suppress README.snortsam EXAMPLES= SCHEMA_ACCESS create_db2 create_mssql create_mysql create_oracle.sql create_postgresql 64BIT_CONFIGURE_ENABLE= 64bit-gcc ARUBA_CONFIGURE_ENABLE= aruba BRO_LIB_DEPENDS= libbroccoli.so:security/broccoli BRO_CONFIGURE_ON= --with-broccoli=${LOCALBASE}/lib BRO_CONFIGURE_ENABLE= bro GRE_CONFIGURE_ENABLE= gre IPV6_CONFIGURE_ENABLE= ipv6 MPLS_CONFIGURE_ENABLE= mpls MYSQL_USE= MYSQL=yes MYSQL_CONFIGURE_WITH= mysql MYSQL_CONFIGURE_ON= --with-mysql-includes=${LOCALBASE}/include/mysql \ --with-mysql-libraries=${LOCALBASE}/lib/mysql MYSQL_SSL_CONFIGURE_ENABLE= mysql-ssl-support ODBC_LIB_DEPENDS= libodbc.so:databases/unixODBC ODBC_WITH= odbc PGSQL_USES= pgsql PGSQL_CONFIGURE_ON= --with-postgresql=${LOCALBASE}/bin/pg_config --with-pgsql-includes=${LOCALBASE}/include/postgresql/server PGSQL_CONFIGURE_OFF= --without-postgresql TCL_USES= tcl TCL_CONFIGURE_ON= --with-tcl=${LOCALBASE}/lib/tcl${TCL_VER} TCL_CONFIGURE_OFF= --without-tcl WANT_PGSQL_VER= 92+ PORT_PCAP_LIB_DEPENDS= libpcap.so.1:net/libpcap PORT_PCAP_CONFIGURE_ON= --with-libpcap-includes=${LOCALBASE}/include \ --with-libpcap-libraries=${LOCALBASE}/lib .include .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 post-patch: @${REINPLACE_CMD} 's|/etc|${LOCALBASE}/etc|' \ ${WRKSRC}/etc/barnyard2.conf do-install: @${MKDIR} ${STAGEDIR}${DOCSDIR} ${INSTALL_DATA} ${PORTDOCS1:S|^|${WRKSRC}/|} ${STAGEDIR}${DOCSDIR} ${INSTALL_DATA} ${PORTDOCS2:S|^|${WRKSRC}/doc/|} ${STAGEDIR}${DOCSDIR} @${MKDIR} ${STAGEDIR}${EXAMPLESDIR} ${INSTALL_DATA} ${EXAMPLES:S|^|${WRKSRC}/schemas/|} ${STAGEDIR}${EXAMPLESDIR} ${INSTALL_PROGRAM} ${WRKSRC}/src/barnyard2 ${STAGEDIR}${PREFIX}/bin/ ${CP} ${WRKSRC}/etc/barnyard2.conf ${STAGEDIR}${PREFIX}/etc/barnyard2.conf.sample .include Index: head/security/barnyard2/files/patch-decode.c =================================================================== --- head/security/barnyard2/files/patch-decode.c (nonexistent) +++ head/security/barnyard2/files/patch-decode.c (revision 490954) @@ -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*) Property changes on: head/security/barnyard2/files/patch-decode.c ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/security/barnyard2/files/patch-map.c =================================================================== --- head/security/barnyard2/files/patch-map.c (nonexistent) +++ head/security/barnyard2/files/patch-map.c (revision 490954) @@ -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__, Property changes on: head/security/barnyard2/files/patch-map.c ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/security/barnyard2/files/patch-parser.c =================================================================== --- head/security/barnyard2/files/patch-parser.c (nonexistent) +++ head/security/barnyard2/files/patch-parser.c (revision 490954) @@ -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) + { Property changes on: head/security/barnyard2/files/patch-parser.c ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/security/barnyard2/files/patch-spo__alert__fwsam.c =================================================================== --- head/security/barnyard2/files/patch-spo__alert__fwsam.c (nonexistent) +++ head/security/barnyard2/files/patch-spo__alert__fwsam.c (revision 490954) @@ -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 + #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 */ Property changes on: head/security/barnyard2/files/patch-spo__alert__fwsam.c ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/security/barnyard2/files/patch-spo__alert__test.c =================================================================== --- head/security/barnyard2/files/patch-spo__alert__test.c (nonexistent) +++ head/security/barnyard2/files/patch-spo__alert__test.c (revision 490954) @@ -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); Property changes on: head/security/barnyard2/files/patch-spo__alert__test.c ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/security/barnyard2/files/patch-spo__alert__unixsock.c =================================================================== --- head/security/barnyard2/files/patch-spo__alert__unixsock.c (nonexistent) +++ head/security/barnyard2/files/patch-spo__alert__unixsock.c (revision 490954) @@ -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 + #include ++#include + + #include "decode.h" + #include "plugbase.h" Property changes on: head/security/barnyard2/files/patch-spo__alert__unixsock.c ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/security/barnyard2/files/patch-spo__database.c =================================================================== --- head/security/barnyard2/files/patch-spo__database.c (nonexistent) +++ head/security/barnyard2/files/patch-spo__database.c (revision 490954) @@ -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"); + } Property changes on: head/security/barnyard2/files/patch-spo__database.c ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/security/barnyard2/files/patch-spo__database__cache.c =================================================================== --- head/security/barnyard2/files/patch-spo__database__cache.c (nonexistent) +++ head/security/barnyard2/files/patch-spo__database__cache.c (revision 490954) @@ -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; Property changes on: head/security/barnyard2/files/patch-spo__database__cache.c ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/security/barnyard2/files/patch-spo__syslog__full.c =================================================================== --- head/security/barnyard2/files/patch-spo__syslog__full.c (nonexistent) +++ head/security/barnyard2/files/patch-spo__syslog__full.c (revision 490954) @@ -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; Property changes on: head/security/barnyard2/files/patch-spo__syslog__full.c ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/security/barnyard2/files/patch-spooler.c =================================================================== --- head/security/barnyard2/files/patch-spooler.c (nonexistent) +++ head/security/barnyard2/files/patch-spooler.c (revision 490954) @@ -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; + } Property changes on: head/security/barnyard2/files/patch-spooler.c ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property