]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
Workaround function missing in libhtp include 291/head
authorEric Leblond <eric@regit.org>
Mon, 18 Feb 2013 10:00:20 +0000 (11:00 +0100)
committerEric Leblond <eric@regit.org>
Fri, 22 Feb 2013 09:14:03 +0000 (10:14 +0100)
As reported in bug #688, htp_config_set_path_decode_u_encoding
function is not included in libhtp header before 0.3.0. Result
is that suricata compilation fail with an external htp library.
The following patch detect the issue and adds the missing
declaration.

configure.ac
src/app-layer-htp.c

index e5f0abb481fb4c6073cb6d82166ccb49d273e7f1..4098172dbce4bdc98d0993345a13fc30f68e0c9a 100644 (file)
@@ -1021,12 +1021,11 @@ AC_INIT(configure.ac)
             exit 1
         fi
 
-
-
         AC_CHECK_LIB([htp], [htp_config_register_request_uri_normalize],AC_DEFINE_UNQUOTED([HAVE_HTP_URI_NORMALIZE_HOOK],[1],[Found htp_config_register_request_uri_normalize function in libhtp]) ,,[-lhtp])
         # check for htp_tx_get_response_headers_raw
         AC_CHECK_LIB([htp], [htp_tx_get_response_headers_raw],AC_DEFINE_UNQUOTED([HAVE_HTP_TX_GET_RESPONSE_HEADERS_RAW],[1],[Found htp_tx_get_response_headers_raw in libhtp]) ,,[-lhtp])
         AC_CHECK_LIB([htp], [htp_decode_query_inplace],AC_DEFINE_UNQUOTED([HAVE_HTP_DECODE_QUERY_INPLACE],[1],[Found htp_decode_query_inplace function in libhtp]) ,,[-lhtp])
+        AC_EGREP_HEADER(htp_config_set_path_decode_u_encoding, htp/htp.h, AC_DEFINE_UNQUOTED([HAVE_HTP_SET_PATH_DECODE_U_ENCODING],[1],[Found usable htp_config_set_path_decode_u_encoding function in libhtp]) )
     ])
 
     # even if we are using an installed htp lib we still need to gen Makefiles inside of htp
index fea12a25fd0c687db0368cec90ea65a5548ce3af..67e4c34b5a515c86ce3e1378df83206d575cd809 100644 (file)
 
 #include "util-memcmp.h"
 
+#ifndef HAVE_HTP_SET_PATH_DECODE_U_ENCODING
+void htp_config_set_path_decode_u_encoding(htp_cfg_t *cfg, int decode_u_encoding);
+#endif
+
 //#define PRINT
 
 /** Fast lookup tree (radix) for the various HTP configurations */