Skip to content

Commit

Permalink
github-ci: Handle switch to lua by default
Browse files Browse the repository at this point in the history
Ticket: OISF#4776
  • Loading branch information
J0eJ0h committed Jan 25, 2024
1 parent e166146 commit 616c12d
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 14 deletions.
28 changes: 17 additions & 11 deletions .github/workflows/builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ jobs:
CFLAGS="${DEFAULT_CFLAGS}" ./configure
- run: make -j2 distcheck
env:
DISTCHECK_CONFIGURE_FLAGS: "--enable-unittests --enable-debug --enable-lua --enable-geoip --enable-profiling --enable-profiling-locks --enable-dpdk"
DISTCHECK_CONFIGURE_FLAGS: "--enable-unittests --enable-debug --enable-geoip --enable-profiling --enable-profiling-locks --enable-dpdk"
- run: test -e doc/userguide/suricata.1
- name: Checking includes
run: |
Expand Down Expand Up @@ -914,7 +914,7 @@ jobs:
# Set the concurrency level for cocci.
run: CONCURRENCY_LEVEL=2 make check
- run: make distclean
- run: CC="clang" CFLAGS="$DEFAULT_CFLAGS -Wshadow -fsanitize=address -fno-omit-frame-pointer" ./configure --enable-debug --enable-unittests --disable-shared --enable-rust-strict --enable-hiredis --enable-nfqueue --enable-lua
- run: CC="clang" CFLAGS="$DEFAULT_CFLAGS -Wshadow -fsanitize=address -fno-omit-frame-pointer" ./configure --enable-debug --enable-unittests --disable-shared --enable-rust-strict --enable-hiredis --enable-nfqueue
env:
LDFLAGS: "-fsanitize=address"
ac_cv_func_realloc_0_nonnull: "yes"
Expand Down Expand Up @@ -1100,7 +1100,7 @@ jobs:
- run: tar xf prep/libhtp.tar.gz
- run: tar xf prep/suricata-update.tar.gz
- run: ./autogen.sh
- run: CC="clang" CFLAGS="$DEFAULT_CFLAGS -Wshadow -fsanitize=address -fno-omit-frame-pointer" ./configure --enable-debug --enable-unittests --disable-shared --enable-rust-strict --enable-hiredis --enable-nfqueue --enable-lua
- run: CC="clang" CFLAGS="$DEFAULT_CFLAGS -Wshadow -fsanitize=address -fno-omit-frame-pointer" ./configure --enable-debug --enable-unittests --disable-shared --enable-rust-strict --enable-hiredis --enable-nfqueue
env:
LDFLAGS: "-fsanitize=address"
ac_cv_func_realloc_0_nonnull: "yes"
Expand Down Expand Up @@ -1518,6 +1518,7 @@ jobs:
libyaml-dev \
libcap-ng-dev \
libcap-ng0 \
liblua5.4-dev \
libmagic-dev \
libnetfilter-queue-dev \
libnetfilter-queue1 \
Expand Down Expand Up @@ -1559,7 +1560,7 @@ jobs:
chmod 755 $HOME/.cargo/bin/cbindgen
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- run: ./autogen.sh
- run: ./configure --with-gnu-ld --enable-fuzztargets --disable-shared --enable-gccprotect
- run: ./configure --with-gnu-ld --enable-fuzztargets --disable-shared --enable-gccprotect
env:
LIB_FUZZING_ENGINE: "fail_to_onefile_driver"
CC: "clang-14"
Expand Down Expand Up @@ -1648,7 +1649,7 @@ jobs:
chmod 755 $HOME/.cargo/bin/cbindgen
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- run: ./autogen.sh
- run: CFLAGS="$DEFAULT_CFLAGS -DNDEBUG" ./configure --enable-unittests
- run: CFLAGS="$DEFAULT_CFLAGS -DNDEBUG" ./configure --enable-unittests --disable-lua
- run: make -j2
- run: make check
- run: make dist
Expand Down Expand Up @@ -1762,6 +1763,7 @@ jobs:
libyaml-dev \
libcap-ng-dev \
libcap-ng0 \
liblua5.4-dev \
libmagic-dev \
libnetfilter-queue-dev \
libnetfilter-queue1 \
Expand Down Expand Up @@ -1841,6 +1843,7 @@ jobs:
libyaml-dev \
libcap-ng-dev \
libcap-ng0 \
liblua5.4-dev \
libmagic-dev \
libnetfilter-queue-dev \
libnetfilter-queue1 \
Expand Down Expand Up @@ -1902,6 +1905,7 @@ jobs:
libyaml-dev \
libcap-ng-dev \
libcap-ng0 \
liblua5.4-dev \
libmagic-dev \
libnetfilter-queue-dev \
libnetfilter-queue1 \
Expand Down Expand Up @@ -1995,6 +1999,7 @@ jobs:
libyaml-dev \
libcap-ng-dev \
libcap-ng0 \
liblua5.4-dev \
libmagic-dev \
libnetfilter-queue-dev \
libnetfilter-queue1 \
Expand Down Expand Up @@ -2133,7 +2138,7 @@ jobs:
# -j2 caused random failures during cargo vendor
- run: make distcheck
env:
DISTCHECK_CONFIGURE_FLAGS: "--enable-unittests --enable-debug --enable-lua --enable-geoip --enable-profiling --enable-profiling-locks --enable-dpdk"
DISTCHECK_CONFIGURE_FLAGS: "--enable-unittests --enable-debug --enable-geoip --enable-profiling --enable-profiling-locks --enable-dpdk"
- run: test -e doc/userguide/suricata.1
- run: test -e doc/userguide/userguide.pdf
- name: Building Rust documentation
Expand Down Expand Up @@ -2182,6 +2187,7 @@ jobs:
libyaml-dev \
libcap-ng-dev \
libcap-ng0 \
liblua5.4-dev \
libmagic-dev \
libjansson-dev \
libjansson4 \
Expand Down Expand Up @@ -2297,7 +2303,7 @@ jobs:
- run: tar xf prep/suricata-update.tar.gz
- run: tar xf prep/suricata-verify.tar.gz
- run: ./autogen.sh
- run: CFLAGS="${DEFAULT_CFLAGS}" ./configure --enable-unittests --enable-debug --enable-lua --enable-geoip --enable-profiling --enable-profiling-locks --enable-dpdk
- run: CFLAGS="${DEFAULT_CFLAGS}" ./configure --enable-unittests --enable-debug --enable-geoip --enable-profiling --enable-profiling-locks --enable-dpdk
- run: make -j2
- run: make check
- name: Building Rust documentation
Expand Down Expand Up @@ -2447,7 +2453,7 @@ jobs:
cp prep/cbindgen $HOME/.cargo/bin
chmod 755 $HOME/.cargo/bin/cbindgen
- run: ./autogen.sh
- run: CFLAGS="${DEFAULT_CFLAGS}" ./configure --enable-unittests --enable-fuzztargets
- run: CFLAGS="${DEFAULT_CFLAGS}" ./configure --enable-unittests --enable-fuzztargets --disable-lua
- run: make -j2
- run: make check
- run: tar xf prep/suricata-verify.tar.gz
Expand Down Expand Up @@ -2554,7 +2560,7 @@ jobs:
- name: Build
run: |
./autogen.sh
CFLAGS="-ggdb -Werror" ./configure --enable-unittests --enable-gccprotect --disable-gccmarch-native --disable-shared --with-libpcap-includes=/npcap/Include --with-libpcap-libraries=/npcap/Lib/x64
CFLAGS="-ggdb -Werror" ./configure --enable-unittests --enable-gccprotect --disable-gccmarch-native --disable-shared --disable-lua --with-libpcap-includes=/npcap/Include --with-libpcap-libraries=/npcap/Lib/x64
make -j3
- name: Run
run: |
Expand Down Expand Up @@ -2599,7 +2605,7 @@ jobs:
- name: Build
run: |
./autogen.sh
CFLAGS="-ggdb -Werror" ./configure --enable-unittests --enable-gccprotect --disable-gccmarch-native --disable-shared --with-libpcap-includes=/npcap/Include --with-libpcap-libraries=/npcap/Lib/x64
CFLAGS="-ggdb -Werror" ./configure --enable-unittests --enable-gccprotect --disable-gccmarch-native --disable-shared --disable-lua --with-libpcap-includes=/npcap/Include --with-libpcap-libraries=/npcap/Lib/x64
make -j3
- name: Run
run: |
Expand Down Expand Up @@ -2648,7 +2654,7 @@ jobs:
- name: Build
run: |
./autogen.sh
CFLAGS="-ggdb -Werror" ./configure --enable-gccprotect --disable-gccmarch-native --disable-shared --enable-windivert --with-windivert-include=/windivert/WinDivert-1.4.3-A/include --with-windivert-libraries=/windivert/WinDivert-1.4.3-A/x86_64
CFLAGS="-ggdb -Werror" ./configure --enable-gccprotect --disable-gccmarch-native --disable-shared --disable-lua --enable-windivert --with-windivert-include=/windivert/WinDivert-1.4.3-A/include --with-windivert-libraries=/windivert/WinDivert-1.4.3-A/x86_64
make -j3
- name: Run
run: |
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/formatting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ jobs:
libyaml-dev \
libcap-ng-dev \
libcap-ng0 \
liblua5.4-dev \
libmagic-dev \
libnetfilter-queue-dev \
libnetfilter-queue1 \
Expand Down
6 changes: 3 additions & 3 deletions src/detect-lua-extensions.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ static int GetFlowVarByKey(lua_State *luastate, Flow *f, FlowVar **ret_fv)
LUA_ERROR("key len out of range: max 256");
}

FlowVar *fv = FlowVarGetByKey(f, (const uint8_t *)keystr, keylen);
FlowVar *fv = FlowVarGetByKey(f, (const uint8_t *)keystr, (uint16_t)keylen);
if (fv == NULL) {
LUA_ERROR("no flow var");
}
Expand Down Expand Up @@ -272,7 +272,7 @@ static int LuaSetFlowvarById(lua_State *luastate)
memcpy(buffer, str, len);
buffer[len] = '\0';

FlowVarAddIdValue(f, idx, buffer, len);
FlowVarAddIdValue(f, idx, buffer, (uint16_t)len);
return 0;
}

Expand Down Expand Up @@ -333,7 +333,7 @@ static int LuaSetFlowvarByKey(lua_State *luastate)
}
memcpy(keybuf, keystr, keylen);
keybuf[keylen] = '\0';
FlowVarAddKeyValue(f, keybuf, keylen, buffer, len);
FlowVarAddKeyValue(f, keybuf, (uint16_t)keylen, buffer, (uint16_t)len);

return 0;
}
Expand Down

0 comments on commit 616c12d

Please sign in to comment.