Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 22 Jan 2019 14:57:27 +0000 (UTC)
From:      Muhammad Moinur Rahman <bofh@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r490954 - in head/security/barnyard2: . files
Message-ID:  <201901221457.x0MEvR1V062821@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bofh
Date: Tue Jan 22 14:57:27 2019
New Revision: 490954
URL: https://svnweb.freebsd.org/changeset/ports/490954

Log:
  security/barnyard2: fix compile with ooption BRO
  
  PR:		231265
  Submitted by:	freebsd@onyphe.io

Added:
  head/security/barnyard2/files/patch-decode.c   (contents, props changed)
  head/security/barnyard2/files/patch-map.c   (contents, props changed)
  head/security/barnyard2/files/patch-parser.c   (contents, props changed)
  head/security/barnyard2/files/patch-spo__alert__fwsam.c   (contents, props changed)
  head/security/barnyard2/files/patch-spo__alert__test.c   (contents, props changed)
  head/security/barnyard2/files/patch-spo__alert__unixsock.c   (contents, props changed)
  head/security/barnyard2/files/patch-spo__database.c   (contents, props changed)
  head/security/barnyard2/files/patch-spo__database__cache.c   (contents, props changed)
  head/security/barnyard2/files/patch-spo__syslog__full.c   (contents, props changed)
  head/security/barnyard2/files/patch-spooler.c   (contents, props changed)
Modified:
  head/security/barnyard2/Makefile

Modified: head/security/barnyard2/Makefile
==============================================================================
--- head/security/barnyard2/Makefile	Tue Jan 22 14:44:38 2019	(r490953)
+++ head/security/barnyard2/Makefile	Tue Jan 22 14:57:27 2019	(r490954)
@@ -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 
 
 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=${LOCA
 .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
 

Added: head/security/barnyard2/files/patch-decode.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/security/barnyard2/files/patch-decode.c	Tue Jan 22 14:57:27 2019	(r490954)
@@ -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*)

Added: head/security/barnyard2/files/patch-map.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/security/barnyard2/files/patch-map.c	Tue Jan 22 14:57:27 2019	(r490954)
@@ -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__,

Added: head/security/barnyard2/files/patch-parser.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/security/barnyard2/files/patch-parser.c	Tue Jan 22 14:57:27 2019	(r490954)
@@ -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)
+ 		{

Added: head/security/barnyard2/files/patch-spo__alert__fwsam.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/security/barnyard2/files/patch-spo__alert__fwsam.c	Tue Jan 22 14:57:27 2019	(r490954)
@@ -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 */

Added: head/security/barnyard2/files/patch-spo__alert__test.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/security/barnyard2/files/patch-spo__alert__test.c	Tue Jan 22 14:57:27 2019	(r490954)
@@ -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);

Added: head/security/barnyard2/files/patch-spo__alert__unixsock.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/security/barnyard2/files/patch-spo__alert__unixsock.c	Tue Jan 22 14:57:27 2019	(r490954)
@@ -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"

Added: head/security/barnyard2/files/patch-spo__database.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/security/barnyard2/files/patch-spo__database.c	Tue Jan 22 14:57:27 2019	(r490954)
@@ -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");
+     }

Added: head/security/barnyard2/files/patch-spo__database__cache.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/security/barnyard2/files/patch-spo__database__cache.c	Tue Jan 22 14:57:27 2019	(r490954)
@@ -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;

Added: head/security/barnyard2/files/patch-spo__syslog__full.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/security/barnyard2/files/patch-spo__syslog__full.c	Tue Jan 22 14:57:27 2019	(r490954)
@@ -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;

Added: head/security/barnyard2/files/patch-spooler.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/security/barnyard2/files/patch-spooler.c	Tue Jan 22 14:57:27 2019	(r490954)
@@ -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;
+     }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201901221457.x0MEvR1V062821>