Skip to content

python-cantools: Added recipe #251

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions meta-networking/recipes-daemons/radvd/files/radvd.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# NOTE: there is no such thing as a working "by-default" configuration file.
# At least the prefix needs to be specified. Please consult the radvd.conf(5)
# man page and/or /usr/share/doc/radvd-*/radvd.conf.example for help.
#
#
#interface eth0
#{
# AdvSendAdvert on;
# MinRtrAdvInterval 30;
# MaxRtrAdvInterval 100;
# prefix 2001:db8:1:0::/64
# {
# AdvOnLink on;
# AdvAutonomous on;
# AdvRouterAddr off;
# };
#
#};
5 changes: 4 additions & 1 deletion meta-networking/recipes-daemons/radvd/radvd.inc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ SRC_URI = "http://v6web.litech.org/radvd/dist/radvd-${PV}.tar.gz \
file://radvd.init \
file://radvd.service \
file://volatiles.03_radvd \
file://radvd.default"
file://radvd.default \
file://radvd.conf"

inherit autotools useradd pkgconfig systemd

Expand Down Expand Up @@ -52,6 +53,8 @@ do_install_append () {
for i in radvd.conf.example README; do \
install -m 0644 ${S}/$i ${D}${docdir}/radvd; \
done

install -m 0644 ${WORKDIR}/radvd.conf ${D}${sysconfdir}/radvd.conf
}

USERADD_PACKAGES = "${PN}"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
From 9c81c8e5bc7782e8ae12c078615abc3c896059f2 Mon Sep 17 00:00:00 2001
From: Julius Hemanth Pitti <[email protected]>
Date: Tue, 14 Jul 2020 22:34:19 -0700
Subject: [PATCH] telnetd/utility.c: Fix buffer overflow in netoprintf

As per man page of vsnprintf, when formated
string size is greater than "size"(2nd argument),
then vsnprintf returns size of formated string,
not "size"(2nd argument).

netoprintf() was not handling a case where
return value of vsnprintf is greater than
"size"(2nd argument), results in buffer overflow
while adjusting "nfrontp" pointer to point
beyond "netobuf" buffer.

Here is one such case where "nfrontp"
crossed boundaries of "netobuf", and
pointing to another global variable.

(gdb) p &netobuf[8255]
$5 = 0x55c93afe8b1f <netobuf+8255> ""
(gdb) p nfrontp
$6 = 0x55c93afe8c20 <terminaltype> "\377"
(gdb) p &terminaltype
$7 = (char **) 0x55c93afe8c20 <terminaltype>
(gdb)

This resulted in crash of telnetd service
with segmentation fault.

Though this is DoS security bug, I couldn't
find any CVE ID for this.

Upstream-Status: Pending

Signed-off-by: Julius Hemanth Pitti <[email protected]>
---
telnetd/utility.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/telnetd/utility.c b/telnetd/utility.c
index b9a46a6..4811f14 100644
--- a/telnetd/utility.c
+++ b/telnetd/utility.c
@@ -66,7 +66,7 @@ netoprintf(const char *fmt, ...)
len = vsnprintf(nfrontp, maxsize, fmt, ap);
va_end(ap);

