Skip to content

Commit 7732b5e

Browse files
committed
Update libinjection to version v3.9.2-92-gb9fcaaf
1 parent 2fd45f8 commit 7732b5e

File tree

8 files changed

+39
-19
lines changed

8 files changed

+39
-19
lines changed

.github/workflows/ci.yml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,11 @@ jobs:
5757
sudo apt-get install -y libgeoip-dev:${{ matrix.platform.arch }} \
5858
libfuzzy-dev:${{ matrix.platform.arch }}
5959
- uses: actions/checkout@v4
60-
with:
61-
submodules: true
60+
- name: get submodules
61+
# get submodules manually for git describe to work during build
62+
run: |
63+
git submodule init
64+
git submodule update
6265
- name: build.sh
6366
run: ./build.sh
6467
- name: configure
@@ -105,8 +108,11 @@ jobs:
105108
bison \
106109
flex
107110
- uses: actions/checkout@v4
108-
with:
109-
submodules: true
111+
- name: get submodules
112+
# get submodules manually for git describe to work during build
113+
run: |
114+
git submodule init
115+
git submodule update
110116
- name: build.sh
111117
run: ./build.sh
112118
- name: configure
@@ -135,8 +141,11 @@ jobs:
135141
- {label: "wo libxml", opt: "-WITHOUT_LIBXML2=ON" }
136142
steps:
137143
- uses: actions/checkout@v4
138-
with:
139-
submodules: true
144+
- name: Get submodules
145+
# get submodules manually for git describe to work during build
146+
run: |
147+
git submodule init
148+
git submodule update
140149
- name: Install Conan
141150
run: |
142151
pip3 install conan --upgrade

build/win32/CMakeLists.txt

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,21 @@ endif()
3030

3131
project(libinjection C)
3232

33-
add_library(libinjection STATIC ${BASE_DIR}/others/libinjection/src/libinjection_sqli.c ${BASE_DIR}/others/libinjection/src/libinjection_xss.c ${BASE_DIR}/others/libinjection/src/libinjection_html5.c)
33+
set(LIBINJECTION_DIR ${BASE_DIR}/others/libinjection)
34+
35+
add_library(libinjection STATIC ${LIBINJECTION_DIR}/src/libinjection_sqli.c ${LIBINJECTION_DIR}/src/libinjection_xss.c ${LIBINJECTION_DIR}/src/libinjection_html5.c)
36+
37+
# get libinjection version with git describe
38+
execute_process(
39+
COMMAND git describe
40+
WORKING_DIRECTORY ${LIBINJECTION_DIR}
41+
OUTPUT_VARIABLE LIBINJECTION_VERSION
42+
OUTPUT_STRIP_TRAILING_WHITESPACE
43+
)
44+
45+
message("-- Detecting libinjection version - ${LIBINJECTION_VERSION}")
46+
47+
target_compile_definitions(libinjection PRIVATE LIBINJECTION_VERSION="${LIBINJECTION_VERSION}")
3448

3549
# mbedtls
3650

configure.ac

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ AC_MSG_ERROR([\
7575
fi
7676
# Libinjection version
7777
AC_DEFUN([LIBINJECTION_VERSION], m4_esyscmd_s(cd "others/libinjection" && git describe && cd ../..))
78+
AC_SUBST([LIBINJECTION_VERSION])
7879

7980
# SecLang test version
8081
AC_DEFUN([SECLANG_TEST_VERSION], m4_esyscmd_s(cd "test/test-cases/secrules-language-tests" && git log -1 --format="%h" --abbrev-commit && cd ../../..))

others/Makefile.am

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11

22
noinst_LTLIBRARIES = libinjection.la libmbedtls.la
3+
34
libinjection_la_SOURCES = \
45
libinjection/src/libinjection_html5.c \
56
libinjection/src/libinjection_sqli.c \
67
libinjection/src/libinjection_xss.c
78

9+
libinjection_la_CFLAGS = -D LIBINJECTION_VERSION=\"${LIBINJECTION_VERSION}\"
10+
libinjection_la_LIBADD =
11+
812
noinst_HEADERS = \
913
libinjection/src/libinjection.h \
1014
libinjection/src/libinjection_html5.h \

src/operators/detect_sqli.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#include <list>
2020

2121
#include "src/operators/operator.h"
22-
#include "others/libinjection/src/libinjection.h"
22+
#include "libinjection/src/libinjection.h"
2323

2424
namespace modsecurity {
2525
namespace operators {

src/operators/detect_xss.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#include <string>
1919

2020
#include "src/operators/operator.h"
21-
#include "others/libinjection/src/libinjection.h"
21+
#include "libinjection/src/libinjection.h"
2222

2323

2424
namespace modsecurity {

test/cppcheck_suppressions.txt

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,7 @@
11
//
22
// Ignore libinjection related stuff.
33
//
4-
*:others/libinjection/src/libinjection_html5.c
5-
*:others/libinjection/src/libinjection_sqli.c
6-
*:others/libinjection/src/libinjection_xss.c
7-
*:others/libinjection/src/reader.c
8-
*:others/libinjection/src/sqli_cli.c
9-
*:others/libinjection/src/testdriver.c
10-
*:others/libinjection/src/test_speed_sqli.c
11-
*:others/libinjection/src/test_speed_xss.c
12-
4+
*:others/libinjection/src/*
135

146
//
157
// Lets ignore mbedtls.

0 commit comments

Comments
 (0)