1 |
commit: 956d614c759705691a0c336c71bc2a176e71a56f |
2 |
Author: Jeroen Roovers <jer <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Jan 31 13:29:18 2020 +0000 |
4 |
Commit: Jeroen Roovers <jer <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Jan 31 13:34:19 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=956d614c |
7 |
|
8 |
net-analyzer/snort: Fix CFLAGS=-fno-common |
9 |
|
10 |
While there, drop a couple of ineffective sed scripts. |
11 |
|
12 |
Package-Manager: Portage-2.3.86, Repoman-2.3.20 |
13 |
Closes: https://bugs.gentoo.org/show_bug.cgi?id=706858 |
14 |
Signed-off-by: Jeroen Roovers <jer <AT> gentoo.org> |
15 |
|
16 |
.../snort/files/snort-2.9.15.1-fno-common.patch | 106 +++++++++++++++++++++ |
17 |
net-analyzer/snort/snort-2.9.15.1.ebuild | 15 +-- |
18 |
2 files changed, 107 insertions(+), 14 deletions(-) |
19 |
|
20 |
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 |
21 |
new file mode 100644 |
22 |
index 00000000000..9fe39933ddf |
23 |
--- /dev/null |
24 |
+++ b/net-analyzer/snort/files/snort-2.9.15.1-fno-common.patch |
25 |
@@ -0,0 +1,106 @@ |
26 |
+--- a/src/preprocessors/Stream6/stream_paf.h |
27 |
++++ b/src/preprocessors/Stream6/stream_paf.h |
28 |
+@@ -68,12 +68,14 @@ |
29 |
+ uint16_t s5_paf_port_registration_all (void* pv, uint16_t port, bool c2s, bool flush); |
30 |
+ uint16_t s5_paf_service_registration (void* pv, uint16_t service, bool c2s, bool flush); |
31 |
+ |
32 |
+-enum FlushMode |
33 |
++typedef enum |
34 |
+ { |
35 |
+ FLUSH_MODE_NORMAL = 0, |
36 |
+ FLUSH_MODE_PRE_DISCARD, |
37 |
+ FLUSH_MODE_DISCARD |
38 |
+-}FlushMode; |
39 |
++} FlushMode_t; |
40 |
++ |
41 |
++extern FlushMode_t FlushMode; |
42 |
+ |
43 |
+ typedef struct { |
44 |
+ void* user[MAX_PAF_USER]; // arbitrary user data |
45 |
+--- a/src/sfutil/util_jsnorm.h |
46 |
++++ b/src/sfutil/util_jsnorm.h |
47 |
+@@ -42,5 +42,7 @@ |
48 |
+ uint16_t alerts; |
49 |
+ }JSState; |
50 |
+ |
51 |
++extern int hex_lookup[256]; |
52 |
++ |
53 |
+ int JSNormalizeDecode(char *, uint16_t , char *, uint16_t destlen, char **, int *, JSState *, uint8_t *); |
54 |
+ void InitJSNormLookupTable(void); |
55 |
+--- a/src/preprocessors/spp_session.h |
56 |
++++ b/src/preprocessors/spp_session.h |
57 |
+@@ -28,6 +28,8 @@ |
58 |
+ #include "decode.h" |
59 |
+ #include "session_common.h" |
60 |
+ |
61 |
++extern PreprocStats sessionPerfStats; |
62 |
++ |
63 |
+ /* list of function prototypes for this preprocessor */ |
64 |
+ void SetupSessionManager(void); |
65 |
+ void SessionReload(struct _SessionCache* lws_cache, uint32_t max_sessions, |
66 |
+--- a/src/preprocessors/spp_httpinspect.c |
67 |
++++ b/src/preprocessors/spp_httpinspect.c |
68 |
+@@ -161,7 +161,6 @@ |
69 |
+ MemPool *http_mempool = NULL; |
70 |
+ MemPool *mime_decode_mempool = NULL; |
71 |
+ MemPool *mime_log_mempool = NULL; |
72 |
+-int hex_lookup[256]; |
73 |
+ int valid_lookup[256]; |
74 |
+ |
75 |
+ char** xffFields = NULL; |
76 |
+--- a/src/detection-plugins/sp_session.c |
77 |
++++ b/src/detection-plugins/sp_session.c |
78 |
+@@ -80,7 +80,7 @@ |
79 |
+ #include "snort.h" |
80 |
+ #include "profiler.h" |
81 |
+ #ifdef PERF_PROFILING |
82 |
+-PreprocStats sessionPerfStats; |
83 |
++PreprocStats sp_sessionPerfStats; |
84 |
+ extern PreprocStats ruleOTNEvalPerfStats; |
85 |
+ #endif |
86 |
+ |
87 |
+@@ -149,7 +149,7 @@ |
88 |
+ /* map the keyword to an initialization/processing function */ |
89 |
+ RegisterRuleOption("session", SessionInit, NULL, OPT_TYPE_LOGGING, NULL); |
90 |
+ #ifdef PERF_PROFILING |
91 |
+- RegisterPreprocessorProfile("session", &sessionPerfStats, 3, &ruleOTNEvalPerfStats, NULL); |
92 |
++ RegisterPreprocessorProfile("session", &sp_sessionPerfStats, 3, &ruleOTNEvalPerfStats, NULL); |
93 |
+ #endif |
94 |
+ DEBUG_WRAP(DebugMessage(DEBUG_PLUGIN, "Plugin: Session Setup\n");); |
95 |
+ } |
96 |
+@@ -287,7 +287,7 @@ |
97 |
+ FILE *session; /* session file ptr */ |
98 |
+ PROFILE_VARS; |
99 |
+ |
100 |
+- PREPROC_PROFILE_START(sessionPerfStats); |
101 |
++ PREPROC_PROFILE_START(sp_sessionPerfStats); |
102 |
+ |
103 |
+ /* if there's data in this packet */ |
104 |
+ if(p != NULL) |
105 |
+@@ -298,7 +298,7 @@ |
106 |
+ |
107 |
+ if(session == NULL) |
108 |
+ { |
109 |
+- PREPROC_PROFILE_END(sessionPerfStats); |
110 |
++ PREPROC_PROFILE_END(sp_sessionPerfStats); |
111 |
+ return DETECTION_OPTION_MATCH; |
112 |
+ } |
113 |
+ |
114 |
+@@ -308,7 +308,7 @@ |
115 |
+ } |
116 |
+ } |
117 |
+ |
118 |
+- PREPROC_PROFILE_END(sessionPerfStats); |
119 |
++ PREPROC_PROFILE_END(sp_sessionPerfStats); |
120 |
+ return DETECTION_OPTION_MATCH; |
121 |
+ } |
122 |
+ |
123 |
+--- a/src/detection-plugins/sp_session.h |
124 |
++++ b/src/detection-plugins/sp_session.h |
125 |
+@@ -29,5 +29,6 @@ |
126 |
+ void SetupSession(void); |
127 |
+ uint32_t SessionHash(void *d); |
128 |
+ int SessionCompare(void *l, void *r); |
129 |
++extern PreprocStats sp_sessionPerfStats; |
130 |
+ |
131 |
+ #endif /* __SP_SESSION_H__ */ |
132 |
|
133 |
diff --git a/net-analyzer/snort/snort-2.9.15.1.ebuild b/net-analyzer/snort/snort-2.9.15.1.ebuild |
134 |
index 03b19a93531..21aba42de76 100644 |
135 |
--- a/net-analyzer/snort/snort-2.9.15.1.ebuild |
136 |
+++ b/net-analyzer/snort/snort-2.9.15.1.ebuild |
137 |
@@ -36,6 +36,7 @@ PATCHES=( |
138 |
"${FILESDIR}"/${PN}-2.9.8.3-no-implicit.patch |
139 |
"${FILESDIR}"/${PN}-2.9.8.3-rpc.patch |
140 |
"${FILESDIR}"/${PN}-2.9.12-snort.pc.patch |
141 |
+ "${FILESDIR}"/${PN}-2.9.15.1-fno-common.patch |
142 |
) |
143 |
|
144 |
pkg_setup() { |
145 |
@@ -49,20 +50,6 @@ pkg_setup() { |
146 |
src_prepare() { |
147 |
default |
148 |
|
149 |
- # Multilib fix for the sf_engine |
150 |
- ebegin "Applying multilib fix" |
151 |
- sed -i -e 's|${exec_prefix}/lib|${exec_prefix}/'$(get_libdir)'|g' \ |
152 |
- "${WORKDIR}/${P}/src/dynamic-plugins/sf_engine/Makefile.am" \ |
153 |
- || die "sed for sf_engine failed" |
154 |
- |
155 |
- # Multilib fix for the curent set of dynamic-preprocessors |
156 |
- for i in file ftptelnet smtp ssh dns ssl dcerpc2 sdf imap pop sip reputation gtp modbus dnp3; do |
157 |
- sed -i -e 's|${exec_prefix}/lib|${exec_prefix}/'$(get_libdir)'|g' \ |
158 |
- "${WORKDIR}/${P}/src/dynamic-preprocessors/$i/Makefile.am" \ |
159 |
- || die "sed for $i failed." |
160 |
- done |
161 |
- eend |
162 |
- |
163 |
mv configure.{in,ac} || die |
164 |
|
165 |
AT_M4DIR=m4 eautoreconf |