added my Recipes

This commit is contained in:
2024-07-11 14:16:35 +02:00
parent 38bc4f53ac
commit 09b621d929
7118 changed files with 525762 additions and 3 deletions

View File

@@ -0,0 +1,39 @@
From 52953ab99c727a19e88243dda2702d6814f7974d Mon Sep 17 00:00:00 2001
From: Mingli Yu <mingli.yu@windriver.com>
Date: Wed, 4 Nov 2020 08:55:10 +0000
Subject: [PATCH] Makefile.in: don't use the internal lua
ntopng depends on lua and it will compile the lua under
third-party sub dir of source tree, but this one supports
cross-compiling badly, so use the one under RECIPE_SYSROOT.
Upstream-Status: Inappropriate [embedded specific]
Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
---
Makefile.in | 2 --
1 file changed, 2 deletions(-)
diff --git a/Makefile.in b/Makefile.in
index d737e74..a611b16 100755
--- a/Makefile.in
+++ b/Makefile.in
@@ -36,7 +36,6 @@ MONGOOSE_INC=-I$(MONGOOSE_HOME)
LUA_PLATFORM=generic
LUA_HOME=${PWD}/third-party/lua-5.4.3
LUA_INC=-I$(LUA_HOME)/src
-LUA_LIB=$(LUA_HOME)/src/liblua.a
ifeq ($(OS),Linux)
LUA_PLATFORM=linux
@@ -102,7 +101,6 @@ RPM_PKG = $(TARGET)-$(NTOPNG_VERSION)-@REVISION@.$(PLATFORM).rpm
RPM_DATA_PKG = $(TARGET)-data-$(NTOPNG_VERSION)-@REVISION@.noarch.rpm
######
-LIB_TARGETS = $(LUA_LIB)
ifneq ($(HAS_ZEROMQ), 0)
LIB_TARGETS += $(ZEROMQ_LIB)
--
2.25.1

View File

@@ -0,0 +1,36 @@
From 22f0bec462763f1b0b92daa33133e274d3b45f4f Mon Sep 17 00:00:00 2001
From: Mingli Yu <mingli.yu@windriver.com>
Date: Thu, 5 Nov 2020 00:05:21 -0800
Subject: [PATCH] autogen.sh: generate configure.ac only
The autogen.sh should only generate configure.ac and the
logic used to generate configure script should follow the
autotools.bbclass in oe. Otherwise there may comes below
do_configure error:
| checking whether we are cross compiling... configure: error: in `/path/tmp/work/core2-64-poky-linux/ndpi/3.4-r0/git':
| configure: error: cannot run C compiled programs.
| If you meant to cross compile, use `--host'.
Upstream-Status: Inappropriate [embedded specific]
Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
---
autogen.sh | 5 -----
1 file changed, 5 deletions(-)
diff --git a/autogen.sh b/autogen.sh
index 73f8d0ebe..15ff0aa84 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -73,8 +73,3 @@ cat configure.seed | sed \
> configure.ac
rm -f config.h config.h.in *~ #*
-
-echo "Wait please..."
-autoreconf -if
-echo ""
-echo "Now run ./configure"
--
2.17.1

View File

@@ -0,0 +1,35 @@
From d482bcc8fca90afc95ac3cbe848a3c9d7ad81ddc Mon Sep 17 00:00:00 2001
From: Mingli Yu <mingli.yu@windriver.com>
Date: Wed, 4 Nov 2020 23:37:44 -0800
Subject: [PATCH] autogen.sh: not generate configure
Only use autogen.sh to generate configure.ac.
Upstream-Status: Inappropriate [embedded specific]
Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
refresh patch to 4.0
Signed-off-by: Changqing Li <changqing.li@windriver.com>
---
autogen.sh | 7 -------
1 file changed, 7 deletions(-)
diff --git a/autogen.sh b/autogen.sh
index 0aa7507..36e0423 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -33,10 +33,3 @@ if test -z $PKG_CONFIG; then
echo "pkg-config is missing: please install it (apt-get install pkg-config) and try again"
exit
fi
-
-autoreconf -ivf
-
-echo "./configure $@"
-chmod +x configure
-./configure $@
-
--
2.25.1