- if (len<0 || len==maxsize) {
+ if (len<0 || len>=maxsize) {
/* didn't fit */
netflush();
}
--
2.19.1
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ SRC_URI = "http://ftp.linux.org.uk/pub/linux/Networking/netkit/${BP}.tar.gz \
file://0001-telnet-telnetd-Fix-print-format-strings.patch \
file://0001-telnet-telnetd-Fix-deadlock-on-cleanup.patch \
file://CVE-2020-10188.patch \
file://0001-telnetd-utility.c-Fix-buffer-overflow-in-netoprintf.patch \
"

UPSTREAM_CHECK_URI = "${DEBIAN_MIRROR}/main/n/netkit-telnet/"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
diff -urN orig/cmake/BundledOSSPUUID.cmake patched/cmake/BundledOSSPUUID.cmake
--- orig/cmake/BundledOSSPUUID.cmake 2020-01-07 22:55:55.000000000 +0900
+++ patched/cmake/BundledOSSPUUID.cmake 2020-07-14 11:32:28.221092406 +0900
@@ -22,7 +22,8 @@

# Define patch step
find_package(Patch REQUIRED)
- set(PC "${Patch_EXECUTABLE}" -p1 -i "${SOURCE_DIR}/thirdparty/ossp-uuid/ossp-uuid-mac-fix.patch")
+ set(PATCH1 "${Patch_EXECUTABLE}" -p1 -i "${SOURCE_DIR}/thirdparty/ossp-uuid/ossp-uuid-mac-fix.patch")
+ set(PATCH2 "${Patch_EXECUTABLE}" -p1 -i "${SOURCE_DIR}/thirdparty/ossp-uuid/cross-compile-fix.patch")

# Define byproducts
set(BYPRODUCTS "lib/libuuid.a"
@@ -35,7 +36,9 @@
ENDFOREACH(BYPRODUCT)

# Build project
- set(CONFIGURE_COMMAND ./configure "CFLAGS=-fPIC" "CXXFLAGS=-fPIC" --with-cxx --without-perl --without-php --without-pgsql "--prefix=${BINARY_DIR}/thirdparty/ossp-uuid-install")
+ set(CONFIGURE_COMMAND ac_cv_va_copy=C99 ./configure CFLAGS=-fPIC CXXFLAGS=-fPIC --host=${HOST_SYS}
+ --with-cxx --without-perl --without-php --without-pgsql
+ --prefix=${BINARY_DIR}/thirdparty/ossp-uuid-install)
string(TOLOWER "${CMAKE_BUILD_TYPE}" build_type)
if(NOT build_type MATCHES debug)
list(APPEND CONFIGURE_COMMAND --enable-debug=yes)
@@ -52,8 +55,8 @@
UPDATE_COMMAND ""
INSTALL_COMMAND make install
BUILD_BYPRODUCTS ${OSSPUUID_LIBRARIES_LIST}
- CONFIGURE_COMMAND ""
- PATCH_COMMAND ${PC} && ${CONFIGURE_COMMAND}
+ CONFIGURE_COMMAND ${CONFIGURE_COMMAND}
+ PATCH_COMMAND ${PATCH1} && ${PATCH2}
STEP_TARGETS build
EXCLUDE_FROM_ALL TRUE
)
diff -urN orig/thirdparty/ossp-uuid/cross-compile-fix.patch patched/thirdparty/ossp-uuid/cross-compile-fix.patch
--- orig/thirdparty/ossp-uuid/cross-compile-fix.patch 1970-01-01 09:00:00.000000000 +0900
+++ patched/thirdparty/ossp-uuid/cross-compile-fix.patch 2020-07-14 11:48:13.781090409 +0900
@@ -0,0 +1,31 @@
+diff -urN orig/config.sub patched/config.sub
+--- orig/config.sub 2008-07-05 06:43:08.000000000 +0900
++++ patched/config.sub 2020-07-14 11:46:47.249090591 +0900
+@@ -238,6 +238,7 @@
+ # Some are omitted here because they have special meanings below.
+ 1750a | 580 \
+ | a29k \
++ | aarch64 | aarch64_be \
+ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
+ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
+ | am33_2.0 \
+@@ -314,6 +315,7 @@
+ # Recognize the basic CPU types with company name.
+ 580-* \
+ | a29k-* \
++ | aarch64-* | aarch64_be-* \
+ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
+ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
+ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
+diff -urN orig/shtool patched/shtool
+--- orig/shtool 2008-07-05 06:43:08.000000000 +0900
++++ patched/shtool 2020-07-13 19:35:49.557213657 +0900
+@@ -1400,7 +1400,7 @@
+ if [ ".$opt_t" = .yes ]; then
+ echo "strip $dsttmp" 1>&2
+ fi
+- strip $dsttmp || shtool_exit $?
++ $STRIP $dsttmp || shtool_exit $?
+ fi
+ if [ ".$opt_o" != . ]; then
+ if [ ".$opt_t" = .yes ]; then
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
diff -urN orig/cmake/LibreSSL.cmake patched/cmake/LibreSSL.cmake
--- orig/cmake/LibreSSL.cmake 2020-01-07 22:55:55.000000000 +0900
+++ patched/cmake/LibreSSL.cmake 2020-07-14 12:01:28.321088730 +0900
@@ -27,6 +27,17 @@
set(BYPRODUCT_PREFIX "" CACHE STRING "" FORCE)
set(BUILD_ARGS " -GVisual Studio 15 2017")
endif(WIN32)
+
+ set(BYPRODUCTS
+ "lib/${BYPRODUCT_PREFIX}crypto${BYPRODUCT_SUFFIX}"
+ "lib/${BYPRODUCT_PREFIX}ssl${BYPRODUCT_SUFFIX}"
+ "lib/${BYPRODUCT_PREFIX}tls${BYPRODUCT_SUFFIX}"
+ )
+ set(LIBRESSL_INSTALL_DIR "${BINARY_DIR}/thirdparty/libressl-install" CACHE STRING "" FORCE)
+ FOREACH(BYPRODUCT ${BYPRODUCTS})
+ LIST(APPEND LIBRESSL_LIBRARIES_LIST "${LIBRESSL_INSTALL_DIR}/${BYPRODUCT}")
+ ENDFOREACH(BYPRODUCT)
+
ExternalProject_Add(
libressl-portable
URL https://cdn.openbsd.org/pub/OpenBSD/LibreSSL/libressl-2.8.3.tar.gz https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-2.8.3.tar.gz https://gentoo.osuosl.org/distfiles/libressl-2.8.3.tar.gz
@@ -37,6 +48,7 @@
"-DLIBRESSL_APPS=OFF"
"-DLIBRESSL_TESTS=OFF"
"${BUILD_ARGS}"
+ BUILD_BYPRODUCTS ${LIBRESSL_LIBRARIES_LIST}
)

add_library(crypto STATIC IMPORTED)
diff -urN orig/CMakeLists.txt patched/CMakeLists.txt
--- orig/CMakeLists.txt 2020-01-07 22:55:55.000000000 +0900
+++ patched/CMakeLists.txt 2020-07-14 16:25:51.581055220 +0900
@@ -120,12 +120,12 @@
endif()

# Use ccache if present
-find_program(CCACHE_FOUND ccache)
-if(CCACHE_FOUND)
- set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
- set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
- message("-- Found ccache: ${CCACHE_FOUND}")
-endif(CCACHE_FOUND)
+#find_program(CCACHE_FOUND ccache)
+#if(CCACHE_FOUND)
+# set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
+# set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
+# message("-- Found ccache: ${CCACHE_FOUND}")
+#endif(CCACHE_FOUND)

if (UNIX AND USE_GOLD_LINKER AND NOT APPLE )
execute_process(COMMAND ${CMAKE_C_COMPILER} -fuse-ld=gold -Wl,--version ERROR_QUIET OUTPUT_VARIABLE ld_version)
@@ -303,8 +303,10 @@
GIT_TAG "f3294d9d86e6a7915a967efff2842089b8b0d071" # Version 7.64.0
SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}/thirdparty/curl-src"
LIST_SEPARATOR % # This is needed for passing semicolon-separated lists
+ TLS_VERIFY OFF
CMAKE_ARGS ${PASSTHROUGH_CMAKE_ARGS}
"-DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_BINARY_DIR}/thirdparty/curl-install"
+ "-DCMAKE_INSTALL_LIBDIR=lib${LIBSUFFIX}"
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
-DBUILD_CURL_EXE=OFF
-DBUILD_TESTING=OFF
13 changes: 13 additions & 0 deletions meta-oe/recipes-extended/minifi-cpp/files/minifi.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[Unit]
Description=MiNiFi Service
After=network.target
RequiresMountsFor=/var

