From: Jason Ish Date: Wed, 1 May 2024 20:44:52 +0000 (-0600) Subject: lua: remove lua as a compile time feature X-Git-Tag: suricata-8.0.0-beta1~1257 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2e440169d674ecd370f9f98224643da440c0ef36;p=thirdparty%2Fsuricata.git lua: remove lua as a compile time feature Its always built-in. However, can be disabled at runtime. --- diff --git a/.github/workflows/build-centos-7.yml b/.github/workflows/build-centos-7.yml index c1d55bd026..9a1d680360 100644 --- a/.github/workflows/build-centos-7.yml +++ b/.github/workflows/build-centos-7.yml @@ -168,7 +168,7 @@ jobs: git -c advice.detachedHead=false checkout FETCH_HEAD - run: ./autogen.sh - - run: ./configure --enable-warnings --disable-lua + - run: ./configure --enable-warnings - run: make -j ${{ env.CPUS }} - run: python3 ./suricata-verify/run.py -q --debug-failed - run: make install-full diff --git a/.github/workflows/commits.yml b/.github/workflows/commits.yml index 5a5a7b1fd3..6ef42507e3 100644 --- a/.github/workflows/commits.yml +++ b/.github/workflows/commits.yml @@ -88,7 +88,7 @@ jobs: git checkout $rev echo "Building rev ${rev}" | tee -a build_log.txt ./autogen.sh >> build_log.txt 2>&1 - CC="sccache gcc" ./configure --enable-warnings --enable-unittests --disable-lua >> build_log.txt 2>&1 + CC="sccache gcc" ./configure --enable-warnings --enable-unittests >> build_log.txt 2>&1 if ! make -j2 >> build_log.txt 2>&1; then echo "::error ::Failed to build rev ${rev}" tail -n 50 build_log.txt diff --git a/.github/workflows/formatting.yml b/.github/workflows/formatting.yml index ebfa464ae9..4758b1af44 100644 --- a/.github/workflows/formatting.yml +++ b/.github/workflows/formatting.yml @@ -130,7 +130,7 @@ jobs: shell: bash {0} - run: git clone https://github.com/OISF/libhtp -b 0.5.x - run: ./autogen.sh - - run: ./configure --enable-warnings --enable-unittests --disable-lua + - run: ./configure --enable-warnings --enable-unittests - name: Check formatting run: | ./scripts/clang-format.sh check-branch --diffstat --show-commits >> check_formatting_log.txt 2>&1 diff --git a/configure.ac b/configure.ac index c58cf7d869..daad418208 100644 --- a/configure.ac +++ b/configure.ac @@ -1871,11 +1871,6 @@ fi fi - # Lua support, always enabled - # TODO: Update the code to not require this. - AC_DEFINE([HAVE_LUA], [1], [lua support available]) - AM_CONDITIONAL([HAVE_LUA], [true]) - # libmaxminddb AC_ARG_ENABLE(geoip, AS_HELP_STRING([--enable-geoip],[Enable GeoIP2 support]), @@ -2502,7 +2497,6 @@ SURICATA_BUILD_CONF="Suricata Configuration: hiredis support: ${enable_hiredis} hiredis async with libevent: ${enable_hiredis_async} PCRE jit: ${pcre2_jit_available} - LUA support: ${enable_lua} GeoIP2 support: ${enable_geoip} JA3 support: ${enable_ja3} JA4 support: ${enable_ja4} diff --git a/rust/Cargo.toml.in b/rust/Cargo.toml.in index 65f2a7523a..bb1553b5ca 100644 --- a/rust/Cargo.toml.in +++ b/rust/Cargo.toml.in @@ -17,7 +17,6 @@ name = "suricata" debug = true [features] -lua = [] strict = [] debug = [] debug-validate = [] diff --git a/rust/Makefile.am b/rust/Makefile.am index b90d0332f5..410dab7609 100644 --- a/rust/Makefile.am +++ b/rust/Makefile.am @@ -14,10 +14,6 @@ if RUST_BUILD_STD NIGHTLY_ARGS = -Z build-std endif -if HAVE_LUA -RUST_FEATURES += lua $(LUA_INT8) -endif - if HAVE_JA3 RUST_FEATURES += ja3 endif diff --git a/rust/src/dns/mod.rs b/rust/src/dns/mod.rs index b0ca00ffc9..3a572a8211 100644 --- a/rust/src/dns/mod.rs +++ b/rust/src/dns/mod.rs @@ -21,6 +21,4 @@ pub mod detect; pub mod dns; pub mod log; pub mod parser; - -#[cfg(feature = "lua")] pub mod lua; diff --git a/rust/src/lib.rs b/rust/src/lib.rs index 0b705d3c3f..01a4b9352e 100644 --- a/rust/src/lib.rs +++ b/rust/src/lib.rs @@ -86,7 +86,6 @@ pub mod detect; pub mod ja4; -#[cfg(feature = "lua")] pub mod lua; pub mod dns; diff --git a/rust/src/nfs/mod.rs b/rust/src/nfs/mod.rs index 2f6fe84df9..6efa61096a 100644 --- a/rust/src/nfs/mod.rs +++ b/rust/src/nfs/mod.rs @@ -28,6 +28,3 @@ pub mod nfs2; pub mod nfs3; pub mod nfs4; pub mod log; - -//#[cfg(feature = "lua")] -//pub mod lua; diff --git a/rust/src/smb/mod.rs b/rust/src/smb/mod.rs index 5b74f1ca4e..18ceef5bd9 100644 --- a/rust/src/smb/mod.rs +++ b/rust/src/smb/mod.rs @@ -42,6 +42,3 @@ pub mod events; pub mod auth; pub mod files; pub mod funcs; - -//#[cfg(feature = "lua")] -//pub mod lua; diff --git a/scripts/dnp3-gen/dnp3-gen.py b/scripts/dnp3-gen/dnp3-gen.py index 3c14f1eb9c..53341074d7 100755 --- a/scripts/dnp3-gen/dnp3-gen.py +++ b/scripts/dnp3-gen/dnp3-gen.py @@ -59,8 +59,6 @@ util_lua_dnp3_objects_c_template = """/* Copyright (C) 2015 Open Information Sec #include "app-layer-dnp3.h" #include "app-layer-dnp3-objects.h" -#ifdef HAVE_LUA - #include #include #include @@ -120,8 +118,6 @@ void DNP3PushPoint(lua_State *luastate, DNP3Object *object, } } -#endif /* HAVE_LUA */ - """ output_json_dnp3_objects_template = """/* Copyright (C) 2015 Open Information Security Foundation diff --git a/src/detect-dns-query.c b/src/detect-dns-query.c index 2cf0f7610f..ef510f1528 100644 --- a/src/detect-dns-query.c +++ b/src/detect-dns-query.c @@ -116,7 +116,6 @@ void DetectDnsQueryRegister (void) g_dns_query_buffer_id = DetectBufferTypeGetByName("dns_query"); -#ifdef HAVE_LUA /* register these generic engines from here for now */ DetectAppLayerInspectEngineRegister( "dns_request", ALPROTO_DNS, SIG_FLAG_TOSERVER, 1, DetectEngineInspectGenericList, NULL); @@ -125,9 +124,7 @@ void DetectDnsQueryRegister (void) DetectBufferTypeSetDescriptionByName("dns_request", "dns requests"); - DetectBufferTypeSetDescriptionByName("dns_response", - "dns responses"); -#endif + DetectBufferTypeSetDescriptionByName("dns_response", "dns responses"); } diff --git a/src/detect-engine-content-inspection.c b/src/detect-engine-content-inspection.c index a4fa5c72b7..0e78d4ae85 100644 --- a/src/detect-engine-content-inspection.c +++ b/src/detect-engine-content-inspection.c @@ -62,9 +62,7 @@ #include "util-unittest-helper.h" #include "util-profiling.h" -#ifdef HAVE_LUA #include "util-lua.h" -#endif #ifdef UNITTESTS thread_local uint32_t ut_inspection_recursion_counter = 0; @@ -650,7 +648,6 @@ static int DetectEngineContentInspectionInternal(DetectEngineThreadCtx *det_ctx, goto match; } goto no_match_discontinue; -#ifdef HAVE_LUA } else if (smd->type == DETECT_LUA) { SCLogDebug("lua starting"); @@ -663,7 +660,6 @@ static int DetectEngineContentInspectionInternal(DetectEngineThreadCtx *det_ctx, } SCLogDebug("lua match"); goto match; -#endif /* HAVE_LUA */ } else if (smd->type == DETECT_BASE64_DECODE) { if (DetectBase64DecodeDoMatch(det_ctx, s, smd, buffer, buffer_len)) { if (s->sm_arrays[DETECT_SM_LIST_BASE64_DATA] != NULL) { diff --git a/src/detect-lua-extensions.c b/src/detect-lua-extensions.c index da4ec8b583..aa2d7a3ae6 100644 --- a/src/detect-lua-extensions.c +++ b/src/detect-lua-extensions.c @@ -59,8 +59,6 @@ #include "app-layer-parser.h" -#ifdef HAVE_LUA - #include "util-lua.h" #include "util-lua-common.h" #include "util-lua-http.h" @@ -591,5 +589,3 @@ int LuaRegisterExtensions(lua_State *lua_state) LuaRegisterDNP3Functions(lua_state); return 0; } - -#endif /* HAVE_LUA */ diff --git a/src/detect-lua-extensions.h b/src/detect-lua-extensions.h index 24b0e8657e..5923108735 100644 --- a/src/detect-lua-extensions.h +++ b/src/detect-lua-extensions.h @@ -24,11 +24,9 @@ #ifndef SURICATA_DETECT_LUA_EXT_H #define SURICATA_DETECT_LUA_EXT_H -#ifdef HAVE_LUA int LuaRegisterExtensions(lua_State *); void LuaExtensionsMatchSetup(lua_State *lua_state, DetectLuaData *, DetectEngineThreadCtx *det_ctx, Flow *f, Packet *p, const Signature *s, uint8_t flags); -#endif /* HAVE_LUA */ #endif diff --git a/src/detect-lua.c b/src/detect-lua.c index 7e2343d07c..07ebe57e53 100644 --- a/src/detect-lua.c +++ b/src/detect-lua.c @@ -56,32 +56,6 @@ #include "util-var-name.h" -#ifndef HAVE_LUA - -static int DetectLuaSetupNoSupport (DetectEngineCtx *a, Signature *b, const char *c) -{ - SCLogError("no Lua support built in, needed for lua keyword"); - return -1; -} - -/** - * \brief Registration function for keyword: lua - */ -void DetectLuaRegister(void) -{ - sigmatch_table[DETECT_LUA].name = "lua"; - sigmatch_table[DETECT_LUA].desc = "support for lua scripting"; - sigmatch_table[DETECT_LUA].url = "/rules/rule-lua-scripting.html"; - sigmatch_table[DETECT_LUA].Setup = DetectLuaSetupNoSupport; - sigmatch_table[DETECT_LUA].Free = NULL; - sigmatch_table[DETECT_LUA].flags = SIGMATCH_NOT_BUILT; - - SCLogDebug("registering lua rule option"); - return; -} - -#else /* HAVE_LUA */ - #include "util-lua.h" #include "util-lua-sandbox.h" @@ -2448,4 +2422,3 @@ void DetectLuaRegisterTests(void) UtRegisterTest("LuaMatchTest06a", LuaMatchTest06a); } #endif -#endif /* HAVE_LUA */ diff --git a/src/detect-lua.h b/src/detect-lua.h index 34762b2901..b2ab6b9df5 100644 --- a/src/detect-lua.h +++ b/src/detect-lua.h @@ -24,8 +24,6 @@ #ifndef SURICATA_DETECT_LUA_H #define SURICATA_DETECT_LUA_H -#ifdef HAVE_LUA - #include "util-lua.h" #include "util-lua-sandbox.h" @@ -60,8 +58,6 @@ typedef struct DetectLuaData { int allow_restricted_functions; } DetectLuaData; -#endif /* HAVE_LUA */ - /* prototypes */ void DetectLuaRegister (void); int DetectLuaMatchBuffer(DetectEngineThreadCtx *det_ctx, diff --git a/src/detect-parse.c b/src/detect-parse.c index fc5e4f6579..4d159a8832 100644 --- a/src/detect-parse.c +++ b/src/detect-parse.c @@ -2076,9 +2076,7 @@ static int SigValidate(DetectEngineCtx *de_ctx, Signature *s) } } } -#ifdef HAVE_LUA DetectLuaPostSetup(s); -#endif if ((s->init_data->init_flags & SIG_FLAG_INIT_JA) && s->alproto != ALPROTO_UNKNOWN && s->alproto != ALPROTO_TLS && s->alproto != ALPROTO_QUIC) { diff --git a/src/output-lua.c b/src/output-lua.c index d2f35e8053..8e42043e36 100644 --- a/src/output-lua.c +++ b/src/output-lua.c @@ -25,7 +25,6 @@ #include "suricata-common.h" #include "output-lua.h" -#ifdef HAVE_LUA #include "util-print.h" #include "util-unittest.h" #include "util-debug.h" @@ -888,11 +887,3 @@ void LuaLogRegister(void) { /* register as separate module */ OutputRegisterModule(MODULE_NAME, "lua", OutputLuaLogInit); } - -#else /* HAVE_LUA */ - -void LuaLogRegister (void) { - /* no-op */ -} - -#endif /* HAVE_LUA */ diff --git a/src/runmodes.c b/src/runmodes.c index fb489973ac..a8bfea0309 100644 --- a/src/runmodes.c +++ b/src/runmodes.c @@ -829,13 +829,6 @@ void RunModeInitializeOutputs(void) } else if (strncmp(output->val, "unified2-", sizeof("unified2-") - 1) == 0) { SCLogWarning("Unified2 is no longer supported."); continue; - } else if (strcmp(output->val, "lua") == 0) { -#ifndef HAVE_LUA - SCLogWarning("lua support not compiled in. Reconfigure/" - "recompile with lua(jit) and its development " - "files installed to add lua support."); - continue; -#endif } else if (strcmp(output->val, "dns-log") == 0) { SCLogWarning("dns-log is not longer available as of Suricata 5.0"); continue; diff --git a/src/suricata.c b/src/suricata.c index e29a3a0177..48a51b815f 100644 --- a/src/suricata.c +++ b/src/suricata.c @@ -740,9 +740,8 @@ static void PrintBuildInfo(void) strlcat(features, "HAVE_NSS ", sizeof(features)); /* HTTP2_DECOMPRESSION is not an optional feature in this major version */ strlcat(features, "HTTP2_DECOMPRESSION ", sizeof(features)); -#ifdef HAVE_LUA + /* Lua is now vendored in and always available. */ strlcat(features, "HAVE_LUA ", sizeof(features)); -#endif #ifdef HAVE_JA3 strlcat(features, "HAVE_JA3 ", sizeof(features)); #endif diff --git a/src/util-lua-common.c b/src/util-lua-common.c index 0be1f5071f..0d6b173e2c 100644 --- a/src/util-lua-common.c +++ b/src/util-lua-common.c @@ -48,8 +48,6 @@ #include "util-time.h" #include "util-conf.h" -#ifdef HAVE_LUA - #include #include #include @@ -1004,7 +1002,4 @@ int LuaStateNeedProto(lua_State *luastate, AppProto alproto) flow_alproto = flow->alproto; return (alproto == flow_alproto); - } - -#endif /* HAVE_LUA */ diff --git a/src/util-lua-common.h b/src/util-lua-common.h index c7a23a0430..5d6ea41f4b 100644 --- a/src/util-lua-common.h +++ b/src/util-lua-common.h @@ -24,8 +24,6 @@ #ifndef SURICATA_UTIL_LUA_COMMON_H #define SURICATA_UTIL_LUA_COMMON_H -#ifdef HAVE_LUA - int LuaCallbackError(lua_State *luastate, const char *msg); const char *LuaGetStringArgument(lua_State *luastate, int argc); @@ -37,6 +35,4 @@ int LuaRegisterFunctions(lua_State *luastate); int LuaStateNeedProto(lua_State *luastate, AppProto alproto); -#endif /* HAVE_LUA */ - #endif /* SURICATA_UTIL_LUA_COMMON_H */ diff --git a/src/util-lua-dnp3-objects.c b/src/util-lua-dnp3-objects.c index 27bbc53519..ae3bac9eb4 100644 --- a/src/util-lua-dnp3-objects.c +++ b/src/util-lua-dnp3-objects.c @@ -27,8 +27,6 @@ #include "app-layer-dnp3.h" #include "app-layer-dnp3-objects.h" -#ifdef HAVE_LUA - #include #include #include @@ -3539,5 +3537,3 @@ void DNP3PushPoint(lua_State *luastate, DNP3Object *object, break; } } - -#endif /* HAVE_LUA */ diff --git a/src/util-lua-dnp3.c b/src/util-lua-dnp3.c index 09f8694d6c..39602a74a3 100644 --- a/src/util-lua-dnp3.c +++ b/src/util-lua-dnp3.c @@ -20,8 +20,6 @@ #include "app-layer-dnp3.h" #include "app-layer-dnp3-objects.h" -#ifdef HAVE_LUA - #include #include #include @@ -197,5 +195,3 @@ int LuaRegisterDNP3Functions(lua_State *luastate) return 0; } - -#endif /* HAVE_LUA */ diff --git a/src/util-lua-dnp3.h b/src/util-lua-dnp3.h index 4b656599f0..a594fbfbe8 100644 --- a/src/util-lua-dnp3.h +++ b/src/util-lua-dnp3.h @@ -18,10 +18,6 @@ #ifndef SURICATA_UTIL_LUA_DNP3_H #define SURICATA_UTIL_LUA_DNP3_H -#ifdef HAVE_LUA - int LuaRegisterDNP3Functions(lua_State *); -#endif /* HAVE_LUA */ - #endif /* !SURICATA_UTIL_LUA_DNP3_H */ diff --git a/src/util-lua-dns.c b/src/util-lua-dns.c index 3d19d9308e..b1eafbb0eb 100644 --- a/src/util-lua-dns.c +++ b/src/util-lua-dns.c @@ -47,8 +47,6 @@ #include "util-time.h" #include "rust.h" -#ifdef HAVE_LUA - #include #include #include @@ -158,5 +156,3 @@ int LuaRegisterDnsFunctions(lua_State *luastate) lua_setglobal(luastate, "DnsGetRecursionDesired"); return 0; } - -#endif /* HAVE_LUA */ diff --git a/src/util-lua-dns.h b/src/util-lua-dns.h index f9bdc0b290..99566cabf1 100644 --- a/src/util-lua-dns.h +++ b/src/util-lua-dns.h @@ -24,10 +24,6 @@ #ifndef SURICATA_UTIL_LUA_DNS_H #define SURICATA_UTIL_LUA_DNS_H -#ifdef HAVE_LUA - int LuaRegisterDnsFunctions(lua_State *luastate); -#endif /* HAVE_LUA */ - #endif /* __UTIL_LUA_HTTP_H__ */ diff --git a/src/util-lua-hassh.c b/src/util-lua-hassh.c index 631268d1b4..d259470122 100644 --- a/src/util-lua-hassh.c +++ b/src/util-lua-hassh.c @@ -47,8 +47,6 @@ #include "util-logopenfile.h" #include "util-time.h" -#ifdef HAVE_LUA - #include #include #include @@ -215,5 +213,3 @@ int LuaRegisterHasshFunctions(lua_State *luastate) return 0; } - -#endif /* HAVE_LUA */ diff --git a/src/util-lua-hassh.h b/src/util-lua-hassh.h index 733233542e..d5156663e3 100644 --- a/src/util-lua-hassh.h +++ b/src/util-lua-hassh.h @@ -24,10 +24,6 @@ #ifndef SURICATA_UTIL_LUA_HASSH_H #define SURICATA_UTIL_LUA_HASSH_H -#ifdef HAVE_LUA - int LuaRegisterHasshFunctions(lua_State *luastate); -#endif /* HAVE_LUA */ - #endif /* SURICATA_UTIL_LUA_HASSH_H */ diff --git a/src/util-lua-http.c b/src/util-lua-http.c index e04c168fa6..2a52afb46b 100644 --- a/src/util-lua-http.c +++ b/src/util-lua-http.c @@ -46,8 +46,6 @@ #include "util-logopenfile.h" #include "util-time.h" -#ifdef HAVE_LUA - #include #include #include @@ -349,5 +347,3 @@ int LuaRegisterHttpFunctions(lua_State *luastate) lua_setglobal(luastate, "HttpGetResponseBody"); return 0; } - -#endif /* HAVE_LUA */ diff --git a/src/util-lua-http.h b/src/util-lua-http.h index 1e44c8599f..d6b0d43b75 100644 --- a/src/util-lua-http.h +++ b/src/util-lua-http.h @@ -24,10 +24,6 @@ #ifndef SURICATA_UTIL_LUA_HTTP_H #define SURICATA_UTIL_LUA_HTTP_H -#ifdef HAVE_LUA - int LuaRegisterHttpFunctions(lua_State *luastate); -#endif /* HAVE_LUA */ - #endif /* SURICATA_UTIL_LUA_HTTP_H */ diff --git a/src/util-lua-ja3.c b/src/util-lua-ja3.c index 1faed68f56..cdb508fcf6 100644 --- a/src/util-lua-ja3.c +++ b/src/util-lua-ja3.c @@ -47,8 +47,6 @@ #include "util-logopenfile.h" #include "util-time.h" -#ifdef HAVE_LUA - #include #include #include @@ -168,5 +166,3 @@ int LuaRegisterJa3Functions(lua_State *luastate) return 0; } - -#endif /* HAVE_LUA */ diff --git a/src/util-lua-ja3.h b/src/util-lua-ja3.h index 84deb160a7..0bbbb666b2 100644 --- a/src/util-lua-ja3.h +++ b/src/util-lua-ja3.h @@ -24,10 +24,6 @@ #ifndef SURICATA_UTIL_LUA_JA3_H #define SURICATA_UTIL_LUA_JA3_H -#ifdef HAVE_LUA - int LuaRegisterJa3Functions(lua_State *luastate); -#endif /* HAVE_LUA */ - #endif /* SURICATA_UTIL_LUA_JA3_H */ diff --git a/src/util-lua-sandbox.c b/src/util-lua-sandbox.c index 2cb5ae2b7b..49e2b7969e 100644 --- a/src/util-lua-sandbox.c +++ b/src/util-lua-sandbox.c @@ -23,22 +23,15 @@ #include "suricata-common.h" -#ifdef HAVE_LUA - -#include -#include -#include - #include "lua.h" - #include "lauxlib.h" #include "lualib.h" +#include "util-debug.h" +#include "util-validate.h" #include "util-lua-sandbox.h" -#if !defined(SANDBOX_ALLOC_CTX) #define SANDBOX_CTX "SANDBOX_CTX" -#endif typedef struct BlockedFunction { const char *module; @@ -66,6 +59,7 @@ static void *LuaAlloc(void *ud, void *ptr, size_t osize, size_t nsize) if (nsize == 0) { if (ptr != NULL) { // ASSERT: alloc_bytes > osize + DEBUG_VALIDATE_BUG_ON(ctx->alloc_bytes < osize); ctx->alloc_bytes -= osize; } SCFree(ptr); @@ -334,5 +328,3 @@ static int OpenSandbox(lua_State *L) luaL_newlib(L, sblib); return 1; } - -#endif diff --git a/src/util-lua-smtp.c b/src/util-lua-smtp.c index a0ecf815d9..e8e3eb7aaa 100644 --- a/src/util-lua-smtp.c +++ b/src/util-lua-smtp.c @@ -36,8 +36,6 @@ #include "app-layer-smtp.h" -#ifdef HAVE_LUA - #include #include @@ -338,5 +336,3 @@ int LuaRegisterSmtpFunctions(lua_State *luastate) return 0; } - -#endif /* HAVE_LUA */ diff --git a/src/util-lua-smtp.h b/src/util-lua-smtp.h index 6c695051c3..8172a663f9 100644 --- a/src/util-lua-smtp.h +++ b/src/util-lua-smtp.h @@ -18,10 +18,6 @@ #ifndef SURICATA_UTIL_LUA_SMTP_H #define SURICATA_UTIL_LUA_SMTP_H -#ifdef HAVE_LUA - int LuaRegisterSmtpFunctions(lua_State *luastate); -#endif /* HAVE_LUA */ - #endif /* SURICATA_UTIL_LUA_SMTP_H */ diff --git a/src/util-lua-ssh.c b/src/util-lua-ssh.c index 266d3df860..ba9c516dad 100644 --- a/src/util-lua-ssh.c +++ b/src/util-lua-ssh.c @@ -48,8 +48,6 @@ #include "util-time.h" #include "rust.h" -#ifdef HAVE_LUA - #include #include #include @@ -215,5 +213,3 @@ int LuaRegisterSshFunctions(lua_State *luastate) return 0; } - -#endif /* HAVE_LUA */ diff --git a/src/util-lua-ssh.h b/src/util-lua-ssh.h index 88f9972175..c36ef105ac 100644 --- a/src/util-lua-ssh.h +++ b/src/util-lua-ssh.h @@ -24,10 +24,6 @@ #ifndef SURICATA_UTIL_LUA_SSH_H #define SURICATA_UTIL_LUA_SSH_H -#ifdef HAVE_LUA - int LuaRegisterSshFunctions(lua_State *luastate); -#endif /* HAVE_LUA */ - #endif /* SURICATA_UTIL_LUA_SSH_H */ diff --git a/src/util-lua-tls.c b/src/util-lua-tls.c index 9413f42965..698e50acd9 100644 --- a/src/util-lua-tls.c +++ b/src/util-lua-tls.c @@ -47,8 +47,6 @@ #include "util-logopenfile.h" #include "util-time.h" -#ifdef HAVE_LUA - #include #include #include @@ -363,5 +361,3 @@ int LuaRegisterTlsFunctions(lua_State *luastate) return 0; } - -#endif /* HAVE_LUA */ diff --git a/src/util-lua-tls.h b/src/util-lua-tls.h index 3e4c08d435..69eb2f9f71 100644 --- a/src/util-lua-tls.h +++ b/src/util-lua-tls.h @@ -24,10 +24,6 @@ #ifndef SURICATA_UTIL_LUA_TLS_H #define SURICATA_UTIL_LUA_TLS_H -#ifdef HAVE_LUA - int LuaRegisterTlsFunctions(lua_State *luastate); -#endif /* HAVE_LUA */ - #endif /* SURICATA_UTIL_LUA_TLS_H */ diff --git a/src/util-lua.c b/src/util-lua.c index 900e66401d..3377cc6319 100644 --- a/src/util-lua.c +++ b/src/util-lua.c @@ -47,8 +47,6 @@ #include "util-logopenfile.h" #include "util-time.h" -#ifdef HAVE_LUA - #include #include #include @@ -344,5 +342,3 @@ int LuaPushInteger(lua_State *luastate, lua_Integer n) lua_pushinteger(luastate, n); return 1; } - -#endif /* HAVE_LUA */ diff --git a/src/util-lua.h b/src/util-lua.h index dd069384d5..70e5164638 100644 --- a/src/util-lua.h +++ b/src/util-lua.h @@ -24,14 +24,6 @@ #ifndef SURICATA_UTIL_LUA_H #define SURICATA_UTIL_LUA_H -#ifndef HAVE_LUA - -/* If we don't have Lua, create a typedef for lua_State so the - * exported Lua functions don't fail the build. */ -typedef void lua_State; - -#else - #include "lua.h" #include "lualib.h" #include "lauxlib.h" @@ -108,6 +100,4 @@ int LuaPushStringBuffer(lua_State *luastate, const uint8_t *input, size_t input_ int LuaPushInteger(lua_State *luastate, lua_Integer n); -#endif /* HAVE_LUA */ - #endif /* SURICATA_UTIL_LUA_H */