commit:     956d614c759705691a0c336c71bc2a176e71a56f
Author:     Jeroen Roovers <jer <AT> gentoo <DOT> org>
AuthorDate: Fri Jan 31 13:29:18 2020 +0000
Commit:     Jeroen Roovers <jer <AT> gentoo <DOT> org>
CommitDate: Fri Jan 31 13:34:19 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=956d614c

net-analyzer/snort: Fix CFLAGS=-fno-common

While there, drop a couple of ineffective sed scripts.

Package-Manager: Portage-2.3.86, Repoman-2.3.20
Closes: https://bugs.gentoo.org/show_bug.cgi?id=706858
Signed-off-by: Jeroen Roovers <jer <AT> gentoo.org>

 .../snort/files/snort-2.9.15.1-fno-common.patch    | 106 +++++++++++++++++++++
 net-analyzer/snort/snort-2.9.15.1.ebuild           |  15 +--
 2 files changed, 107 insertions(+), 14 deletions(-)

diff --git a/net-analyzer/snort/files/snort-2.9.15.1-fno-common.patch 
b/net-analyzer/snort/files/snort-2.9.15.1-fno-common.patch
new file mode 100644
index 00000000000..9fe39933ddf
--- /dev/null
+++ b/net-analyzer/snort/files/snort-2.9.15.1-fno-common.patch
@@ -0,0 +1,106 @@
+--- a/src/preprocessors/Stream6/stream_paf.h
++++ b/src/preprocessors/Stream6/stream_paf.h
+@@ -68,12 +68,14 @@
+ uint16_t s5_paf_port_registration_all (void* pv, uint16_t port, bool c2s, 
bool flush);
+ uint16_t s5_paf_service_registration (void* pv, uint16_t service, bool c2s, 
bool flush);
+ 
+-enum FlushMode
++typedef enum
+ {
+     FLUSH_MODE_NORMAL = 0,
+     FLUSH_MODE_PRE_DISCARD,
+     FLUSH_MODE_DISCARD
+-}FlushMode;
++} FlushMode_t;
++
++extern FlushMode_t FlushMode;
+ 
+ typedef struct {
+     void* user[MAX_PAF_USER];      // arbitrary user data
+--- a/src/sfutil/util_jsnorm.h
++++ b/src/sfutil/util_jsnorm.h
+@@ -42,5 +42,7 @@
+     uint16_t alerts;
+ }JSState;
+ 
++extern int hex_lookup[256];
++
+ int JSNormalizeDecode(char *, uint16_t , char *, uint16_t destlen, char **, 
int *, JSState *, uint8_t *);
+ void InitJSNormLookupTable(void);
+--- a/src/preprocessors/spp_session.h
++++ b/src/preprocessors/spp_session.h
+@@ -28,6 +28,8 @@
+ #include "decode.h"
+ #include "session_common.h"
+ 
++extern PreprocStats sessionPerfStats;
++
+ /* list of function prototypes for this preprocessor */
+ void SetupSessionManager(void);
+ void SessionReload(struct _SessionCache* lws_cache, uint32_t max_sessions,
+--- a/src/preprocessors/spp_httpinspect.c
++++ b/src/preprocessors/spp_httpinspect.c
+@@ -161,7 +161,6 @@
+ MemPool *http_mempool = NULL;
+ MemPool *mime_decode_mempool = NULL;
+ MemPool *mime_log_mempool = NULL;
+-int hex_lookup[256];
+ int valid_lookup[256];
+ 
+ char** xffFields = NULL;
+--- a/src/detection-plugins/sp_session.c
++++ b/src/detection-plugins/sp_session.c
+@@ -80,7 +80,7 @@
+ #include "snort.h"
+ #include "profiler.h"
+ #ifdef PERF_PROFILING
+-PreprocStats sessionPerfStats;
++PreprocStats sp_sessionPerfStats;
+ extern PreprocStats ruleOTNEvalPerfStats;
+ #endif
+ 
+@@ -149,7 +149,7 @@
+     /* map the keyword to an initialization/processing function */
+     RegisterRuleOption("session", SessionInit, NULL, OPT_TYPE_LOGGING, NULL);
+ #ifdef PERF_PROFILING
+-    RegisterPreprocessorProfile("session", &sessionPerfStats, 3, 
&ruleOTNEvalPerfStats, NULL);
++    RegisterPreprocessorProfile("session", &sp_sessionPerfStats, 3, 
&ruleOTNEvalPerfStats, NULL);
+ #endif
+     DEBUG_WRAP(DebugMessage(DEBUG_PLUGIN, "Plugin: Session Setup\n"););
+ }
+@@ -287,7 +287,7 @@
+     FILE *session;         /* session file ptr */
+     PROFILE_VARS;
+ 
+-    PREPROC_PROFILE_START(sessionPerfStats);
++    PREPROC_PROFILE_START(sp_sessionPerfStats);
+ 
+     /* if there's data in this packet */
+     if(p != NULL)
+@@ -298,7 +298,7 @@
+ 
+              if(session == NULL)
+              {
+-                 PREPROC_PROFILE_END(sessionPerfStats);
++                 PREPROC_PROFILE_END(sp_sessionPerfStats);
+                  return DETECTION_OPTION_MATCH;
+              }
+ 
+@@ -308,7 +308,7 @@
+         }
+     }
+ 
+-    PREPROC_PROFILE_END(sessionPerfStats);
++    PREPROC_PROFILE_END(sp_sessionPerfStats);
+     return DETECTION_OPTION_MATCH;
+ }
+ 
+--- a/src/detection-plugins/sp_session.h
++++ b/src/detection-plugins/sp_session.h
+@@ -29,5 +29,6 @@
+ void SetupSession(void);
+ uint32_t SessionHash(void *d);
+ int SessionCompare(void *l, void *r);
++extern PreprocStats sp_sessionPerfStats;
+ 
+ #endif  /* __SP_SESSION_H__ */