View File

@@ -0,0 +1,39 @@
From a913b85f720f41bf7e5819c0dc4acc252467a8a4 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Tue, 15 Feb 2022 14:25:07 -0800
Subject: [PATCH] configure.ac.in: Allow dynamic linking against ndpi 3.0
Linking statically is problematic since NDPI_LIBS is '-lndpi -lm'
and when we use -Bstatic it also brings in -lm to use libm.a and on some
architectures ( x86 ) which this does not work and results in missing symbols
Fixes
ipe-sysroot/usr/lib/libm.a(e_logf.o): in function `logf_ifunc_selector':
/usr/src/debug/glibc/2.35-r0/git/math/../sysdeps/i386/i686/multiarch/ifunc-sse2.h:30: undefined reference to `_dl_x86_cpu_features'
Upstream-Status: Submitted [https://github.com/ntop/ntopng/pull/6318]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
configure.ac.in | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/configure.ac.in b/configure.ac.in
index 7f4c0f893..c3299fda2 100644
--- a/configure.ac.in
+++ b/configure.ac.in
@@ -193,10 +193,8 @@ if test -d /usr/local/include/ndpi ; then :
fi
PKG_CHECK_MODULES([NDPI], [libndpi >= 2.0], [
- NDPI_INC=`echo $NDPI_CFLAGS | sed -e "s/[ ]*$//"`
- # Use static libndpi library as building against the dynamic library fails
- NDPI_LIB="-Wl,-Bstatic $NDPI_LIBS -Wl,-Bdynamic"
- #NDPI_LIB="$NDPI_LIBS"
+ NDPI_INC="$NDPI_CFLAGS"
+ NDPI_LIB="$NDPI_LIBS"
NDPI_LIB_DEP=
], [
AC_MSG_CHECKING(for nDPI source)
--
2.35.1

View File

@@ -0,0 +1,42 @@
From 29797dd037009d38e4976249ed21b2076240751e Mon Sep 17 00:00:00 2001
From: Mingli Yu <mingli.yu@windriver.com>
Date: Wed, 4 Nov 2020 04:36:46 +0000
Subject: [PATCH] configure.ac.in: fix configure error
fix the below error:
configure: error: cannot run test program while cross compiling
Upstream-Status: Inappropriate [embedded specific]
Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
---
configure.ac.in | 13 +------------
1 file changed, 1 insertion(+), 12 deletions(-)
diff --git a/configure.ac.in b/configure.ac.in
index a321f9bbf..03f9a31b0 100644
--- a/configure.ac.in
+++ b/configure.ac.in
@@ -642,18 +642,7 @@ if test x$radcli = xtrue; then
fi
fi
-AC_CACHE_CHECK([if pthread rwlocks are supported], [my_cv_rw_locks_supported], [
- AC_TRY_RUN([
- #include <pthread.h>
-
- int main() {
- pthread_rwlock_t t;
- return 0;
- }
-]
-, [my_cv_rw_locks_supported=yes], [my_cv_rw_locks_supported=no])
-]
-)
+AC_CACHE_CHECK([if pthread rwlocks are supported], [my_cv_rw_locks_supported])
if test "$my_cv_rw_locks_supported" = yes; then
AC_DEFINE_UNQUOTED(HAVE_RW_LOCK, 1, [pthread rwlocks supported])
--
2.26.2

View File

@@ -0,0 +1,82 @@
From d9458227ddb4bbb8c63c607202a6854886d66090 Mon Sep 17 00:00:00 2001
From: Mingli Yu <mingli.yu@windriver.com>
Date: Wed, 4 Nov 2020 06:28:28 +0000
Subject: [PATCH] configure.ac.in: fix host contamination
Fix below error:
This autoconf log indicates errors, it looked at host include and/or
library paths while determining system capabilities.
Upstream-Status: Inappropriate [OE specific]
Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
---
configure.ac.in | 43 +++----------------------------------------
1 file changed, 3 insertions(+), 40 deletions(-)
diff --git a/configure.ac.in b/configure.ac.in
index 1d6380c..beffc6c 100644
--- a/configure.ac.in
+++ b/configure.ac.in
@@ -167,31 +167,6 @@ fi
#
REVISION=`git log --pretty=oneline | wc -l`
-if test -d "/usr/local/include"; then
- CFLAGS="${CFLAGS} -I/usr/local/include"
- CPPFLAGS="${CPPFLAGS} -I/usr/local/include"
-fi
-
-if test -d "/usr/local/lib"; then
- LIBS="${LIBS} -L/usr/local/lib"
-fi
-
-if test -d /opt/local/include; then :
- CFLAGS="${CFLAGS} -I/opt/local/include"
- CPPFLAGS="${CPPFLAGS} -I/opt/local/include"
-fi
-
-if test -d /opt/local/lib; then :
- LIBS="${LIBS} -L/opt/local/lib"
-fi
-
-if [ test -f /usr/bin/lsb_release ]; then
- CODENAME=`/usr/bin/lsb_release -c|cut -f 2`
- if [[ $CODENAME == "wheezy" ]]; then :
- CPPFLAGS="${CPPFLAGS} -DOLD_NETFILTER_INTERFACE=1"
- fi
-fi
-
SHORT_MACHINE=`uname -m | cut -b1-3`
GIT_RELEASE="@GIT_RELEASE@"
@@ -300,23 +275,11 @@ fi
pkg-config --exists libssl
if test "$?" -ne 1; then
AC_DEFINE_UNQUOTED(NO_SSL_DL, 1, [has openssl])
- SSL_INC="`pkg-config --cflags libssl` -I/usr/include/openssl"
+ SSL_INC="`pkg-config --cflags libssl`"
SSL_LIB="`pkg-config --libs libssl` -lssl -lcrypto"
else
- dnl Workaround for MacOS Brew
- if test -d "/usr/local/opt/openssl/lib"; then
- AC_DEFINE_UNQUOTED(NO_SSL_DL, 1, [has openssl])
- SSL_INC="-I/usr/local/opt/openssl/include"
- SSL_LIB="-L/usr/local/opt/openssl/lib -lssl -lcrypto"
- dnl Workaround for FreeBSD
- elif test -f "/usr/lib/libssl.so"; then
- AC_DEFINE_UNQUOTED(NO_SSL_DL, 1, [has openssl])
- SSL_INC="-I/usr/include"
- SSL_LIB="-L/usr/lib -lssl -lcrypto"
- else
- echo "Please install openssl-dev(el) package prerequisite"
- exit -1
- fi
+ echo "Please install openssl-dev(el) package prerequisite"
+ exit -1
fi
AC_CHECK_LIB([gcrypt], [gcry_cipher_checktag], [LIBS="${LIBS} -lgcrypt"])
--
2.25.1

View File

@@ -0,0 +1,44 @@
From 5867be19e53a3cc09730b83282c83bdd26147cc3 Mon Sep 17 00:00:00 2001
From: Mingli Yu <mingli.yu@windriver.com>
Date: Mon, 9 Nov 2020 04:05:25 +0000
Subject: [PATCH] configure.ac.in: not check clang on host
Don't check clang on host to avoid host contamination.
Upstream-Status: Inappropriate [OE specific]
Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
---
configure.ac.in | 16 ----------------
1 file changed, 16 deletions(-)
diff --git a/configure.ac.in b/configure.ac.in
index 55bd49678..94bc0bc48 100644
--- a/configure.ac.in
+++ b/configure.ac.in
@@ -90,22 +90,6 @@ if test $SYSTEM = "FreeBSD" || test $SYSTEM = "Darwin"; then
CFLAGS="-fno-color-diagnostics $CFLAGS"
fi
fi
-else
- if test $SYSTEM = "Linux"; then
- if [ test -f /usr/bin/clang++ ]; then
- CC=clang
- CXX=clang++
- AC_MSG_RESULT(Using clang++ compiler)
- fi
-
- if [ test -f /etc/redhat-release ]; then
- OS=`cat /etc/redhat-release`
- else
- if [ test -f /usr/bin/lsb_release ]; then
- OS=`/usr/bin/lsb_release -d|cut -d ':' -f 2`
- fi
- fi
- fi
fi
dnl> Remove spaces
--
2.17.1

View File

@@ -0,0 +1,116 @@
From 1ec621c85b9411cc611652fd57a892cfef478af3 Mon Sep 17 00:00:00 2001
From: Luca Deri <deri@ntop.org>
Date: Sat, 15 May 2021 19:53:46 +0200
Subject: [PATCH] Added further checks
Upstream-Status: Backport [https://github.com/ntop/nDPI/commit/1ec621c85b9411cc611652fd57a892cfef478af3]
CVE: CVE-2021-36082
Signed-off-by: Changqing Li <changqing.li@windriver.com>
---
src/lib/protocols/netbios.c | 2 +-
src/lib/protocols/tls.c | 32 +++++++++++++++++---------------
2 files changed, 18 insertions(+), 16 deletions(-)
diff --git a/src/lib/protocols/netbios.c b/src/lib/protocols/netbios.c
index 1f3850cb..0d3b705f 100644
--- a/src/lib/protocols/netbios.c
+++ b/src/lib/protocols/netbios.c
@@ -42,7 +42,7 @@ int ndpi_netbios_name_interpret(char *in, size_t inlen, char *out, u_int out_len
int ret = 0, len, idx = inlen;
char *b;
- len = (*in++)/2;
+ len = (*in++)/2, inlen--;
b = out;
*out = 0;
diff --git a/src/lib/protocols/tls.c b/src/lib/protocols/tls.c
index 5b572cae..c115ac08 100644
--- a/src/lib/protocols/tls.c
+++ b/src/lib/protocols/tls.c
@@ -994,21 +994,23 @@ int processClientServerHello(struct ndpi_detection_module_struct *ndpi_struct,
i += 4 + extension_len, offset += 4 + extension_len;
}
- ja3_str_len = snprintf(ja3_str, sizeof(ja3_str), "%u,", ja3.tls_handshake_version);
+ ja3_str_len = snprintf(ja3_str, JA3_STR_LEN, "%u,", ja3.tls_handshake_version);
- for(i=0; i<ja3.num_cipher; i++) {
- rc = snprintf(&ja3_str[ja3_str_len], sizeof(ja3_str)-ja3_str_len, "%s%u", (i > 0) ? "-" : "", ja3.cipher[i]);
+ for(i=0; (i<ja3.num_cipher) && (JA3_STR_LEN > ja3_str_len); i++) {
+ rc = snprintf(&ja3_str[ja3_str_len], JA3_STR_LEN-ja3_str_len, "%s%u", (i > 0) ? "-" : "", ja3.cipher[i]);
if(rc <= 0) break; else ja3_str_len += rc;
}
- rc = snprintf(&ja3_str[ja3_str_len], sizeof(ja3_str)-ja3_str_len, ",");
- if(rc > 0 && ja3_str_len + rc < JA3_STR_LEN) ja3_str_len += rc;
+ if(JA3_STR_LEN > ja3_str_len) {
+ rc = snprintf(&ja3_str[ja3_str_len], JA3_STR_LEN-ja3_str_len, ",");
+ if(rc > 0 && ja3_str_len + rc < JA3_STR_LEN) ja3_str_len += rc;
+ }
/* ********** */
- for(i=0; i<ja3.num_tls_extension; i++) {
- int rc = snprintf(&ja3_str[ja3_str_len], sizeof(ja3_str)-ja3_str_len, "%s%u", (i > 0) ? "-" : "", ja3.tls_extension[i]);
+ for(i=0; (i<ja3.num_tls_extension) && (JA3_STR_LEN-ja3_str_len); i++) {
+ int rc = snprintf(&ja3_str[ja3_str_len], JA3_STR_LEN-ja3_str_len, "%s%u", (i > 0) ? "-" : "", ja3.tls_extension[i]);
if(rc <= 0) break; else ja3_str_len += rc;
}
@@ -1443,41 +1445,41 @@ int processClientServerHello(struct ndpi_detection_module_struct *ndpi_struct,
int rc;
compute_ja3c:
- ja3_str_len = snprintf(ja3_str, sizeof(ja3_str), "%u,", ja3.tls_handshake_version);
+ ja3_str_len = snprintf(ja3_str, JA3_STR_LEN, "%u,", ja3.tls_handshake_version);
for(i=0; i<ja3.num_cipher; i++) {
- rc = snprintf(&ja3_str[ja3_str_len], sizeof(ja3_str)-ja3_str_len, "%s%u",
+ rc = snprintf(&ja3_str[ja3_str_len], JA3_STR_LEN-ja3_str_len, "%s%u",
(i > 0) ? "-" : "", ja3.cipher[i]);
if(rc > 0 && ja3_str_len + rc < JA3_STR_LEN) ja3_str_len += rc; else break;
}
- rc = snprintf(&ja3_str[ja3_str_len], sizeof(ja3_str)-ja3_str_len, ",");
+ rc = snprintf(&ja3_str[ja3_str_len], JA3_STR_LEN-ja3_str_len, ",");
if(rc > 0 && ja3_str_len + rc < JA3_STR_LEN) ja3_str_len += rc;
/* ********** */
for(i=0; i<ja3.num_tls_extension; i++) {
- rc = snprintf(&ja3_str[ja3_str_len], sizeof(ja3_str)-ja3_str_len, "%s%u",
+ rc = snprintf(&ja3_str[ja3_str_len], JA3_STR_LEN-ja3_str_len, "%s%u",
(i > 0) ? "-" : "", ja3.tls_extension[i]);
if(rc > 0 && ja3_str_len + rc < JA3_STR_LEN) ja3_str_len += rc; else break;
}
- rc = snprintf(&ja3_str[ja3_str_len], sizeof(ja3_str)-ja3_str_len, ",");
+ rc = snprintf(&ja3_str[ja3_str_len], JA3_STR_LEN-ja3_str_len, ",");
if(rc > 0 && ja3_str_len + rc < JA3_STR_LEN) ja3_str_len += rc;
/* ********** */
for(i=0; i<ja3.num_elliptic_curve; i++) {
- rc = snprintf(&ja3_str[ja3_str_len], sizeof(ja3_str)-ja3_str_len, "%s%u",
+ rc = snprintf(&ja3_str[ja3_str_len], JA3_STR_LEN-ja3_str_len, "%s%u",
(i > 0) ? "-" : "", ja3.elliptic_curve[i]);
if(rc > 0 && ja3_str_len + rc < JA3_STR_LEN) ja3_str_len += rc; else break;
}
- rc = snprintf(&ja3_str[ja3_str_len], sizeof(ja3_str)-ja3_str_len, ",");
+ rc = snprintf(&ja3_str[ja3_str_len], JA3_STR_LEN-ja3_str_len, ",");
if(rc > 0 && ja3_str_len + rc < JA3_STR_LEN) ja3_str_len += rc;
for(i=0; i<ja3.num_elliptic_curve_point_format; i++) {
- rc = snprintf(&ja3_str[ja3_str_len], sizeof(ja3_str)-ja3_str_len, "%s%u",
+ rc = snprintf(&ja3_str[ja3_str_len], JA3_STR_LEN-ja3_str_len, "%s%u",
(i > 0) ? "-" : "", ja3.elliptic_curve_point_format[i]);
if(rc > 0 && ja3_str_len + rc < JA3_STR_LEN) ja3_str_len += rc; else break;
}
--
2.17.1

View File

@@ -0,0 +1,13 @@
[Unit]
Description=ntopng - High-Speed Web-based Traffic Analysis and Flow Collection Tool
After=network.target
[Service]
Type=forking
StandardOutput=syslog
StandardError=inherit
ExecStart=/usr/bin/ntopng -e -w 3000
Restart=on-abort
[Install]
WantedBy=multi-user.target