[Service]
Type=simple
Environment=MINIFI_HOME=/etc/minifi
ExecStartPre=@BASE_BINDIR@/mkdir -p /var/lib/minifi /var/log/minifi
ExecStart=@BINDIR@/minifi

[Install]
WantedBy=multi-user.target
63 changes: 63 additions & 0 deletions meta-oe/recipes-extended/minifi-cpp/minifi-cpp_0.7.0.bb
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
SUMMARY = "A subproject of Apache NiFi to collect data where it originates."
DESCRIPTION = "MiNiFi--a subproject of Apache NiFi--is a complementary \
data collection approach that supplements the core tenets of NiFi in dataflow \
management, focusing on the collection of data at the source of its creation."
HOMEPAGE = "https://nifi.apache.org/minifi/index.html"
SECTION = "console/network"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=f9534eb5f4ab800b573a37bffc62f3a7"

DEPENDS = "libxcrypt bzip2 expat flex zlib python3"

SRCREV = "aa42957a2e227df41510047cece3cd606dc1cb6a"
SRC_URI = "git://github.com/apache/nifi-minifi-cpp.git \
file://fix-build-issue-in-yocto.patch \
file://fix-OSSPUUID-cross-compile.patch \
file://minifi.service \
"

S = "${WORKDIR}/git"

inherit pkgconfig cmake systemd