diff --git a/net-analyzer/snort/snort-2.9.15.1.ebuild 
b/net-analyzer/snort/snort-2.9.15.1.ebuild
index 03b19a93531..21aba42de76 100644
--- a/net-analyzer/snort/snort-2.9.15.1.ebuild
+++ b/net-analyzer/snort/snort-2.9.15.1.ebuild
@@ -36,6 +36,7 @@ PATCHES=(
        "${FILESDIR}"/${PN}-2.9.8.3-no-implicit.patch
        "${FILESDIR}"/${PN}-2.9.8.3-rpc.patch
        "${FILESDIR}"/${PN}-2.9.12-snort.pc.patch
+       "${FILESDIR}"/${PN}-2.9.15.1-fno-common.patch
 )
 
 pkg_setup() {
@@ -49,20 +50,6 @@ pkg_setup() {
 src_prepare() {
        default
 
-       # Multilib fix for the sf_engine
-       ebegin "Applying multilib fix"
-       sed -i -e 's|${exec_prefix}/lib|${exec_prefix}/'$(get_libdir)'|g' \
-               "${WORKDIR}/${P}/src/dynamic-plugins/sf_engine/Makefile.am" \
-               || die "sed for sf_engine failed"
-
-       # Multilib fix for the curent set of dynamic-preprocessors
-       for i in file ftptelnet smtp ssh dns ssl dcerpc2 sdf imap pop sip 
reputation gtp modbus dnp3; do
-               sed -i -e 
's|${exec_prefix}/lib|${exec_prefix}/'$(get_libdir)'|g' \
-                       
"${WORKDIR}/${P}/src/dynamic-preprocessors/$i/Makefile.am" \
-                       || die "sed for $i failed."
-       done
-       eend
-
        mv configure.{in,ac} || die
 
        AT_M4DIR=m4 eautoreconf

Reply via email to