SYSTEMD_PACKAGES = "minifi-cpp"
SYSTEMD_SERVICE_${PN} = "minifi.service"

EXTRA_OECMAKE += " \
-DHOST_SYS=${HOST_SYS} -DBUILD_SYS=${BUILD_SYS} \
-DSKIP_TESTS=ON \
"

OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM = "BOTH"


do_install() {
DESTDIR='${B}/minifi-install' cmake_runcmake_build --target ${OECMAKE_TARGET_INSTALL}

CONF_DIR=${D}${base_prefix}/etc/minifi/conf
install -d ${D}${base_prefix}/usr/bin
install -d ${CONF_DIR}
cp -a ${B}/minifi-install/usr/bin/* ${D}${base_prefix}/usr/bin/
cp -a ${B}/minifi-install/usr/conf/* ${CONF_DIR}/
sed -i 's|#appender.rolling.directory=.*|appender.rolling.directory=/var/log/minifi|g' \
${CONF_DIR}/minifi-log.properties
sed -i 's|nifi.provenance.repository.directory.default=.*|nifi.provenance.repository.directory.default=/var/lib/minifi/provenance_repository|g' \
${CONF_DIR}/minifi.properties
sed -i 's|nifi.flowfile.repository.directory.default=.*|nifi.flowfile.repository.directory.default=/var/lib/minifi/flowfile_repository|g' \
${CONF_DIR}/minifi.properties
sed -i 's|nifi.database.content.repository.directory.default=.*|nifi.database.content.repository.directory.default=/var/lib/minifi/content_repository|g' \
${CONF_DIR}/minifi.properties
sed -i 's|nifi.flow.configuration.file=.*|nifi.flow.configuration.file=/etc/minifi/conf/config.yml|g' \
${CONF_DIR}/minifi.properties

install -m 0755 -d ${D}${systemd_unitdir}/system
install -m 0644 ${WORKDIR}/minifi.service ${D}${systemd_unitdir}/system/
sed -i -e 's|@BASE_BINDIR@|${base_bindir}|g' ${D}${systemd_unitdir}/system/minifi.service
sed -i -e 's|@BINDIR@|${bindir}|g' ${D}${systemd_unitdir}/system/minifi.service
}

FILES_${PN} = " \
/usr/bin/* \
/etc/minifi/* \
${systemd_unitdir}/system/minifi.service \
"
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
DESCRIPTION = "CAN BUS tools in Python 3."
HOMEPAGE = "https://github.com/eerimoq/cantools"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE;md5=d9aa4ec07de78abae21c490c9ffe61bd"

SRC_URI[md5sum] = "46b71bbfec33146d9dbba708489a8ae2"
SRC_URI[sha256sum] = "bd0ac5b16bb7fe2ada0c9436c91a0b3795217bed7126296dde1565919a3f44f1"

PYPI_PACKAGE = "cantools"

inherit pypi setuptools3

CLEANBROKEN = "1"

2 changes: 1 addition & 1 deletion meta-python/recipes-devtools/python/python3-obd_0.7.1.bb
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ SRC_URI[sha256sum] = "8b81ea5896157b6e861af12e173c10b001cb6cca6ebb04db2c01d32681

inherit setuptools3 pypi

RDEPENDS_${PN} += "${PYTHON_PN}-pyserial ${PYTHON_PN}-pint ${PYTHON_PN}-setuptools"
RDEPENDS_${PN} += "${PYTHON_PN}-pyserial ${PYTHON_PN}-pint ${PYTHON_PN}-setuptools ${PYTHON_PN}-packaging"
2 changes: 2 additions & 0 deletions meta-python/recipes-devtools/python/python3-packaging_20.4.bb
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,7 @@ SRC_URI[sha256sum] = "4357f74f47b9c12db93624a82154e9b120fa8293699949152b22065d55

inherit pypi setuptools3

BBCLASSEXTEND = "native"

DEPENDS += "${PYTHON_PN}-setuptools-scm-native"
RDEPENDS_${PN} += "${PYTHON_PN}-six ${PYTHON_PN}-pyparsing"
5 changes: 5 additions & 0 deletions meta-python/recipes-devtools/python/python3-pint_0.14.bb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ SRC_URI += " \
file://run-ptest \
"

RDEPENDS_${PN} += " \
${PYTHON_PN}-setuptools \
${PYTHON_PN}-packaging \
"

RDEPENDS_${PN}-ptest += " \
${PYTHON_PN}-pytest \
"
Expand Down