Complete Yocto mirror with license table for TQMa6UL (2038-compliance)

- 264 license table entries with exact download URLs (224/264 resolved)
- Complete sources/ directory with all BitBake recipes
- Build configuration: tqma6ul-multi-mba6ulx, spaetzle (musl)
- Full traceability for Softwarefreigabeantrag
- GCC 13.4.0, Linux 6.6.102, U-Boot 2023.04, musl 1.2.4
- License distribution: GPL-2.0 (24), MIT (23), GPL-2.0+ (18), BSD-3 (16)
This commit is contained in:
Siggi (OpenClaw Agent)
2026-03-01 20:58:18 +00:00
commit 16accb6b24
15086 changed files with 1292356 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
SUMMARY = "Active Directory enrollment"
DESCRIPTION = "A helper library and tools for Active Directory client operations."
HOMEPAGE = "http://cgit.freedesktop.org/realmd/adcli"
SECTION = "net"
SRCREV = "8e88e3590a19006362ea8b8dfdc18bb88b3cb3b5"
SRC_URI = "git://gitlab.freedesktop.org/realmd/adcli;protocol=https;branch=master"
S = "${WORKDIR}/git"
LICENSE = "LGPL-2.0-or-later"
LIC_FILES_CHKSUM = "file://COPYING;md5=23c2a5e0106b99d75238986559bb5fc6"
inherit autotools xmlcatalog
DEPENDS += "virtual/crypt krb5 openldap gettext libxslt xmlto libxml2-native \
cyrus-sasl libxslt-native xmlto-native coreutils-native\
"
EXTRA_OECONF += "--disable-static \
--disable-silent-rules \
--disable-doc \
"

View File

@@ -0,0 +1,31 @@
DESCRIPTION = "autossh is a program to start a copy of ssh and monitor it, restarting it as necessary should it die or stop passing traffic"
HOMEPAGE = "https://www.harding.motd.ca/autossh/"
LICENSE = "BSD-1-Clause & BSD-4-Clause"
LIC_FILES_CHKSUM = "file://autossh.c;beginline=7;endline=22;md5=9ae0c9b04856148d77984ef58536732b \
file://daemon.h;beginline=7;endline=36;md5=839bb7bf781ff48da4a3fec2a62a1a47"
SRC_URI = "https://www.harding.motd.ca/autossh/${BP}.tgz"
SRC_URI[md5sum] = "2b804bc1bf6d2f2afaa526d02df7c0a2"
SRC_URI[sha256sum] = "5fc3cee3361ca1615af862364c480593171d0c54ec156de79fc421e31ae21277"
RDEPENDS:${PN} = "ssh"
CFLAGS:prepend = "-I${WORKDIR}/build "
inherit autotools
EXTRA_OECONF="--with-ssh=/usr/bin/ssh"
do_compile:append() {
cp ${WORKDIR}/autossh-${PV}/CHANGES ${WORKDIR}/build
cp ${WORKDIR}/autossh-${PV}/README ${WORKDIR}/build
cp ${WORKDIR}/autossh-${PV}/autossh.host ${WORKDIR}/build
cp ${WORKDIR}/autossh-${PV}/rscreen ${WORKDIR}/build
cp ${WORKDIR}/autossh-${PV}/autossh.1 ${WORKDIR}/build
cp ${WORKDIR}/autossh-${PV}/autossh.spec ${WORKDIR}/build
}
do_install:append() {
rm -rf ${D}${datadir}/examples
}

View File

@@ -0,0 +1,43 @@
From 542380a13f178d97851751b57054a6b5be555d1c Mon Sep 17 00:00:00 2001
From: Jens Rehsack <sno@netbsd.org>
Date: Thu, 13 Aug 2020 16:16:44 +0200
Subject: [PATCH 2/2] test/test_x509.c: fix potential overflow issue
Instead of doing a memcpy() which does static overflow checking, use
snprintf() for string copying which does the check dynamically.
Fixes:
| In file included from .../recipe-sysroot/usr/include/string.h:519,
| from test/test_x509.c:27:
| In function 'memcpy',
| inlined from 'parse_keyvalue' at test/test_x509.c:845:2,
| inlined from 'process_conf_file' at test/test_x509.c:1360:7,
| inlined from 'main' at test/test_x509.c:2038:2:
| .../recipe-sysroot/usr/include/bits/string_fortified.h:34:10: warning: '__builtin_memcpy' specified bound 4294967295 exceeds maximum object size 2147483647 [-Wstringop-overflow=]
| 34 | return __builtin___memcpy_chk (__dest, __src, __len, __bos0 (__dest));
| | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Jens Rehsack <sno@netbsd.org>
---
Upstream-Status: Pending
test/test_x509.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/test/test_x509.c b/test/test_x509.c
index 2c61cf5..76f6ab9 100644
--- a/test/test_x509.c
+++ b/test/test_x509.c
@@ -842,8 +842,7 @@ parse_keyvalue(HT *d)
return -1;
}
name = xmalloc(u + 1);
- memcpy(name, buf, u);
- name[u] = 0;
+ snprintf(name, u, "%s", buf);
if (HT_get(d, name) != NULL) {
xfree(name);
return -1;
--
2.17.1

View File

@@ -0,0 +1,52 @@
SUMMARY = "BearSSL is an implementation of the SSL/TLS protocol (RFC 5246) written in C"
DESCRIPTION = "BearSSL is an implementation of the SSL/TLS protocol (RFC \
5246) written in C. It aims at offering the following features: \
* Be correct and secure. In particular, insecure protocol versions and \
choices of algorithms are not supported, by design; cryptographic \
algorithm implementations are constant-time by default. \
* Be small, both in RAM and code footprint. For instance, a minimal \
server implementation may fit in about 20 kilobytes of compiled code \
and 25 kilobytes of RAM. \
* Be highly portable. BearSSL targets not only “big” operating systems \
like Linux and Windows, but also small embedded systems and even special \
contexts like bootstrap code. \
* Be feature-rich and extensible. SSL/TLS has many defined cipher suites \
and extensions; BearSSL should implement most of them, and allow extra \
algorithm implementations to be added afterwards, possibly from third \
parties."
HOMEPAGE = "https://bearssl.org"
SECTION = "libs"
inherit lib_package
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=1fc37e1037ae673975fbcb96a98f7191"
PV .= "+git"
SRCREV = "79c060eea3eea1257797f15ea1608a9a9923aa6f"
SRC_URI = "git://www.bearssl.org/git/BearSSL;protocol=https;branch=master \
file://0002-test-test_x509.c-fix-potential-overflow-issue.patch \
"
SONAME = "libbearssl.so.6"
# without compile errors like
# <..>/ld: build/obj/ghash_pclmul.o: warning: relocation against `br_ghash_pclmul' in read-only section `.text'
CFLAGS += "-fPIC"
EXTRA_OEMAKE += 'CC="${CC}" CFLAGS="${CFLAGS}" LDDLL="${CCLD} ${LDFLAGS}" LD="${CCLD}" LDFLAGS="${LDFLAGS}" \
BEARSSLDLL=build/${SONAME} \
LDDLLFLAGS="-shared -Wl,-soname,${SONAME}" \
${@ "STATICLIB=no" if d.getVar('DISABLE_STATIC') != "" else "" } \
'
S = "${WORKDIR}/git"
do_install() {
install -d ${D}/${bindir} ${D}/${libdir} ${D}/${includedir}
install -m 0755 ${B}/build/brssl ${D}/${bindir}
oe_libinstall -C ${B}/build libbearssl ${D}/${libdir}
for inc in ${S}/inc/*.h; do
install -m 0644 "${inc}" ${D}/${includedir}
done
}

View File

@@ -0,0 +1,24 @@
Subject: [PATCH] Search for cython3
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Upstream-Status: Inappropriate
Signed-off-by: Markus Volk <f_l_k@gmx.net>
---
meson.build | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/module/meson.build 2022-02-10 08:49:35.000000000 +0100
+++ b/module/meson.build 2022-03-29 12:58:03.456193737 +0200
@@ -1,4 +1,4 @@
-cython = find_program('cython', required: true)
+cython = find_program('cython3', required: true)
blueman_c = custom_target(
'blueman_c',
--
2.14.3

View File

@@ -0,0 +1,38 @@
From 18af739fd96960bbc8c5db5dd290d2f9134cd347 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Wed, 14 Aug 2024 21:26:24 -0700
Subject: [PATCH] meson: DO not emit absolute path when S != B
build systems like OE build outside sourcetree in such cases it works
ok but cython resolves the input file to absolute path and that gets
emitted into genetate _blueman.c as module name, renders the build
non-reproducible, wish cython had a better way to handle this but there
is not, therefore tweak the meson build rule to account for specifying
workdir to cython which will search the inputs correctly, and use
meson's build_root to emit the output into build dir. This ensures that
it becomes independent of source or build directories and cython does
not generate the absolute paths into generate C code.
See cython discussion on [1]
[1] https://github.com/cython/cython/issues/5949
Upstream-Status: Submitted [https://github.com/blueman-project/blueman/pull/2461]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
module/meson.build | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/module/meson.build b/module/meson.build
index 096ad7c8..e3d96f17 100644
--- a/module/meson.build
+++ b/module/meson.build
@@ -4,7 +4,7 @@ blueman_c = custom_target(
'blueman_c',
output: '_blueman.c',
input: '_blueman.pyx',
- command: [cython, '--output-file', '@OUTPUT@', '@INPUT@'])
+ command: [cython, '-w', meson.source_root(), '--output-file', meson.build_root() + '/' + '@OUTPUT@', '@INPUT@'])
sources = [
blueman_c,

View File

@@ -0,0 +1,50 @@
From 37f24a9bd62f0a8f3e37eaddd33f2f0c9d3aaa0a Mon Sep 17 00:00:00 2001
From: Chen Qi <Qi.Chen@windriver.com>
Date: Fri, 1 Apr 2022 23:12:17 -0700
Subject: [PATCH] meson: add pythoninstalldir option
In case of cross build, using host python to determine the python
site-packages directory for target is not feasible, add a new option
pythoninstalldir to fix the issue.
Upstream-Status: Submitted [https://github.com/blueman-project/blueman/pull/1699]
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
meson.build | 7 ++++++-
meson_options.txt | 1 +
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/meson.build b/meson.build
index e12d0ce6..e84457a5 100644
--- a/meson.build
+++ b/meson.build
@@ -26,7 +26,12 @@ pkgdatadir = join_paths([prefix, get_option('datadir'), package_name])
bindir = join_paths([prefix, get_option('bindir')])
libexecdir = join_paths([prefix, get_option('libexecdir')])
schemadir = join_paths(['share', 'glib-2.0', 'schemas'])
-pythondir = pyinstall.get_install_dir()
+pythoninstalldir = get_option('pythoninstalldir')
+if pythoninstalldir != ''
+ pythondir = join_paths([prefix, pythoninstalldir])
+else
+ pythondir = join_paths([prefix, python.sysconfig_path('purelib')])
+endif
if get_option('policykit')
have_polkit = 'True'
diff --git a/meson_options.txt b/meson_options.txt
index 177d9ab8..3e397d8e 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -2,6 +2,7 @@ option('runtime_deps_check', type: 'boolean', value: true, description: 'Disable
option('dhcp-config-path', type: 'string', value: '/etc/dhcp3/dhcpd.conf', description: 'Set dhcp3 server configuration path')
option('policykit', type: 'boolean', value: true, description: 'Enable policykit support')
option('pulseaudio', type: 'boolean', value: true, description: 'Enable PulseAudio support')
+option('pythoninstalldir', type: 'string', description: 'Path to python site-packages dir relative to ${prefix}')
option('systemdsystemunitdir', type: 'string', description: 'Path to systemd system unit dir relative to ${prefix}')
option('systemduserunitdir', type: 'string', description: 'Path to systemd user unit dir relative to ${prefix}')
option('sendto-plugins', type: 'array', choices: ['Caja', 'Nemo', 'Nautilus'], value: ['Caja', 'Nemo', 'Nautilus'], description: 'Install sendto plugins for various filemanagers')
--
2.34.1

View File

@@ -0,0 +1,72 @@
Fix fail to enable bluetooth issue
When launch blueman-manager while bluetooth is disable, it may fails
with error:
Failed to enable bluetooth
Because when get bluetooth status right after change its status, the
status may not be updated that plugin applet/KillSwitch.py sets the
bluetooth status via method of another dbus service which doesn't return
immediately.
Provides a new dbus method for PowerManager which checks whether dbus
method SetBluetoothStatus() has finished. Then it makes sure to get
right bluetooth status.
Upstream-Status: Inappropriate
Send to upstream but not accepted:
https://github.com/blueman-project/blueman/pull/1121
Signed-off-by: Kai Kang <kai.kang@windriver.com>
---
blueman/Functions.py | 10 ++++++++++
blueman/plugins/applet/PowerManager.py | 4 ++++
2 files changed, 14 insertions(+)
diff --git a/blueman/Functions.py b/blueman/Functions.py
index 3917f42..b4d5eae 100644
--- a/blueman/Functions.py
+++ b/blueman/Functions.py
@@ -80,6 +80,16 @@ def check_bluetooth_status(message: str, exitfunc: Callable[[], Any]) -> None:
return
applet.SetBluetoothStatus('(b)', True)
+
+ timeout = time.time() + 10
+ while applet.GetRequestStatus():
+ time.sleep(0.1)
+ if time.time() > timeout:
+ # timeout 5s has been set in applet/PowerManager.py
+ # so it should NOT reach timeout here
+ logging.warning('Should NOT reach timeout.')
+ break
+
if not applet.GetBluetoothStatus():
print('Failed to enable bluetooth')
exitfunc()
diff --git a/blueman/plugins/applet/PowerManager.py b/blueman/plugins/applet/PowerManager.py
index c2f7bc3..bf6c99f 100644
--- a/blueman/plugins/applet/PowerManager.py
+++ b/blueman/plugins/applet/PowerManager.py
@@ -63,6 +63,7 @@ class PowerManager(AppletPlugin, StatusIconProvider):
self._add_dbus_signal("BluetoothStatusChanged", "b")
self._add_dbus_method("SetBluetoothStatus", ("b",), "", self.request_power_state)
self._add_dbus_method("GetBluetoothStatus", (), "b", self.get_bluetooth_status)
+ self._add_dbus_method("GetRequestStatus", (), "b", self.get_request_status)
def on_unload(self) -> None:
self.parent.Plugins.Menu.unregister(self)
@@ -196,6 +197,9 @@ class PowerManager(AppletPlugin, StatusIconProvider):
def get_bluetooth_status(self) -> bool:
return self.current_state
+ def get_request_status(self):
+ return self.request_in_progress
+
def on_adapter_property_changed(self, _path: str, key: str, value: Any) -> None:
if key == "Powered":
if value and not self.current_state:
--
2.31.1

View File

@@ -0,0 +1,89 @@
DESCRIPTION = "Blueman is a GTK+ Bluetooth Manager"
LICENSE = "GPL-3.0-only"
LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
DEPENDS = "gtk+3 glib-2.0 bluez5 python3-pygobject python3-cython-native"
inherit meson gettext systemd gsettings pkgconfig python3native gtk-icon-cache useradd features_check
REQUIRED_DISTRO_FEATURES = "gobject-introspection-data"
SRC_URI = " \
git://github.com/blueman-project/blueman.git;protocol=https;branch=2-3-stable \
file://0001-Search-for-cython3.patch \
file://0002-fix-fail-to-enable-bluetooth.patch \
file://0001-meson-add-pythoninstalldir-option.patch \
file://0001-meson-DO-not-emit-absolute-path-when-S-B.patch \
"
S = "${WORKDIR}/git"
SRCREV = "c85e7afb8d6547d4c35b7b639124de8e999c3650"
EXTRA_OEMESON = "-Druntime_deps_check=false -Dpythoninstalldir=${@noprefix('PYTHON_SITEPACKAGES_DIR', d)}"
SYSTEMD_SERVICE:${PN} = "${BPN}-mechanism.service"
SYSTEMD_AUTO_ENABLE:${PN} = "disable"
RRECOMMENDS:${PN} += "adwaita-icon-theme"
RDEPENDS:${PN} += " \
python3-core \
python3-ctypes \
python3-dbus \
python3-pygobject \
python3-terminal \
python3-fcntl \
packagegroup-tools-bluetooth \
"
PACKAGECONFIG ??= " \
${@bb.utils.filter('DISTRO_FEATURES', 'polkit pulseaudio ', d)} \
thunar \
"
PACKAGECONFIG[thunar] = "-Dthunar-sendto=true,-Dthunar-sendto=false"
PACKAGECONFIG[pulseaudio] = "-Dpulseaudio=true,-Dpulseaudio=false"
PACKAGECONFIG[polkit] = "-Dpolicykit=true,-Dpolicykit=false"
FILES:${PN} += " \
${datadir} \
${systemd_user_unitdir} \
${PYTHON_SITEPACKAGES_DIR} \
"
# In code, path to python is a variable that is replaced with path to native version of it
# during the configure stage, e.g ../recipe-sysroot-native/usr/bin/python3-native/python3.
# Replace it with #!/usr/bin/env python3
do_install:append() {
sed -i "1s/.*/#!\/usr\/bin\/env python3/" ${D}${prefix}/libexec/blueman-rfcomm-watcher \
${D}${prefix}/libexec/blueman-mechanism \
${D}${bindir}/blueman-adapters \
${D}${bindir}/blueman-applet \
${D}${bindir}/blueman-manager \
${D}${bindir}/blueman-sendto \
${D}${bindir}/blueman-services \
${D}${bindir}/blueman-tray
}
do_install:append() {
install -d ${D}${datadir}/polkit-1/rules.d
cat >${D}${datadir}/polkit-1/rules.d/51-blueman.rules <<EOF
/* Allow users in wheel group to use blueman feature requiring root without authentication */
polkit.addRule(function(action, subject) {
if ((action.id == "org.blueman.network.setup" ||
action.id == "org.blueman.dhcp.client" ||
action.id == "org.blueman.rfkill.setstate" ||
action.id == "org.blueman.pppd.pppconnect") &&
subject.isInGroup("wheel")) {
return polkit.Result.YES;
}
});
EOF
}
USERADD_PACKAGES = "${PN}"
USERADD_PARAM:${PN} = "--system --no-create-home --user-group --home-dir ${sysconfdir}/polkit-1 --shell /bin/nologin polkitd"
do_install:append() {
# Fix up permissions on polkit rules.d to work with rpm4 constraints
chmod 700 ${D}/${datadir}/polkit-1/rules.d
chown polkitd:root ${D}/${datadir}/polkit-1/rules.d
}

View File

@@ -0,0 +1,32 @@
From 318a0e7dfaa0f5f233a20c0b347948c8004cf6af Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Wed, 20 Oct 2021 14:02:09 -0700
Subject: [PATCH] bluepy: Fix username issue with tarballs
Fixes
Cannot change ownership to uid 1000, gid 1000: Operation not permitted
Upstream-Status: Submitted [https://github.com/IanHarvey/bluepy/pull/462]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
bluepy/Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/bluepy/Makefile
+++ b/bluepy/Makefile
@@ -30,13 +30,13 @@ bluepy-helper: $(LOCAL_SRCS) $(IMPORT_SR
$(CC) -L. $(CFLAGS) $(CPPFLAGS) -o $@ $(LOCAL_SRCS) $(IMPORT_SRCS) $(LDLIBS)
$(IMPORT_SRCS): bluez-src.tgz
- tar xzf $<
+ tar xzf $< --no-same-owner
touch $(IMPORT_SRCS)
.PHONY: bluez-tarfile
bluez-tarfile:
- (cd ..; tar czf bluepy/bluez-src.tgz $(BLUEZ_PATH))
+ (cd ..; tar czf bluepy/bluez-src.tgz $(BLUEZ_PATH) --no-same-owner)
GET_SERVICES=get_services.py

View File

@@ -0,0 +1,20 @@
DESCRIPTION = "Python interface to Bluetooth LE on Linux"
HOMEPAGE = "https://github.com/IanHarvey/bluepy"
SECTION = "devel/python"
LICENSE = "GPL-2.0-only & PD"
LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=59e0d45ea684dda215889aa1b5acd001"
DEPENDS = "glib-2.0"
SRCREV = "7ad565231a97c304c0eff45f2649cd005e69db09"
PV = "1.3.0+git"
SRC_URI = "git://github.com/IanHarvey/bluepy.git;protocol=https;branch=master \
file://0001-bluepy-Fix-username-issue-with-tarballs.patch \
"
S = "${WORKDIR}/git"
inherit setuptools3 pkgconfig
RDEPENDS:${PN} = "bluez5"
TARGET_CC_ARCH += "${LDFLAGS}"

View File

@@ -0,0 +1,768 @@
Upstream-Status: Submitted [https://github.com/khvzak/bluez-tools/pull/48]
From e5db2eec2591f0109f0eb7c2631055210b55f2f5 Mon Sep 17 00:00:00 2001
Message-Id: <e5db2eec2591f0109f0eb7c2631055210b55f2f5.1710791277.git.joerg.sommer@navimatix.de>
From: thatlittlegit <personal@thatlittlegit.tk>
Date: Sat, 7 Nov 2020 01:07:24 -0500
Subject: [PATCH 1/9] Remove memory leaks and overall restructure
manager_find_adapter
---
src/lib/manager.c | 61 +++++++++++++++++++++++++++++++++--------------
1 file changed, 43 insertions(+), 18 deletions(-)
diff --git a/src/lib/manager.c b/src/lib/manager.c
index 5286a3a..2263afc 100644
--- a/src/lib/manager.c
+++ b/src/lib/manager.c
@@ -136,43 +136,68 @@ const gchar *manager_find_adapter(Manager *self, const gchar *pattern, GError **
GVariant *ifaces_and_properties;
GVariantIter i;
+ gchar *pattern_lowercase = g_ascii_strdown(pattern, -1);
+
g_variant_iter_init(&i, objects);
- while (g_variant_iter_next(&i, "{&o@a{sa{sv}}}", &object_path, &ifaces_and_properties))
+ gboolean still_looking = TRUE;
+ while (still_looking && g_variant_iter_next(&i, "{&o@a{sa{sv}}}", &object_path, &ifaces_and_properties))
{
const gchar *interface_name;
- GVariant *properties;
GVariantIter ii;
+ GVariant* properties;
g_variant_iter_init(&ii, ifaces_and_properties);
while (g_variant_iter_next(&ii, "{&s@a{sv}}", &interface_name, &properties))
{
- if (g_strstr_len(g_ascii_strdown(interface_name, -1), -1, "adapter"))
+ gchar *interface_name_lowercase = g_ascii_strdown(interface_name, -1);
+ if (strstr(interface_name_lowercase, "adapter"))
{
- const gchar *object_base_name = g_path_get_basename(object_path);
- if (g_strstr_len(g_ascii_strdown(object_base_name, -1), -1, g_ascii_strdown(pattern, -1)))
+ g_free(interface_name_lowercase);
+
+ gchar *object_base_name_original = g_path_get_basename(object_path);
+ gchar *object_base_name = g_ascii_strdown(interface_name, -1);
+ g_free(object_base_name_original);
+
+ if (strstr(object_base_name, pattern_lowercase))
{
- const gchar *retVal = g_strdup(object_path);
- g_variant_unref(properties);
- g_variant_unref(ifaces_and_properties);
- g_variant_unref(objects);
- return retVal;
+ still_looking = FALSE;
+ g_free(object_base_name);
+ break;
}
- const gchar *address = g_variant_get_string(g_variant_lookup_value(properties, "Address", NULL), NULL);
- if (g_strstr_len(g_ascii_strdown(address, -1), -1, g_ascii_strdown(pattern, -1)))
+
+ g_free(object_base_name);
+
+ const gchar *address_original = g_variant_get_string(g_variant_lookup_value(properties, "Address", NULL), NULL);
+ gchar *address = g_ascii_strdown(address_original, -1);
+
+ if (strstr(address, pattern_lowercase))
{
- gchar *retVal = g_strdup(object_path);
- g_variant_unref(properties);
- g_variant_unref(ifaces_and_properties);
- g_variant_unref(objects);
- return retVal;
+ still_looking = FALSE;
+ g_free(address);
+ break;
}
+ g_free(address);
}
+ else
+ {
+ g_free(interface_name_lowercase);
+ }
+
g_variant_unref(properties);
}
+
g_variant_unref(ifaces_and_properties);
}
g_variant_unref(objects);
+ g_free(pattern_lowercase);
- return NULL;
+ if (still_looking)
+ {
+ return NULL;
+ }
+ else
+ {
+ return object_path;
+ }
}
GPtrArray *manager_get_adapters(Manager *self)
--
2.34.1
From 163fcc94f1bc7c8f238e78adb03af914a566d979 Mon Sep 17 00:00:00 2001
Message-Id: <163fcc94f1bc7c8f238e78adb03af914a566d979.1710791277.git.joerg.sommer@navimatix.de>
In-Reply-To: <e5db2eec2591f0109f0eb7c2631055210b55f2f5.1710791277.git.joerg.sommer@navimatix.de>
References: <e5db2eec2591f0109f0eb7c2631055210b55f2f5.1710791277.git.joerg.sommer@navimatix.de>
From: thatlittlegit <personal@thatlittlegit.tk>
Date: Sat, 7 Nov 2020 22:12:21 -0500
Subject: [PATCH 2/9] Replace manager_default_adapter with
manager_find_adapter(..., NULL, ...)
---
src/lib/helpers.c | 57 ++++++++++++++++++-----------------------------
src/lib/manager.c | 51 +++++++++---------------------------------
src/lib/manager.h | 1 -
3 files changed, 33 insertions(+), 76 deletions(-)
diff --git a/src/lib/helpers.c b/src/lib/helpers.c
index d7e95f9..99561b5 100644
--- a/src/lib/helpers.c
+++ b/src/lib/helpers.c
@@ -159,52 +159,39 @@ Adapter *find_adapter(const gchar *name, GError **error)
Manager *manager = g_object_new(MANAGER_TYPE, NULL);
- // If name is null or empty - return default adapter
- if (name == NULL || strlen(name) == 0)
+ // Try to find by id
+ adapter_path = (gchar *) manager_find_adapter(manager, name, error);
+
+ // Found
+ if (adapter_path)
{
- adapter_path = (gchar *) manager_default_adapter(manager, error);
- if (adapter_path)
- {
- // adapter = g_object_new(ADAPTER_TYPE, "DBusObjectPath", adapter_path, NULL);
- adapter = adapter_new(adapter_path);
- }
+ // adapter = g_object_new(ADAPTER_TYPE, "DBusObjectPath", adapter_path, NULL);
+ adapter = adapter_new(adapter_path);
}
else
{
- // Try to find by id
- adapter_path = (gchar *) manager_find_adapter(manager, name, error);
-
- // Found
- if (adapter_path)
+ // Try to find by name
+ const GPtrArray *adapters_list = manager_get_adapters(manager);
+ g_assert(adapters_list != NULL);
+ for (int i = 0; i < adapters_list->len; i++)
{
+ adapter_path = g_ptr_array_index(adapters_list, i);
// adapter = g_object_new(ADAPTER_TYPE, "DBusObjectPath", adapter_path, NULL);
adapter = adapter_new(adapter_path);
- }
- else
- {
- // Try to find by name
- const GPtrArray *adapters_list = manager_get_adapters(manager);
- g_assert(adapters_list != NULL);
- for (int i = 0; i < adapters_list->len; i++)
+ adapter_path = NULL;
+
+ if (g_strcmp0(name, adapter_get_name(adapter, error)) == 0)
{
- adapter_path = g_ptr_array_index(adapters_list, i);
- // adapter = g_object_new(ADAPTER_TYPE, "DBusObjectPath", adapter_path, NULL);
- adapter = adapter_new(adapter_path);
- adapter_path = NULL;
-
- if (g_strcmp0(name, adapter_get_name(adapter, error)) == 0)
+ if (*error)
{
- if (error)
- {
- g_error_free(*error);
- *error = NULL;
- }
- break;
+ g_error_free(*error);
+ *error = NULL;
}
-
- g_object_unref(adapter);
- adapter = NULL;
+ break;
}
+
+ g_object_unref(adapter);
+ adapter = NULL;
}
}
diff --git a/src/lib/manager.c b/src/lib/manager.c
index 2263afc..891fc45 100644
--- a/src/lib/manager.c
+++ b/src/lib/manager.c
@@ -84,45 +84,6 @@ GVariant *manager_get_managed_objects(Manager *self, GError **error)
return retVal;
}
-const gchar *manager_default_adapter(Manager *self, GError **error)
-{
- g_assert(MANAGER_IS(self));
-
- GVariant *objects = NULL;
- objects = manager_get_managed_objects(self, error);
- if (objects == NULL)
- return NULL;
-
- const gchar *object_path;
- GVariant *ifaces_and_properties;
- GVariantIter i;
-
- g_variant_iter_init(&i, objects);
- while (g_variant_iter_next(&i, "{&o@a{sa{sv}}}", &object_path, &ifaces_and_properties))
- {
- const gchar *interface_name;
- GVariant *properties;
- GVariantIter ii;
- g_variant_iter_init(&ii, ifaces_and_properties);
- while (g_variant_iter_next(&ii, "{&s@a{sv}}", &interface_name, &properties))
- {
- if (g_strstr_len(g_ascii_strdown(interface_name, -1), -1, "adapter"))
- {
- const gchar *retVal = g_strdup(object_path);
- g_variant_unref(properties);
- g_variant_unref(ifaces_and_properties);
- g_variant_unref(objects);
- return retVal;
- }
- g_variant_unref(properties);
- }
- g_variant_unref(ifaces_and_properties);
- }
- g_variant_unref(objects);
-
- return NULL;
-}
-
const gchar *manager_find_adapter(Manager *self, const gchar *pattern, GError **error)
{
g_assert(MANAGER_IS(self));
@@ -136,7 +97,11 @@ const gchar *manager_find_adapter(Manager *self, const gchar *pattern, GError **
GVariant *ifaces_and_properties;
GVariantIter i;
- gchar *pattern_lowercase = g_ascii_strdown(pattern, -1);
+ gchar *pattern_lowercase = NULL;
+ if (pattern != NULL)
+ {
+ pattern_lowercase = g_ascii_strdown(pattern, -1);
+ }
g_variant_iter_init(&i, objects);
gboolean still_looking = TRUE;
@@ -153,6 +118,12 @@ const gchar *manager_find_adapter(Manager *self, const gchar *pattern, GError **
{
g_free(interface_name_lowercase);
+ if (!pattern_lowercase)
+ {
+ still_looking = FALSE;
+ break;
+ }
+
gchar *object_base_name_original = g_path_get_basename(object_path);
gchar *object_base_name = g_ascii_strdown(interface_name, -1);
g_free(object_base_name_original);
diff --git a/src/lib/manager.h b/src/lib/manager.h
index 0c9e052..b651812 100644
--- a/src/lib/manager.h
+++ b/src/lib/manager.h
@@ -54,7 +54,6 @@ extern "C" {
* Method definitions.
*/
GVariant *manager_get_managed_objects(Manager *self, GError **error);
- const gchar *manager_default_adapter(Manager *self, GError **error);
const gchar *manager_find_adapter(Manager *self, const gchar *pattern, GError **error);
GPtrArray *manager_get_adapters(Manager *self);
const gchar **manager_get_devices(Manager *self, const gchar *adapter_pattern);
--
2.34.1
From b463d9cfc2390ca6352c16e6f6e113cf42d0f688 Mon Sep 17 00:00:00 2001
Message-Id: <b463d9cfc2390ca6352c16e6f6e113cf42d0f688.1710791277.git.joerg.sommer@navimatix.de>
In-Reply-To: <e5db2eec2591f0109f0eb7c2631055210b55f2f5.1710791277.git.joerg.sommer@navimatix.de>
References: <e5db2eec2591f0109f0eb7c2631055210b55f2f5.1710791277.git.joerg.sommer@navimatix.de>
From: thatlittlegit <personal@thatlittlegit.tk>
Date: Sat, 7 Nov 2020 23:38:42 -0500
Subject: [PATCH 3/9] Fix remaining g_ascii_strdown leaks
---
src/lib/helpers.c | 2 +-
src/lib/manager.c | 5 ++++-
src/lib/properties.c | 4 ++--
3 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/src/lib/helpers.c b/src/lib/helpers.c
index 99561b5..b61bc07 100644
--- a/src/lib/helpers.c
+++ b/src/lib/helpers.c
@@ -242,7 +242,7 @@ Device *find_device(Adapter *adapter, const gchar *name, GError **error)
if(g_variant_lookup(properties, "Address", "s", &address))
{
- if(g_strcmp0(g_ascii_strdown(address, -1), g_ascii_strdown(name, -1)) == 0)
+ if(name && address && g_ascii_strcasecmp(address, name) == 0)
{
device = device_new(object_path);
}
diff --git a/src/lib/manager.c b/src/lib/manager.c
index 891fc45..d506ae6 100644
--- a/src/lib/manager.c
+++ b/src/lib/manager.c
@@ -200,8 +200,11 @@ GPtrArray *manager_get_adapters(Manager *self)
g_variant_iter_init(&ii, ifaces_and_properties);
while (g_variant_iter_next(&ii, "{&s@a{sv}}", &interface_name, &properties))
{
- if (g_strstr_len(g_ascii_strdown(interface_name, -1), -1, "adapter"))
+ char* interface_name_lowercase = g_ascii_strdown(interface_name, -1);
+ if (strstr(interface_name_lowercase, "adapter"))
g_ptr_array_add(adapter_array, (gpointer) g_strdup(object_path));
+
+ g_free(interface_name_lowercase);
g_variant_unref(properties);
}
g_variant_unref(ifaces_and_properties);
diff --git a/src/lib/properties.c b/src/lib/properties.c
index 8b913d5..70a7640 100644
--- a/src/lib/properties.c
+++ b/src/lib/properties.c
@@ -205,12 +205,12 @@ static void _properties_create_gdbus_proxy(Properties *self, GError **error)
{
if(self->priv->dbus_type && self->priv->dbus_service_name && self->priv->dbus_object_path)
{
- if(g_ascii_strcasecmp(g_ascii_strdown(self->priv->dbus_type, -1), "system") == 0)
+ if(g_ascii_strcasecmp(self->priv->dbus_type, "system") == 0)
{
g_assert(system_conn != NULL);
self->priv->proxy = g_dbus_proxy_new_sync(system_conn, G_DBUS_PROXY_FLAGS_NONE, NULL, self->priv->dbus_service_name, self->priv->dbus_object_path, PROPERTIES_DBUS_INTERFACE, NULL, error);
}
- else if(g_ascii_strcasecmp(g_ascii_strdown(self->priv->dbus_type, -1), "session") == 0)
+ else if(g_ascii_strcasecmp(self->priv->dbus_type, "session") == 0)
{
g_assert(session_conn != NULL);
self->priv->proxy = g_dbus_proxy_new_sync(session_conn, G_DBUS_PROXY_FLAGS_NONE, NULL, self->priv->dbus_service_name, self->priv->dbus_object_path, PROPERTIES_DBUS_INTERFACE, NULL, error);
--
2.34.1
From 7ca191164a3a3d8867b1a4af7cd349dc53569fa3 Mon Sep 17 00:00:00 2001
Message-Id: <7ca191164a3a3d8867b1a4af7cd349dc53569fa3.1710791277.git.joerg.sommer@navimatix.de>
In-Reply-To: <e5db2eec2591f0109f0eb7c2631055210b55f2f5.1710791277.git.joerg.sommer@navimatix.de>
References: <e5db2eec2591f0109f0eb7c2631055210b55f2f5.1710791277.git.joerg.sommer@navimatix.de>
From: thatlittlegit <personal@thatlittlegit.tk>
Date: Sun, 8 Nov 2020 14:04:36 -0500
Subject: [PATCH 4/9] Don't leak g_variant_lookup_value results in bt-obex
---
src/bt-obex.c | 23 ++++++++++++++++-------
1 file changed, 16 insertions(+), 7 deletions(-)
diff --git a/src/bt-obex.c b/src/bt-obex.c
index 8aacb40..0f044a5 100644
--- a/src/bt-obex.c
+++ b/src/bt-obex.c
@@ -213,15 +213,24 @@ static void _obex_opp_client_object_manager_handler(GDBusConnection *connection,
g_hash_table_insert(_transfers, g_strdup(interface_object_path), t);
ObexTransferInfo *info = g_malloc0(sizeof(ObexTransferInfo));
- info->filesize = g_variant_get_uint64(g_variant_lookup_value(properties, "Size", NULL));
- info->filename = g_strdup(g_variant_get_string(g_variant_lookup_value(properties, "Name", NULL), NULL));
- info->status = g_strdup(g_variant_get_string(g_variant_lookup_value(properties, "Status", NULL), NULL));
- ObexSession *session = obex_session_new(g_variant_get_string(g_variant_lookup_value(properties, "Session", NULL), NULL));
-
+
+ GVariant* size_variant = g_variant_lookup_value(properties, "Size", NULL);
+ GVariant* name_variant = g_variant_lookup_value(properties, "Name", NULL);
+ GVariant* status_variant = g_variant_lookup_value(properties, "Status", NULL);
+ GVariant* session_variant = g_variant_lookup_value(properties, "Session", NULL);
+
+ info->filesize = g_variant_get_uint64(size_variant);
+ info->filename = g_variant_dup_string(name_variant, NULL);
+ info->status = g_variant_dup_string(status_variant, NULL);
+ ObexSession *session = obex_session_new(g_variant_get_string(session_variant, NULL));
info->obex_root = g_strdup(obex_session_get_root(session, NULL));
-
+
+ g_variant_unref(size_variant);
+ g_variant_unref(name_variant);
+ g_variant_unref(status_variant);
+ g_variant_unref(session_variant);
g_object_unref(session);
-
+
g_hash_table_insert(_transfer_infos, g_strdup(interface_object_path), info);
if(g_strcmp0(info->status, "queued") == 0)
g_print("[Transfer#%s] Waiting...\n", info->filename);
--
2.34.1
From 7100380b710b36f8e31748ac5bf0e6ffb7c4eed7 Mon Sep 17 00:00:00 2001
Message-Id: <7100380b710b36f8e31748ac5bf0e6ffb7c4eed7.1710791277.git.joerg.sommer@navimatix.de>
In-Reply-To: <e5db2eec2591f0109f0eb7c2631055210b55f2f5.1710791277.git.joerg.sommer@navimatix.de>
References: <e5db2eec2591f0109f0eb7c2631055210b55f2f5.1710791277.git.joerg.sommer@navimatix.de>
From: thatlittlegit <personal@thatlittlegit.tk>
Date: Thu, 12 Nov 2020 21:41:55 -0500
Subject: [PATCH 5/9] Correctly free temporary values in bt-obex
---
src/bt-obex.c | 35 +++++++++++++++++++++++++----------
src/lib/helpers.c | 3 ++-
2 files changed, 27 insertions(+), 11 deletions(-)
diff --git a/src/bt-obex.c b/src/bt-obex.c
index 0f044a5..547186b 100644
--- a/src/bt-obex.c
+++ b/src/bt-obex.c
@@ -70,25 +70,32 @@ static void _obex_server_object_manager_handler(GDBusConnection *connection, con
const gchar *interface_object_path = g_variant_get_string(g_variant_get_child_value(parameters, 0), NULL);
GVariant *interfaces_and_properties = g_variant_get_child_value(parameters, 1);
GVariant *properties = NULL;
-
+
if(g_variant_lookup(interfaces_and_properties, OBEX_TRANSFER_DBUS_INTERFACE, "@a{sv}", &properties))
{
g_print("[OBEX Server] Transfer started\n");
ObexTransfer *t = obex_transfer_new(interface_object_path);
g_hash_table_insert(_transfers, g_strdup(interface_object_path), t);
-
+
+ GVariant* size_variant = g_variant_lookup_value(properties, "Size", NULL);
+ GVariant* status_variant = g_variant_lookup_value(properties, "Status", NULL);
+ GVariant* session_variant = g_variant_lookup_value(properties, "Session", NULL);
+
ObexTransferInfo *info = g_malloc0(sizeof(ObexTransferInfo));
- info->filesize = g_variant_get_uint64(g_variant_lookup_value(properties, "Size", NULL));
- info->status = g_strdup(g_variant_get_string(g_variant_lookup_value(properties, "Status", NULL), NULL));
- ObexSession *session = obex_session_new(g_variant_get_string(g_variant_lookup_value(properties, "Session", NULL), NULL));
-
+ info->filesize = g_variant_get_uint64(size_variant);
+ info->status = g_strdup(g_variant_get_string(status_variant, NULL));
+
+ ObexSession *session = obex_session_new(g_variant_get_string(session_variant, NULL));
info->obex_root = g_strdup(obex_session_get_root(session, NULL));
-
g_object_unref(session);
+
+ g_variant_unref(size_variant);
+ g_variant_unref(status_variant);
+ g_variant_unref(session_variant);
g_hash_table_insert(_transfer_infos, g_strdup(interface_object_path), info);
}
-
+
if(g_variant_lookup(interfaces_and_properties, OBEX_SESSION_DBUS_INTERFACE, "@a{sv}", &properties))
{
g_print("[OBEX Server] OBEX session opened\n");
@@ -177,7 +184,12 @@ static void _obex_server_properties_handler(GDBusConnection *connection, const g
{
g_print("[OBEX Server] Transfer succeeded\n");
ObexTransferInfo *info = g_hash_table_lookup(_transfer_infos, object_path);
- g_rename(g_build_filename(info->obex_root, info->filename, NULL), g_build_filename(_root_path, info->filename, NULL));
+
+ gchar* old_name = g_build_filename(info->obex_root, info->filename, NULL);
+ gchar* new_name = g_build_filename(_root_path, info->filename, NULL);
+ g_rename(old_name, new_name);
+ g_free(old_name);
+ g_free(new_name);
}
else if(g_strcmp0(status, "error") == 0)
{
@@ -202,7 +214,8 @@ static void _obex_opp_client_object_manager_handler(GDBusConnection *connection,
{
if(g_strcmp0(signal_name, "InterfacesAdded") == 0)
{
- const gchar *interface_object_path = g_variant_get_string(g_variant_get_child_value(parameters, 0), NULL);
+ GVariant* interface_value = g_variant_get_child_value(parameters, 0);
+ const gchar *interface_object_path = g_variant_get_string(interface_value, NULL);
GVariant *interfaces_and_properties = g_variant_get_child_value(parameters, 1);
GVariant *properties = NULL;
@@ -242,6 +255,8 @@ static void _obex_opp_client_object_manager_handler(GDBusConnection *connection,
}
g_variant_unref(interfaces_and_properties);
+ g_variant_unref(interface_value);
+
if(properties)
g_variant_unref(properties);
}
diff --git a/src/lib/helpers.c b/src/lib/helpers.c
index b61bc07..d9e2257 100644
--- a/src/lib/helpers.c
+++ b/src/lib/helpers.c
@@ -171,7 +171,7 @@ Adapter *find_adapter(const gchar *name, GError **error)
else
{
// Try to find by name
- const GPtrArray *adapters_list = manager_get_adapters(manager);
+ GPtrArray *adapters_list = manager_get_adapters(manager);
g_assert(adapters_list != NULL);
for (int i = 0; i < adapters_list->len; i++)
{
@@ -193,6 +193,7 @@ Adapter *find_adapter(const gchar *name, GError **error)
g_object_unref(adapter);
adapter = NULL;
}
+ g_ptr_array_unref(adapters_list);
}
g_object_unref(manager);
--
2.34.1
From 860fb6e19a7bc272722c36a980004044bc9906e5 Mon Sep 17 00:00:00 2001
Message-Id: <860fb6e19a7bc272722c36a980004044bc9906e5.1710791277.git.joerg.sommer@navimatix.de>
In-Reply-To: <e5db2eec2591f0109f0eb7c2631055210b55f2f5.1710791277.git.joerg.sommer@navimatix.de>
References: <e5db2eec2591f0109f0eb7c2631055210b55f2f5.1710791277.git.joerg.sommer@navimatix.de>
From: thatlittlegit <personal@thatlittlegit.tk>
Date: Thu, 12 Nov 2020 21:45:51 -0500
Subject: [PATCH 6/9] Use g_hash_table_new_full() instead of manual freeing
---
src/bt-obex.c | 56 +++++++++++++++++----------------------------------
1 file changed, 18 insertions(+), 38 deletions(-)
diff --git a/src/bt-obex.c b/src/bt-obex.c
index 547186b..413c12d 100644
--- a/src/bt-obex.c
+++ b/src/bt-obex.c
@@ -55,6 +55,14 @@ struct _ObexTransferInfo {
gchar *status;
};
+static void obex_transfer_info_free(ObexTransferInfo* info)
+{
+ g_free(info->filename);
+ g_free(info->obex_root);
+ g_free(info->status);
+ g_free(info);
+}
+
static void sigterm_handler(int sig)
{
g_message("%s received", sig == SIGTERM ? "SIGTERM" : "SIGINT");
@@ -117,10 +125,7 @@ static void _obex_server_object_manager_handler(GDBusConnection *connection, con
if(g_strcmp0(*inf, OBEX_TRANSFER_DBUS_INTERFACE) == 0)
{
g_print("[OBEX Server] OBEX transfer closed\n");
- ObexTransfer *transfer = g_hash_table_lookup(_transfers, interface_object_path);
g_hash_table_remove(_transfers, interface_object_path);
- g_object_unref(transfer);
- g_free(g_hash_table_lookup(_transfer_infos, interface_object_path));
g_hash_table_remove(_transfer_infos, interface_object_path);
}
@@ -272,10 +277,7 @@ static void _obex_opp_client_object_manager_handler(GDBusConnection *connection,
if(g_strcmp0(*inf, OBEX_TRANSFER_DBUS_INTERFACE) == 0)
{
// g_print("[OBEX Client] OBEX transfer closed\n");
- ObexTransfer *transfer = g_hash_table_lookup(_transfers, interface_object_path);
g_hash_table_remove(_transfers, interface_object_path);
- g_object_unref(transfer);
- g_free(g_hash_table_lookup(_transfer_infos, interface_object_path));
g_hash_table_remove(_transfer_infos, interface_object_path);
if (g_main_loop_is_running(mainloop))
g_main_loop_quit(mainloop);
@@ -514,8 +516,8 @@ int main(int argc, char *argv[])
exit_if_error(error);
}
- _transfers = g_hash_table_new(g_str_hash, g_str_equal);
- _transfer_infos = g_hash_table_new(g_str_hash, g_str_equal);
+ _transfers = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_object_unref);
+ _transfer_infos = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, (GDestroyNotify)obex_transfer_info_free);
ObexAgentManager *manager = obex_agent_manager_new();
@@ -552,21 +554,10 @@ int main(int argc, char *argv[])
g_hash_table_iter_init(&iter, _transfers);
while (g_hash_table_iter_next(&iter, &key, &value))
{
- ObexTransfer *t = OBEX_TRANSFER(value);
- obex_transfer_cancel(t, NULL); // skip errors
- g_object_unref(t);
- g_hash_table_iter_remove(&iter);
- }
- g_hash_table_unref(_transfers);
-
- // Remove transfer information
- g_hash_table_iter_init(&iter, _transfer_infos);
- while (g_hash_table_iter_next(&iter, &key, &value))
- {
- g_free(value);
- g_hash_table_iter_remove(&iter);
+ obex_transfer_cancel(OBEX_TRANSFER(value), NULL);
}
g_hash_table_unref(_transfers);
+ g_hash_table_unref(_transfer_infos);
g_dbus_connection_signal_unsubscribe(session_conn, obex_server_object_id);
g_dbus_connection_signal_unsubscribe(session_conn, obex_server_properties_id);
@@ -588,8 +579,8 @@ int main(int argc, char *argv[])
exit_if_error(error);
}
- _transfers = g_hash_table_new(g_str_hash, g_str_equal);
- _transfer_infos = g_hash_table_new(g_str_hash, g_str_equal);
+ _transfers = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_object_unref);
+ _transfer_infos = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free);
gchar * files_to_send[] = {NULL, NULL};
files_to_send[0] = g_path_is_absolute(opp_file_arg) ? g_strdup(opp_file_arg) : get_absolute_path(opp_file_arg);
@@ -663,24 +654,13 @@ int main(int argc, char *argv[])
g_hash_table_iter_init(&iter, _transfers);
while (g_hash_table_iter_next(&iter, &key, &value))
{
- ObexTransfer *t = OBEX_TRANSFER(value);
- obex_transfer_cancel(t, NULL); // skip errors
- g_object_unref(t);
- g_hash_table_iter_remove(&iter);
+ obex_transfer_cancel(OBEX_TRANSFER(value), NULL);
}
g_hash_table_unref(_transfers);
-
- // Remove transfer information objects
- g_hash_table_iter_init(&iter, _transfer_infos);
- while (g_hash_table_iter_next(&iter, &key, &value))
- {
- g_free(value);
- g_hash_table_iter_remove(&iter);
- }
- g_hash_table_unref(_transfers);
-
- g_object_unref(client);
+ g_hash_table_unref(_transfer_infos);
+ g_object_unref(client);
+ g_object_unref(session);
g_variant_unref(device_dict);
g_free(src_address);
--
2.34.1
From 9804eb7e5996c52cc542eef59ba3b5f4d0b0b2f9 Mon Sep 17 00:00:00 2001
Message-Id: <9804eb7e5996c52cc542eef59ba3b5f4d0b0b2f9.1710791277.git.joerg.sommer@navimatix.de>
In-Reply-To: <e5db2eec2591f0109f0eb7c2631055210b55f2f5.1710791277.git.joerg.sommer@navimatix.de>
References: <e5db2eec2591f0109f0eb7c2631055210b55f2f5.1710791277.git.joerg.sommer@navimatix.de>
From: thatlittlegit <personal@thatlittlegit.tk>
Date: Thu, 12 Nov 2020 21:51:34 -0500
Subject: [PATCH 7/9] Don't set filesize if we don't know the size
I only meant to fix the g_variant_unref warning, but fixing all of them
works too!
---
src/bt-obex.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/src/bt-obex.c b/src/bt-obex.c
index 413c12d..219d458 100644
--- a/src/bt-obex.c
+++ b/src/bt-obex.c
@@ -90,14 +90,22 @@ static void _obex_server_object_manager_handler(GDBusConnection *connection, con
GVariant* session_variant = g_variant_lookup_value(properties, "Session", NULL);
ObexTransferInfo *info = g_malloc0(sizeof(ObexTransferInfo));
- info->filesize = g_variant_get_uint64(size_variant);
info->status = g_strdup(g_variant_get_string(status_variant, NULL));
ObexSession *session = obex_session_new(g_variant_get_string(session_variant, NULL));
info->obex_root = g_strdup(obex_session_get_root(session, NULL));
g_object_unref(session);
- g_variant_unref(size_variant);
+ if (size_variant != NULL)
+ {
+ info->filesize = g_variant_get_uint64(size_variant);
+ g_variant_unref(size_variant);
+ }
+ else
+ {
+ info->filesize = 0;
+ }
+
g_variant_unref(status_variant);
g_variant_unref(session_variant);
--
2.34.1
From 9566f84464d486983ec597945bc4d5d1594ed830 Mon Sep 17 00:00:00 2001
Message-Id: <9566f84464d486983ec597945bc4d5d1594ed830.1710791277.git.joerg.sommer@navimatix.de>
In-Reply-To: <e5db2eec2591f0109f0eb7c2631055210b55f2f5.1710791277.git.joerg.sommer@navimatix.de>
References: <e5db2eec2591f0109f0eb7c2631055210b55f2f5.1710791277.git.joerg.sommer@navimatix.de>
From: thatlittlegit <personal@thatlittlegit.tk>
Date: Sun, 15 Nov 2020 16:18:36 -0500
Subject: [PATCH 8/9] Fix a use-after-free in bt-obex
---
src/bt-obex.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/bt-obex.c b/src/bt-obex.c
index 219d458..7dc5d6b 100644
--- a/src/bt-obex.c
+++ b/src/bt-obex.c
@@ -626,7 +626,7 @@ int main(int argc, char *argv[])
mainloop = g_main_loop_new(NULL, FALSE);
ObexClient *client = obex_client_new();
- const gchar *session_path = obex_client_create_session(client, dst_address, device_dict, &error);
+ const gchar *session_path = obex_client_create_session(client, dst_address, g_variant_ref(device_dict), &error);
exit_if_error(error);
ObexSession *session = obex_session_new(session_path);
ObexObjectPush *oop = obex_object_push_new(obex_session_get_dbus_object_path(session));
--
2.34.1
From 5271a4c6419b54a0b18070d39bfc69fae2819c00 Mon Sep 17 00:00:00 2001
Message-Id: <5271a4c6419b54a0b18070d39bfc69fae2819c00.1710791277.git.joerg.sommer@navimatix.de>
In-Reply-To: <e5db2eec2591f0109f0eb7c2631055210b55f2f5.1710791277.git.joerg.sommer@navimatix.de>
References: <e5db2eec2591f0109f0eb7c2631055210b55f2f5.1710791277.git.joerg.sommer@navimatix.de>
From: thatlittlegit <personal@thatlittlegit.tk>
Date: Sat, 21 Nov 2020 13:09:46 -0500
Subject: [PATCH 9/9] Fix running sdptool if it isn't in $PATH
---
src/bt-device.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/bt-device.c b/src/bt-device.c
index a739b98..948a10c 100644
--- a/src/bt-device.c
+++ b/src/bt-device.c
@@ -331,9 +331,9 @@ static GHashTable *_bt_device_sdp_browse(const gchar *device_path, const gchar *
}
if(pattern == NULL || strlen(pattern) == 0)
- execl("/bin/sdptool", "/bin/sdptool", "browse", "--xml", device_path, (char *) 0);
+ execlp("sdptool", "sdptool", "browse", "--xml", device_path, (char *) 0);
else
- execl("/bin/sdptool", "/bin/sdptool", "browse", "--xml", "--uuid", pattern, device_path, (char *) 0);
+ execlp("sdptool", "sdptool", "browse", "--xml", "--uuid", pattern, device_path, (char *) 0);
}
if(pid == -1)
--
2.34.1

View File

@@ -0,0 +1,41 @@
Upstream-Status: Submitted [https://github.com/khvzak/bluez-tools/pull/47]
From f9bc83d46f131037f7fa5195a506b65560199d0d Mon Sep 17 00:00:00 2001
Message-Id: <f9bc83d46f131037f7fa5195a506b65560199d0d.1710791715.git.joerg.sommer@navimatix.de>
From: George Talusan <george.talusan@gmail.com>
Date: Mon, 26 Oct 2020 21:35:51 -0400
Subject: [PATCH] fix null checks
---
src/lib/bluez/obex/obex_file_transfer.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/lib/bluez/obex/obex_file_transfer.c b/src/lib/bluez/obex/obex_file_transfer.c
index 2d3dafe..91c41d6 100644
--- a/src/lib/bluez/obex/obex_file_transfer.c
+++ b/src/lib/bluez/obex/obex_file_transfer.c
@@ -194,7 +194,7 @@ GVariant *obex_file_transfer_get_file(ObexFileTransfer *self, const gchar *targe
g_assert(OBEX_FILE_TRANSFER_IS(self));
GVariant *ret = NULL;
GVariant *proxy_ret = g_dbus_proxy_call_sync(self->priv->proxy, "GetFile", g_variant_new ("(ss)", targetfile, sourcefile), G_DBUS_CALL_FLAGS_NONE, -1, NULL, error);
- if (proxy_ret != NULL)
+ if (proxy_ret == NULL)
return NULL;
ret = g_variant_ref_sink(proxy_ret);
g_variant_unref(proxy_ret);
@@ -228,9 +228,9 @@ GVariant *obex_file_transfer_put_file(ObexFileTransfer *self, const gchar *sourc
g_assert(OBEX_FILE_TRANSFER_IS(self));
GVariant *ret = NULL;
GVariant *proxy_ret = g_dbus_proxy_call_sync(self->priv->proxy, "PutFile", g_variant_new ("(ss)", targetfile, sourcefile), G_DBUS_CALL_FLAGS_NONE, -1, NULL, error);
- if (proxy_ret != NULL)
+ if (proxy_ret == NULL)
return NULL;
ret = g_variant_ref_sink(proxy_ret);
g_variant_unref(proxy_ret);
return ret;
-}
\ No newline at end of file
+}
--
2.34.1

View File

@@ -0,0 +1,24 @@
SUMMARY = "Bluez Tools"
DESCRIPTION = "\
Additional tools for bluez5 to list, manage, and show inforations about \
adapters, agents, devices, network connections, and obex. \
"
HOMEPAGE = "https://github.com/khvzak/bluez-tools"
BUGTRACKER = "https://github.com/khvzak/bluez-tools/issues"
LICENSE = "GPL-2.0-only"
LIC_FILES_CHKSUM = "file://COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e"
DEPENDS = "dbus-glib glib-2.0 readline"
SRC_URI = "\
git://github.com/khvzak/bluez-tools.git;protocol=https;branch=master \
file://fix-memory-leaks.patch \
file://obex-file-fix-null-check.patch \
"
SRCREV = "f65321736475429316f07ee94ec0deac8e46ec4a"
S = "${WORKDIR}/git"
inherit autotools pkgconfig
RDEPENDS:${PN} = "bluez5"

View File

@@ -0,0 +1,37 @@
From 7aed36765ae44b41ede7e139da0a11b3696f2e06 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Mon, 13 Nov 2023 00:07:23 -0800
Subject: [PATCH] include bits/stdc++.h only when using libstdc++
We have other c++ runtime implementations e.g. llvm's libc++ which does
not provide this header bits/stdc++.h, therefore make sure that this
header is only included when using libstdc++
Fixes
| /mnt/b/yoe/master/build/tmp/work/core2-64-yoe-linux/cannelloni/1.1.0/git/tcpthread.cpp:27:10: fatal error: 'bits/stdc++.h' file not found
| 27 | #include <bits/stdc++.h>
| | ^~~~~~~~~~~~~~~
Upstream-Status: Submitted [https://github.com/mguentner/cannelloni/pull/56]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
tcpthread.cpp | 2 ++
1 file changed, 2 insertions(+)
diff --git a/tcpthread.cpp b/tcpthread.cpp
index a1b3047..bb5a7b2 100644
--- a/tcpthread.cpp
+++ b/tcpthread.cpp
@@ -24,7 +24,9 @@
#include <cstdint>
#include <cstdio>
+#ifdef __GLIBCXX__
#include <bits/stdc++.h>
+#endif
#include <linux/can.h>
#include <string.h>
--
2.42.1

View File

@@ -0,0 +1,17 @@
SUMMARY = "a SocketCAN over Ethernet tunnel"
HOMEPAGE = "https://github.com/mguentner/cannelloni"
LICENSE = "GPL-2.0-only"
SRC_URI = "git://github.com/mguentner/cannelloni.git;protocol=https;branch=master \
file://0001-include-bits-stdc-.h-only-when-using-libstdc.patch \
"
SRCREV = "3d4fb8c8b07f6d7c62b2bdad7e5a94de61c9a29b"
LIC_FILES_CHKSUM = "file://gpl-2.0.txt;md5=b234ee4d69f5fce4486a80fdaf4a4263"
inherit cmake
S = "${WORKDIR}/git"
PACKAGECONFIG ??= "lksctp-tools"
PACKAGECONFIG[lksctp-tools] = "-DSCTP_SUPPORT=true, -DSCTP_SUPPORT=false, lksctp-tools"

View File

@@ -0,0 +1,40 @@
From 21e9a4bb214648ffd43c66b535fbf096bfcc9f4f Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sun, 24 Jun 2018 00:04:37 -0700
Subject: [PATCH] Unittest: Link librt and libm using -l option
cmake'ry forces full path to .so files when found using
find_package and since we have proper sysrooted toolchain
-lm and -lrt is all we need
Upstream-Status: Inappropriate [Cross compile specific]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
unittest/CMakeLists.txt | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/unittest/CMakeLists.txt b/unittest/CMakeLists.txt
index c4cdf229..e1b63caf 100644
--- a/unittest/CMakeLists.txt
+++ b/unittest/CMakeLists.txt
@@ -57,14 +57,8 @@ elseif (WIN32)
else()
set(CHECK_LIBRARIES "${CHECK_INSTALL_DIR}/lib/libcheck.a")
endif()
-find_package(LibM)
-if (LIBM_FOUND)
- set(CHECK_LIBRARIES "${CHECK_LIBRARIES};LIBM::LIBM")
-endif()
-find_package(LibRt)
-if (LIBRT_FOUND)
- set(CHECK_LIBRARIES "${CHECK_LIBRARIES};LIBRT::LIBRT")
-endif()
+set(CHECK_LIBRARIES "${CHECK_LIBRARIES};-lm")
+set(CHECK_LIBRARIES "${CHECK_LIBRARIES};-lrt")
# Build the C unit tests
add_library(shared-c-unit-tests STATIC shared.c)
--
2.18.0

View File

@@ -0,0 +1,48 @@
SUMMARY = "Civetweb embedded web server"
HOMEPAGE = "https://github.com/civetweb/civetweb"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE.md;md5=ce6ce6eb1b2fd59ee6bab219470442a3"
SRCREV = "d7ba35bbb649209c66e582d5a0244ba988a15159"
SRC_URI = "git://github.com/civetweb/civetweb.git;branch=master;protocol=https \
file://0001-Unittest-Link-librt-and-libm-using-l-option.patch \
"
S = "${WORKDIR}/git"
# civetweb supports building with make or cmake (although cmake lacks few features)
inherit cmake
# Disable Lua and Duktape because they do not compile from CMake (as of v1.8, v1.9 and v1.10).
# Disable ASAN as it is included only in Debug build.
EXTRA_OECMAKE = " \
-DBUILD_SHARED_LIBS=ON \
-DCIVETWEB_ENABLE_DUKTAPE=OFF \
-DCIVETWEB_ENABLE_LUA=OFF \
-DCIVETWEB_ENABLE_ASAN=OFF \
-DCIVETWEB_BUILD_TESTING=OFF \
-DCIVETWEB_SSL_OPENSSL_API_3_0=ON \
"
# Building with ninja fails on missing third_party/lib/libcheck.a (which
# should come from external CMake project)
OECMAKE_GENERATOR = "Unix Makefiles"
PACKAGECONFIG ??= "caching ipv6 server ssl websockets"
PACKAGECONFIG[caching] = "-DCIVETWEB_DISABLE_CACHING=OFF,-DCIVETWEB_DISABLE_CACHING=ON,"
PACKAGECONFIG[cgi] = "-DCIVETWEB_DISABLE_CGI=OFF,-DCIVETWEB_DISABLE_CGI=ON,"
PACKAGECONFIG[cpp] = "-DCIVETWEB_ENABLE_CXX=ON,-DCIVETWEB_ENABLE_CXX=OFF,"
PACKAGECONFIG[debug] = "-DCIVETWEB_ENABLE_MEMORY_DEBUGGING=ON,-DCIVETWEB_ENABLE_MEMORY_DEBUGGING=OFF,"
PACKAGECONFIG[ipv6] = "-DCIVETWEB_ENABLE_IPV6=ON,-DCIVETWEB_ENABLE_IPV6=OFF,"
PACKAGECONFIG[server] = "-DCIVETWEB_ENABLE_SERVER_EXECUTABLE=ON -DCIVETWEB_INSTALL_EXECUTABLE=ON,-DCIVETWEB_ENABLE_SERVER_EXECUTABLE=OFF -DCIVETWEB_INSTALL_EXECUTABLE=OFF,"
PACKAGECONFIG[ssl] = "-DCIVETWEB_ENABLE_SSL=ON -DCIVETWEB_SSL_OPENSSL_API_1_1=OFF -DCIVETWEB_ENABLE_SSL_DYNAMIC_LOADING=OFF,-DCIVETWEB_ENABLE_SSL=OFF,openssl (=1.0.2%),"
PACKAGECONFIG[websockets] = "-DCIVETWEB_ENABLE_WEBSOCKETS=ON,-DCIVETWEB_ENABLE_WEBSOCKETS=OFF,"
do_install:append() {
sed -i -e 's|${RECIPE_SYSROOT_NATIVE}||g' \
-e 's|${RECIPE_SYSROOT}||g' ${D}${libdir}/cmake/civetweb/civetweb-targets.cmake
}
BBCLASSEXTEND = "native"

View File

@@ -0,0 +1,34 @@
SUMMARY = "The dump DAQ test the various inline mode features "
HOMEPAGE = "http://www.snort.org"
SECTION = "libs"
LICENSE = "GPL-2.0-only"
LIC_FILES_CHKSUM = "file://COPYING;md5=f9ce51a65dd738dc1ae631d8b21c40e0"
PARALLEL_MAKE = ""
DEPENDS = "libpcap libpcre libdnet bison-native libnetfilter-queue"
SRC_URI = "http://fossies.org/linux/misc/daq-${PV}.tar.gz \
file://disable-run-test-program-while-cross-compiling.patch \
file://0001-correct-the-location-of-unistd.h.patch \
file://daq-fix-incompatible-pointer-type-error.patch \
"
SRC_URI[sha256sum] = "bdc4e5a24d1ea492c39ee213a63c55466a2e8114b6a9abed609927ae13a7705e"
# these 2 create undeclared dependency on libdnet and libnetfilter-queue from meta-networking
# this error from test-dependencies script:
# daq/daq/latest lost dependency on libdnet libmnl libnetfilter-queue libnfnetlink
#
# never look to /usr/local lib while cross compiling
EXTRA_OECONF = "--enable-nfq-module --disable-ipq-module --includedir=${includedir} \
--with-libpcap-includes=${STAGING_INCDIR} --with-dnet-includes=${STAGING_LIBDIR}"
PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}"
PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
inherit autotools multilib_script
MULTILIB_SCRIPTS += "${PN}:${bindir}/daq-modules-config "
DISABLE_STATIC = ""
BBCLASSEXTEND = "native"

View File

@@ -0,0 +1,48 @@
From b7d54de51553f6d09906c355bd0dd326890c8fe4 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Wed, 29 Mar 2017 15:59:43 -0700
Subject: [PATCH] correct the location of unistd.h
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
os-daq-modules/daq_ipfw.c | 2 +-
os-daq-modules/daq_nfq.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/os-daq-modules/daq_ipfw.c b/os-daq-modules/daq_ipfw.c
index 016beb0..c2a4175 100644
--- a/os-daq-modules/daq_ipfw.c
+++ b/os-daq-modules/daq_ipfw.c
@@ -23,10 +23,10 @@
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
+#include <unistd.h>
#include <sys/types.h>
#include <sys/time.h>
-#include <sys/unistd.h>
#include <netinet/in.h>
#include <sys/socket.h>
diff --git a/os-daq-modules/daq_nfq.c b/os-daq-modules/daq_nfq.c
index 33021c0..4de94b6 100644
--- a/os-daq-modules/daq_nfq.c
+++ b/os-daq-modules/daq_nfq.c
@@ -24,10 +24,10 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <unistd.h>
#include <sys/types.h>
#include <sys/time.h>
-#include <sys/unistd.h>
#include <netinet/ip.h>
--
2.25.1

View File

@@ -0,0 +1,31 @@
Fix daq incompatible pointer type error when gcc option
'-Wincompatible-pointer-types is set:
| ../../daq-2.0.7/os-daq-modules/daq_nfq.c: In function 'SetPktHdr':
| ../../daq-2.0.7/os-daq-modules/daq_nfq.c:394:37: error: passing argument 2
of 'nfq_get_payload' from incompatible pointer type [-Wincompatible-pointer-types]
| 394 | int len = nfq_get_payload(nfad, (char**)pkt);
| | ^~~~~~~~~~~
| | |
| | char **
Upstream-Status: Inactive-Upstream [lastrelease: 2019-03-09]
Signed-off-by: Kai Kang <kai.kang@windriver.com>
---
os-daq-modules/daq_nfq.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/os-daq-modules/daq_nfq.c b/os-daq-modules/daq_nfq.c
index 4de94b6..a6de2f3 100644
--- a/os-daq-modules/daq_nfq.c
+++ b/os-daq-modules/daq_nfq.c
@@ -391,7 +391,7 @@ static inline int SetPktHdr (
DAQ_PktHdr_t* hdr,
uint8_t** pkt
) {
- int len = nfq_get_payload(nfad, (char**)pkt);
+ int len = nfq_get_payload(nfad, (unsigned char**)pkt);
if ( len <= 0 )
return -1;

View File

@@ -0,0 +1,31 @@
Upstream-Status: Inappropriate [embedded specific]
fix the below error:
configure: error: cannot run test program while cross compiling
Signed-off-by: Chunrong Guo <B40290@freescale.com>
--- a/m4/sf.m4old 2015-10-28 10:21:20.270557986 +0800
+++ a/m4/sf.m4 2015-10-28 10:23:22.726551974 +0800
@@ -135,20 +135,7 @@
echo
exit 1
fi
- AC_CACHE_CHECK([for libpcap version >= $1], [daq_cv_libpcap_version_1x], [
- AC_RUN_IFELSE(
- [AC_LANG_PROGRAM(
- [[
- #include <pcap.h>
- #include <string.h>
- extern char pcap_version[];
- ]],
- [[
- if (strcmp(pcap_version, $1) < 0)
- return 1;
- ]])],
- [daq_cv_libpcap_version_1x="yes"],
- [daq_cv_libpcap_version_1x="no"])])
+ AC_CACHE_CHECK([for libpcap version >= $1], [daq_cv_libpcap_version_1x])
if test "x$daq_cv_libpcap_version_1x" = "xno"; then
echo
echo " ERROR! Libpcap library version >= $1 not found."

View File

@@ -0,0 +1,32 @@
From 9357da2a5a829f7a0620e6c19835a65b7b02a8fb Mon Sep 17 00:00:00 2001
From: Khawaja Shaheryar <behzadshaheryar@gmail.com>
Date: Tue, 20 Feb 2024 21:03:26 +0500
Subject: [PATCH] example: Use -lm for the fst module
If -lm is not passed in Makefile.am, the following is seen
| arm-yoe-linux-gnueabi-ld.lld: error: undefined symbol: ceilf
| >>> referenced by math.h:632 (/usr/include/c++/v1/math.h:632)
| >>> libdaq_static_fst_la-daq_fst.o:(std::__1::pair<std::__1::__hash_iterator<std::__1::__hash_node<std::__1::__hash_value_type<FstKey, FstNode*>, void*>*>, bool> std::__1::__hash_table<std::__1::__hash_value_type<FstKey, FstNode*>, std::__1::__unordered_map_hasher<FstKey, std::__1::__hash_value_type<FstKey, FstNode*>, FstKeyHash, std::__1::equal_to<FstKey>, true>, std::__1::__unordered_map_equal<FstKey, std::__1::__hash_value_type<FstKey, FstNode*>, std::__1::equal_to<FstKey>, FstKeyHash, true>, std::__1::allocator<std::__1::__hash_value_type<FstKey, FstNode*>>>::__emplace_unique_key_args<FstKey, std::__1::pair<FstKey const, FstNode*>>(FstKey const&, std::__1::pair<FstKey const, FstNode*>&&)) in archive ../modules/fst/.libs/libdaq_static_fst.a
Upstream-Status: Pending
Signed-off-by: Khawaja Shaheryar <behzadshaheryar@gmail.com>
---
example/Makefile.am | 1 +
1 file changed, 1 insertion(+)
diff --git a/example/Makefile.am b/example/Makefile.am
index 0d5ca31..1eaa9e8 100644
--- a/example/Makefile.am
+++ b/example/Makefile.am
@@ -31,6 +31,7 @@ endif
if BUILD_FST_MODULE
daqtest_static_CFLAGS += -DBUILD_FST_MODULE
daqtest_static_LDADD += ${top_builddir}/modules/fst/libdaq_static_fst.la $(DAQ_FST_LIBS)
+daqtest_static_LDFLAGS += -lm
endif
if BUILD_NETMAP_MODULE
daqtest_static_CFLAGS += -DBUILD_NETMAP_MODULE
--
2.34.1

View File

@@ -0,0 +1,18 @@
SUMMARY = "LibDAQ: The Data AcQuisition Library"
DESCRIPTION = "LibDAQ is a pluggable abstraction layer for interacting with a data source (traditionally a network interface or network data plane)."
HOMEPAGE = "http://www.snort.org"
SECTION = "libs"
LICENSE = "GPL-2.0-only"
LIC_FILES_CHKSUM = "file://COPYING;md5=79258250506422d064560a7b95b2d53e"
DEPENDS = "libdnet libpcap"
inherit autotools pkgconfig
SRC_URI = "git://github.com/snort3/libdaq.git;protocol=https;branch=master \
file://0001-example-Use-lm-for-the-fst-module.patch"
SRCREV = "4e68d7ba6940df9a1503599d7b177029112d6b6a"
S = "${WORKDIR}/git"
FILES:${PN} += "${libdir}/daq/*.so"

View File

@@ -0,0 +1,72 @@
SECTION = "console/network"
SUMMARY = "Internet Software Consortium DHCP Relay Agent"
DESCRIPTION = "A DHCP relay agent passes DHCP requests from one \
LAN to another, so that a DHCP server is not needed on every LAN."
HOMEPAGE = "http://www.isc.org/"
LICENSE = "MPL-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=c463f4afde26d9eb60f14f50aeb85f8f"
DEPENDS = "openssl libcap zlib"
SRC_URI = "https://downloads.isc.org/isc/dhcp/4.4.3-P1/dhcp-4.4.3-P1.tar.gz \
file://default-relay \
file://init-relay \
file://dhcrelay.service \
file://0001-Makefile.am-only-build-dhcrelay.patch \
file://0002-bind-Makefile.in-disable-backtrace.patch \
file://0003-bind-Makefile.in-regenerate-configure.patch \
"
SRC_URI[sha256sum] = "0ac416bb55997ca8632174fd10737fd61cdb8dba2752160a335775bc21dc73c7"
UPSTREAM_CHECK_URI = "http://ftp.isc.org/isc/dhcp/"
UPSTREAM_CHECK_REGEX = "(?P<pver>\d+\.\d+\.(\d+?))/"
S = "${WORKDIR}/dhcp-4.4.3-P1"
inherit autotools-brokensep systemd pkgconfig
SYSTEMD_SERVICE:${PN} = "dhcrelay.service"
SYSTEMD_AUTO_ENABLE:${PN} = "disable"
CFLAGS += "-D_GNU_SOURCE -fcommon"
LDFLAGS:append = " -pthread"
BIND_EXTRA_CONFIG = "\
--build=${BUILD_SYS} \
--host=${HOST_SYS} \
--target=${TARGET_SYS} \
"
EXTRA_OECONF = "--with-bind-extra-config="${BIND_EXTRA_CONFIG}" \
--enable-paranoia \
--disable-static \
--enable-libtool \
--with-randomdev=/dev/random \
"
# Enable shared libs per dhcp README
do_configure:prepend () {
cp configure.ac+lt configure.ac
}
do_install:append () {
install -Dm 0644 ${WORKDIR}/default-relay ${D}${sysconfdir}/default/dhcp-relay
if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
install -d ${D}${systemd_unitdir}/system
install -m 0644 ${WORKDIR}/dhcrelay.service ${D}${systemd_unitdir}/system
sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_unitdir}/system/dhcrelay.service
sed -i -e 's,@SYSCONFDIR@,${sysconfdir},g' ${D}${systemd_unitdir}/system/dhcrelay.service
else
install -d ${D}${sysconfdir}/init.d
install -m 0755 ${WORKDIR}/init-relay ${D}${sysconfdir}/init.d/dhcp-relay
fi
}
PARALLEL_MAKE = ""
# dhcp-relay contains a bundled "bind", thus their dev packages conflict each other
RCONFLICTS:${PN}-dev = "bind-dev"

View File

@@ -0,0 +1,30 @@
From 4fd67b6adb7c1d8524ba17d1a0b3894f901555a9 Mon Sep 17 00:00:00 2001
From: Yi Zhao <yi.zhao@windriver.com>
Date: Thu, 13 May 2021 15:23:16 +0800
Subject: [PATCH] Makefile.am: only build dhcrelay
Drop client and server build as we don't need them.
Upstream-Status: Inappropriate [embedded specific]
Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
---
Makefile.am | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile.am b/Makefile.am
index ed692a5..34f9772 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -38,7 +38,7 @@ endif
# Use an autoconf substitution vs an automake conditional here
# to fool automake when the bind directory does not exist.
-SUBDIRS = @BINDSUBDIR@ includes tests common omapip client dhcpctl relay server
+SUBDIRS = @BINDSUBDIR@ includes common omapip relay
DIST_SUBDIRS = $(SUBDIRS) keama
--
2.25.1

View File

@@ -0,0 +1,31 @@
From 6c6bbfe6b33e5c7e46a4260d656593dbe610fd8a Mon Sep 17 00:00:00 2001
From: Yi Zhao <yi.zhao@windriver.com>
Date: Tue, 8 Jun 2021 10:13:57 +0800
Subject: [PATCH] bind/Makefile.in: disable backtrace
Fixes build error for qemuarm on musl:
libisc.so: undefined reference to `_Unwind_GetIP'
Upstream-Status: Inappropriate [embedded specific]
Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
---
bind/Makefile.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bind/Makefile.in b/bind/Makefile.in
index 2e60091..533d55c 100644
--- a/bind/Makefile.in
+++ b/bind/Makefile.in
@@ -22,7 +22,7 @@ prefix = @prefix@
exec_prefix = @exec_prefix@
bindconfig = --without-openssl --without-libxml2 --without-libjson \
- --without-gssapi --disable-threads --without-lmdb \
+ --without-gssapi --disable-threads --without-lmdb --disable-backtrace \
--includedir=@includedir@ --libdir=@libdir@ --without-python\
@BINDLT@ @BINDIOMUX@ @BINDCONFIG@ --enable-full-report
--
2.25.1

View File

@@ -0,0 +1,30 @@
From 6ca1b224032355521b35471d222d0b09c08369a0 Mon Sep 17 00:00:00 2001
From: Yi Zhao <yi.zhao@windriver.com>
Date: Thu, 27 May 2021 11:38:36 +0800
Subject: [PATCH] bind/Makefile.in: regenerate configure
Run autogen.sh to regenerate configure.
Upstream-Status: Inappropriate [embedded specific]
Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
---
bind/Makefile.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bind/Makefile.in b/bind/Makefile.in
index 533d55c..fdffe15 100644
--- a/bind/Makefile.in
+++ b/bind/Makefile.in
@@ -55,7 +55,7 @@ bind1:
else \
echo Configuring BIND libraries for DHCP. ; \
rm -rf ${cleandirs} ${cleanfiles} ; \
- (cd ${bindsrcdir} && \
+ (cd ${bindsrcdir} && ./autogen.sh && \
./configure ${bindconfig} > ${binddir}/configure.log); \
fi
--
2.25.1

View File

@@ -0,0 +1,12 @@
# Defaults for dhcp-relay initscript
# sourced by /etc/init.d/dhcp-relay
# What servers should the DHCP relay forward requests to?
# e.g: SERVERS="192.168.0.1"
SERVERS=""
# On what interfaces should the DHCP relay (dhrelay) serve DHCP requests?
INTERFACES=""
# Additional options that are passed to the DHCP relay daemon?
OPTIONS=""

View File

@@ -0,0 +1,10 @@
[Unit]
Description=DHCP Relay Agent Daemon
After=network.target
[Service]
EnvironmentFile=@SYSCONFDIR@/default/dhcp-relay
ExecStart=@SBINDIR@/dhcrelay -d --no-pid -q $SERVERS
[Install]
WantedBy=multi-user.target

View File

@@ -0,0 +1,44 @@
#!/bin/sh
#
# $Id: dhcp3-relay,v 1.1 2004/04/16 15:41:08 ml Exp $
#
# It is not safe to start if we don't have a default configuration...
if [ ! -f /etc/default/dhcp-relay ]; then
echo "/etc/default/dhcp-relay does not exist! - Aborting..."
echo "create this file to fix the problem."
exit 1
fi
# Read init script configuration (interfaces the daemon should listen on
# and the DHCP server we should forward requests to.)
. /etc/default/dhcp-relay
# Build command line for interfaces (will be passed to dhrelay below.)
IFCMD=""
if test "$INTERFACES" != ""; then
for I in $INTERFACES; do
IFCMD=${IFCMD}"-i "${I}" "
done
fi
DHCRELAYPID=/var/run/dhcrelay.pid
case "$1" in
start)
start-stop-daemon -S -x /usr/sbin/dhcrelay -- -q $OPTIONS $IFCMD $SERVERS
;;
stop)
start-stop-daemon -K -x /usr/sbin/dhcrelay
;;
restart | force-reload)
$0 stop
sleep 2
$0 start
;;
*)
echo "Usage: /etc/init.d/dhcp-relay {start|stop|restart|force-reload}"
exit 1
esac
exit 0

View File

@@ -0,0 +1,125 @@
From 9e9d94566d39eef3e4606f806aa418bf5534fab9 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sun, 15 Jan 2023 22:04:31 -0800
Subject: [PATCH 1/2] Define alignof using _Alignof when using C11 or newer
WG14 N2350 made very clear that it is an UB having type definitions
within "offsetof" [1]. This patch enhances the implementation of macro
alignof to use builtin "_Alignof" to avoid undefined behavior on
when using std=c11 or newer
clang 16+ has started to flag this [2]
Fixes build when using -std >= gnu11 and using clang16+
Older compilers gcc < 4.9 or clang < 8 has buggy _Alignof even though it
may support C11, exclude those compilers too
[1] https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2350.htm
[2] https://reviews.llvm.org/D133574
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
Misc/md5-coreutils.c | 12 +++++++++++-
Misc/sha1.c | 12 +++++++++++-
Misc/sha256.c | 12 +++++++++++-
Misc/sha512.c | 12 +++++++++++-
4 files changed, 44 insertions(+), 4 deletions(-)
diff --git a/Misc/md5-coreutils.c b/Misc/md5-coreutils.c
index d6503e02..2ffb6050 100644
--- a/Misc/md5-coreutils.c
+++ b/Misc/md5-coreutils.c
@@ -154,7 +154,17 @@ md5_process_bytes (const void *buffer, size_t len, struct md5_ctx *ctx)
if (len >= 64)
{
#if !_STRING_ARCH_unaligned
-# define alignof(type) offsetof (struct { char c; type x; }, x)
+/* GCC releases before GCC 4.9 had a bug in _Alignof. See GCC bug 52023
+ <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52023>.
+ clang versions < 8.0.0 have the same bug. */
+# if (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112 \
+ || (defined __GNUC__ && __GNUC__ < 4 + (__GNUC_MINOR__ < 9) \
+ && !defined __clang__) \
+ || (defined __clang__ && __clang_major__ < 8))
+# define alignof(type) offsetof (struct { char c; type x; }, x)
+# else
+# define alignof(type) _Alignof(type)
+# endif
# define UNALIGNED_P(p) (((size_t) p) % alignof (uint32_t) != 0)
if (UNALIGNED_P (buffer))
while (len > 64)
diff --git a/Misc/sha1.c b/Misc/sha1.c
index 18ceb845..a170efe3 100644
--- a/Misc/sha1.c
+++ b/Misc/sha1.c
@@ -149,7 +149,17 @@ sha1_process_bytes (const void *buffer, size_t len, struct sha1_ctx *ctx)
if (len >= 64)
{
#if !_STRING_ARCH_unaligned
-# define alignof(type) offsetof (struct { char c; type x; }, x)
+/* GCC releases before GCC 4.9 had a bug in _Alignof. See GCC bug 52023
+ <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52023>.
+ clang versions < 8.0.0 have the same bug. */
+# if (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112 \
+ || (defined __GNUC__ && __GNUC__ < 4 + (__GNUC_MINOR__ < 9) \
+ && !defined __clang__) \
+ || (defined __clang__ && __clang_major__ < 8))
+# define alignof(type) offsetof (struct { char c; type x; }, x)
+# else
+# define alignof(type) _Alignof(type)
+# endif
# define UNALIGNED_P(p) (((size_t) p) % alignof (uint32_t) != 0)
if (UNALIGNED_P (buffer))
while (len > 64)
diff --git a/Misc/sha256.c b/Misc/sha256.c
index 68292326..da59e81d 100644
--- a/Misc/sha256.c
+++ b/Misc/sha256.c
@@ -372,7 +372,17 @@ sha256_process_bytes (const void *buffer, size_t len, struct sha256_ctx *ctx)
if (len >= 64)
{
#if !_STRING_ARCH_unaligned
-# define alignof(type) offsetof (struct { char c; type x; }, x)
+/* GCC releases before GCC 4.9 had a bug in _Alignof. See GCC bug 52023
+ <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52023>.
+ clang versions < 8.0.0 have the same bug. */
+# if (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112 \
+ || (defined __GNUC__ && __GNUC__ < 4 + (__GNUC_MINOR__ < 9) \
+ && !defined __clang__) \
+ || (defined __clang__ && __clang_major__ < 8))
+# define alignof(type) offsetof (struct { char c; type x; }, x)
+# else
+# define alignof(type) _Alignof(type)
+# endif
# define UNALIGNED_P(p) (((size_t) p) % alignof (uint32_t) != 0)
if (UNALIGNED_P (buffer))
while (len > 64)
diff --git a/Misc/sha512.c b/Misc/sha512.c
index db86c659..38e162fc 100644
--- a/Misc/sha512.c
+++ b/Misc/sha512.c
@@ -190,7 +190,17 @@ sha512_process_bytes (const void *buffer, size_t len, struct sha512_ctx *ctx)
if (len >= 128)
{
#if !_STRING_ARCH_unaligned
-# define alignof(type) offsetof (struct { char c; type x; }, x)
+/* GCC releases before GCC 4.9 had a bug in _Alignof. See GCC bug 52023
+ <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52023>.
+ clang versions < 8.0.0 have the same bug. */
+# if (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112 \
+ || (defined __GNUC__ && __GNUC__ < 4 + (__GNUC_MINOR__ < 9) \
+ && !defined __clang__) \
+ || (defined __clang__ && __clang_major__ < 8))
+# define alignof(type) offsetof (struct { char c; type x; }, x)
+# else
+# define alignof(type) _Alignof(type)
+# endif
# define UNALIGNED_P(p) (((size_t) p) % alignof (uint64_t) != 0)
if (UNALIGNED_P (buffer))
while (len > 128)
--
2.39.0

View File

@@ -0,0 +1,33 @@
From cbb33e1548fe526c3e7dead294617bde1f087ae3 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Wed, 24 Aug 2022 16:40:38 -0700
Subject: [PATCH] port-linux: Re-order header includes
linux/if.h when included before net/if.h casues duplicate definitions
Upstream-Status: Inappropriate [Upstream is Dead]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
Port-linux/interface.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Port-linux/interface.c b/Port-linux/interface.c
index 18777e91..19aefb2b 100644
--- a/Port-linux/interface.c
+++ b/Port-linux/interface.c
@@ -25,7 +25,6 @@
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
-#include <linux/if.h>
#include <syslog.h>
#include <string.h>
#include <errno.h>
@@ -42,6 +41,7 @@
#include <stdarg.h>
#include <linux/sockios.h>
#include <linux/if_ether.h>
+#include <linux/if.h>
int interface_auto_up = 0;
int interface_do_message = 0;

View File

@@ -0,0 +1,50 @@
From e826206c58bbaa1c256f55b103d5eb7b0182f152 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sun, 15 Jan 2023 22:05:53 -0800
Subject: [PATCH 2/2] make: Do not enforce c99
Latest gcc/clang from OE defaults to c11 or newer and stickly to c99
means we can not use _AlignOf
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
Misc/Makefile.am | 4 +---
Port-linux/Makefile.am | 1 -
2 files changed, 1 insertion(+), 4 deletions(-)
diff --git a/Misc/Makefile.am b/Misc/Makefile.am
index d881525a..8d71d2d4 100644
--- a/Misc/Makefile.am
+++ b/Misc/Makefile.am
@@ -6,8 +6,6 @@ endif
noinst_LIBRARIES = libMisc.a
-libMisc_a_CFLAGS = -std=c99
-
libMisc_a_CPPFLAGS = -I$(top_srcdir)
libMisc_a_SOURCES = addrpack.c
@@ -27,4 +25,4 @@ libMisc_a_SOURCES += lowlevel-posix.c
libMisc_a_SOURCES += hmac-sha-md5.h hmac-sha-md5.c
libMisc_a_SOURCES += md5-coreutils.c md5.h
-libMisc_a_SOURCES += sha1.c sha1.h sha256.c sha256.h sha512.c sha512.h
\ No newline at end of file
+libMisc_a_SOURCES += sha1.c sha1.h sha256.c sha256.h sha512.c sha512.h
diff --git a/Port-linux/Makefile.am b/Port-linux/Makefile.am
index 72b0a5e3..635998ea 100644
--- a/Port-linux/Makefile.am
+++ b/Port-linux/Makefile.am
@@ -1,6 +1,5 @@
noinst_LIBRARIES = libLowLevel.a
-libLowLevel_a_CFLAGS = -std=c99
libLowLevel_a_CPPFLAGS = -I$(top_srcdir)/Misc
libLowLevel_a_SOURCES = daemon.cpp daemon.h ethtool-kernel.h ethtool-local.h interface.c interface.h ip_common.h iproute.c libnetlink.c libnetlink.h ll_map.c ll_map.h ll_types.c lowlevel-linux.c lowlevel-linux-link-state.c lowlevel-options-linux.c rtm_map.h rt_names.h utils.c utils.h
--
2.39.0

View File

@@ -0,0 +1,50 @@
Upstream-Status: Pending
Index: git/ClntMessages/ClntMsgRequest.cpp
===================================================================
--- git.orig/ClntMessages/ClntMsgRequest.cpp
+++ git/ClntMessages/ClntMsgRequest.cpp
@@ -142,7 +142,10 @@ TClntMsgRequest::TClntMsgRequest(List(TA
IsDone=false;
SPtr<TOpt> ptr;
ptr = new TOptDUID(OPTION_CLIENTID, ClntCfgMgr().getDUID(), this );
- Options.push_back( ptr );
+
+ if ( ptr ) {
+ Options.push_back( ptr );
+ }
if (!srvDUID) {
Log(Error) << "Unable to send REQUEST: ServerId not specified.\n" << LogEnd;
@@ -153,7 +156,9 @@ TClntMsgRequest::TClntMsgRequest(List(TA
ptr = new TOptDUID(OPTION_SERVERID, srvDUID,this);
// all IAs provided by checkSolicit
SPtr<TAddrIA> ClntAddrIA;
- Options.push_back( ptr );
+ if ( ptr ) {
+ Options.push_back( ptr );
+ }
IAs.first();
while (ClntAddrIA = IAs.get())
Index: git/Messages/Msg.cpp
===================================================================
--- git.orig/Messages/Msg.cpp
+++ git/Messages/Msg.cpp
@@ -69,10 +69,15 @@ int TMsg::getSize()
{
int pktsize=0;
TOptList::iterator opt;
+ int optionCount = 0;
for (opt = Options.begin(); opt!=Options.end(); ++opt)
{
- pktsize += (*opt)->getSize();
+ Log(Info) << "### CPE Debug - Option with index " << optionCount++ << LogEnd ;
+ Log(Info) << "### CPE Debug - Option with type " << (*opt)->getOptType() << LogEnd ;
+ pktsize += (*opt)->getSize();
}
+ Log(Info) << "### CPE Debug - Packet size of option (Add 4) " << pktsize << LogEnd ;
+
return pktsize + 4;
}

View File

@@ -0,0 +1,43 @@
SUMMARY = "Dibbler DHCPv6 client"
DESCRIPTION = "Dibbler is a portable DHCPv6 implementation. It supports stateful as well as stateless autoconfiguration for IPv6."
HOMEPAGE = "http://klub.com.pl/dhcpv6"
LICENSE = "GPL-2.0-only"
LIC_FILES_CHKSUM = "file://LICENSE;md5=7236695bb6d4461c105d685a8b61c4e3"
SRCREV = "a7c6cf58a88a510cb00841351e75030ce78d36bf"
SRC_URI = "git://github.com/tomaszmrugalski/dibbler;branch=master;protocol=https \
file://dibbler_fix_getSize_crash.patch \
file://0001-port-linux-Re-order-header-includes.patch \
file://0001-Define-alignof-using-_Alignof-when-using-C11-or-newe.patch \
file://0002-make-Do-not-enforce-c99.patch \
"
PV = "1.0.1+1.0.2RC1+git${SRCREV}"
S = "${WORKDIR}/git"
PACKAGECONFIG ??= "debug bind-reuse resolvconf dns-update"
PACKAGECONFIG[debug] = "--enable-debug,,,"
PACKAGECONFIG[efence] = "--enable-efence,,,"
PACKAGECONFIG[bind-reuse] = "--enable-bind-reuse,,,"
PACKAGECONFIG[dst-addr-filter] = "--enable-dst-addr-check,,,"
PACKAGECONFIG[resolvconf] = "--enable-resolvconf,,,"
PACKAGECONFIG[dns-update] = "--enable-dns-update,,,"
PACKAGECONFIG[auth] = "--enable-auth,,,"
PACKAGECONFIG[gtest] = "--enable-gtest-static,,,"
inherit autotools
DEPENDS += "flex-native"
CPPFLAGS += "-D_GNU_SOURCE -Dregister=''"
LDFLAGS += "-pthread"
PACKAGES =+ "${PN}-requestor ${PN}-client ${PN}-relay ${PN}-server"
FILES:${PN}-client = "${sbindir}/${PN}-client"
FILES:${PN}-relay = "${sbindir}/${PN}-relay"
FILES:${PN}-requestor = "${sbindir}/${PN}-requestor"
FILES:${PN}-server = "${sbindir}/${PN}-server"

View File

@@ -0,0 +1,17 @@
SUMMARY = "daemon that sends updates when your IP changes"
HOMEPAGE = "http://sourceforge.net/projects/ez-ipupdate/"
LICENSE = "GPL-2.0-only"
LIC_FILES_CHKSUM = "file://COPYING;md5=7783169b4be06b54e86730eb01bc3a31"
SRC_URI = "http://sourceforge.net/projects/ez-ipupdate/files/${BPN}/${PV}/${BPN}-${PV}.tar.gz \
file://Makefile.am.patch \
file://cache_file.c.patch \
file://conf_file.c.patch \
file://wformat.patch \
file://0001-ez-ipupdate-Include-time.h-for-time-API-prototype.patch \
"
SRC_URI[md5sum] = "525be4550b4461fdf105aed8e753b020"
SRC_URI[sha256sum] = "a15ec0dc0b78ec7578360987c68e43a67bc8d3591cbf528a323588830ae22c20"
inherit autotools pkgconfig

View File

@@ -0,0 +1,44 @@
From 6c8fe883df993b9e7987c8f1c849962f8007a373 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Mon, 29 Aug 2022 12:50:37 -0700
Subject: [PATCH] ez-ipupdate: Include time.h for time() API prototype
Fix printf format specifiers for snprintf
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
ez-ipupdate.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/ez-ipupdate.c b/ez-ipupdate.c
index 15a4c13..5cbe7f3 100644
--- a/ez-ipupdate.c
+++ b/ez-ipupdate.c
@@ -38,6 +38,8 @@
# include <config.h>
#endif
+#include <time.h>
+
// you man very well need to edit this, don't worry though, email is only sent
// if bad things happend and it has to exit when in daemon mode.
#define SEND_EMAIL_CMD "mail"
@@ -2483,7 +2485,7 @@ int DHS_update_entry(void)
p += strlen(p);
limit = BUFFER_SIZE - 1 - strlen(buf);
- snprintf(buf, BUFFER_SIZE, "Content-length: %d\015\012", strlen(putbuf));
+ snprintf(buf, BUFFER_SIZE, "Content-length: %lu\015\012", strlen(putbuf));
output(buf);
snprintf(buf, BUFFER_SIZE, "\015\012");
output(buf);
@@ -2620,7 +2622,7 @@ int DHS_update_entry(void)
p += strlen(p);
limit = BUFFER_SIZE - 1 - strlen(buf);
- snprintf(buf, BUFFER_SIZE, "Content-length: %d\015\012", strlen(putbuf));
+ snprintf(buf, BUFFER_SIZE, "Content-length: %lu\015\012", strlen(putbuf));
output(buf);
snprintf(buf, BUFFER_SIZE, "\015\012");
output(buf);

View File

@@ -0,0 +1,16 @@
Upstream-Status: Pending
Remove EXTRASRC and EXTRAOBJ from obj list
--- ez-ipupdate-3.0.11b7/Makefile.am.orig 2014-07-02 13:47:50.758034983 -0600
+++ ez-ipupdate-3.0.11b7/Makefile.am 2014-07-02 13:48:38.406034650 -0600
@@ -1,7 +1,7 @@
bin_PROGRAMS = ez-ipupdate
-ez_ipupdate_SOURCES = ez-ipupdate.c conf_file.c conf_file.h md5.c md5.h cache_file.c cache_file.h error.h pid_file.c pid_file.h dprintf.h @EXTRASRC@
-ez_ipupdate_LDADD = @EXTRAOBJ@
+ez_ipupdate_SOURCES = ez-ipupdate.c conf_file.c conf_file.h md5.c md5.h cache_file.c cache_file.h error.h pid_file.c pid_file.h dprintf.h
+ez_ipupdate_LDADD =
EXTRA_DIST = getpass.c ez-ipupdate.lsm example.conf example-pgpow.conf example-dhs.conf example-dyndns.conf example-ods.conf example-tzo.conf example-gnudip.conf example-easydns.conf example-justlinux.conf example-dyns.conf CHANGELOG mkbinary example-heipv6tb.conf

View File

@@ -0,0 +1,34 @@
Upstream-Status: Pending
Dont assume errno type
--- ez-ipupdate-3.0.11b7/cache_file.c.orig 2014-07-02 14:01:07.126029412 -0600
+++ ez-ipupdate-3.0.11b7/cache_file.c 2014-07-02 14:08:27.422026332 -0600
@@ -43,11 +43,11 @@
#include <cache_file.h>
#if HAVE_STRERROR
-extern int errno;
+# include <errno.h>
# define error_string strerror(errno)
#elif HAVE_SYS_ERRLIST
extern const char *const sys_errlist[];
-extern int errno;
+# include <errno.h>
# define error_string (sys_errlist[errno])
#else
# define error_string "error message not found"
@@ -63,11 +63,11 @@
# define dprintf(x)
#endif
#if HAVE_STRERROR
-extern int errno;
+# include <errno.h>
# define error_string strerror(errno)
#elif HAVE_SYS_ERRLIST
extern const char *const sys_errlist[];
-extern int errno;
+# include <errno.h>
# define error_string (sys_errlist[errno])
#else
# define error_string "error message not found"

View File

@@ -0,0 +1,20 @@
Upstream-Status: Pending
Dont assume errno type
--- ez-ipupdate-3.0.11b7/conf_file.c.orig 2014-07-02 14:01:19.174029328 -0600
+++ ez-ipupdate-3.0.11b7/conf_file.c 2014-07-02 14:08:42.982026223 -0600
@@ -38,11 +38,11 @@
#include <conf_file.h>
#if HAVE_STRERROR
-extern int errno;
+# include <errno.h>
# define error_string strerror(errno)
#elif HAVE_SYS_ERRLIST
extern const char *const sys_errlist[];
-extern int errno;
+# include <errno.h>
# define error_string (sys_errlist[errno])
#else
# define error_string "error message not found"

View File

@@ -0,0 +1,15 @@
Upstream-Status: Pending
Index: ez-ipupdate-3.0.11b7/ez-ipupdate.c
===================================================================
--- ez-ipupdate-3.0.11b7.orig/ez-ipupdate.c
+++ ez-ipupdate-3.0.11b7/ez-ipupdate.c
@@ -798,7 +798,7 @@ void show_message(char *fmt, ...)
sprintf(buf, "message incomplete because your OS sucks: %s\n", fmt);
#endif
- syslog(LOG_NOTICE, buf);
+ syslog(LOG_NOTICE, "%s", buf);
}
else
{

View File

@@ -0,0 +1,46 @@
From 3be3b9a1345942d1578ec73efa9b2e3c41bd67c5 Mon Sep 17 00:00:00 2001
From: Yi Zhao <yi.zhao@windriver.com>
Date: Fri, 21 Jan 2022 13:22:24 +0800
Subject: [PATCH] Add autogen.sh
The autogen.sh has been removed since 3.0.22[1]. But we still need it in
do_configure. Add it back.
[1] https://github.com/FreeRADIUS/freeradius-server/commit/2e9b6227efd19e2b0926541aa26874908e7b7314
Upstream-Status: Inappropriate [embedded specific]
Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
---
autogen.sh | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
create mode 100755 autogen.sh
diff --git a/autogen.sh b/autogen.sh
new file mode 100755
index 0000000000..959182b39e
--- /dev/null
+++ b/autogen.sh
@@ -0,0 +1,19 @@
+#!/bin/sh -e
+
+parentdir=`dirname $0`
+
+cd $parentdir
+parentdir=`pwd`
+m4include="-I$parentdir -I$parentdir/m4 -Im4"
+
+autoreconf -Wcross --verbose --install --force
+
+mysubdirs="$mysubdirs `find src/modules/ -name configure -print | sed 's%/configure%%'`"
+mysubdirs=`echo $mysubdirs`
+
+for F in $mysubdirs
+do
+ echo "Configuring in $F..."
+ (cd $F && grep "^AC_CONFIG_HEADER" configure.ac > /dev/null || exit 0; autoheader $m4include)
+ (cd $F && autoconf $m4include)
+done
--
2.25.1

View File

@@ -0,0 +1,32 @@
From 2a74c10836c0d2d19248ca40d113936f4a56b039 Mon Sep 17 00:00:00 2001
From: "Roy.Li" <rongqing.li@windriver.com>
Date: Sun, 8 Jan 2023 22:47:11 +0800
Subject: [PATCH] Enable and change user and group of freeradius server to
radiusd
Upstream-Status: Inappropriate [configuration]
Signed-off-by: Roy.Li <rongqing.li@windriver.com>
Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
---
raddb/radiusd.conf.in | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/raddb/radiusd.conf.in b/raddb/radiusd.conf.in
index 154b50d610..4594d6d2d2 100644
--- a/raddb/radiusd.conf.in
+++ b/raddb/radiusd.conf.in
@@ -557,8 +557,8 @@ security {
# member. This can allow for some finer-grained access
# controls.
#
-# user = radius
-# group = radius
+ user = radiusd
+ group = radiusd
# Core dumps are a bad thing. This should only be set to
# 'yes' if you're debugging a problem with the server.
--
2.25.1

View File

@@ -0,0 +1,39 @@
From ba1390a80662ff2ab7bfda978cde7df9a871f6ae Mon Sep 17 00:00:00 2001
From: Changqing Li <changqing.li@windriver.com>
Date: Tue, 24 Jul 2018 15:03:39 +0800
Subject: [PATCH] configure.ac: allow cross-compilation
The checking OpenSSL library and header version consistency will
always fail in cross compiling, skip the check and give a warning
instead for cross compiling.
Upstream-Status: Inappropriate [embedded specific]
Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Update to new version 3.0.17 to fix patch warning
Signed-off-by: Changqing Li <changqing.li@windriver.com>
Rebased for 3.2.3
Signed-off-by: Randy MacLeod <randy.macleod@windriver.com>
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
---
src/modules/rlm_krb5/configure.ac | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/modules/rlm_krb5/configure.ac b/src/modules/rlm_krb5/configure.ac
index 9ee6379ea4..1dad481da8 100644
--- a/src/modules/rlm_krb5/configure.ac
+++ b/src/modules/rlm_krb5/configure.ac
@@ -143,7 +143,8 @@ if test "$krb5threadsafe" != "no"; then
FR_SMART_CHECK_LIB(krb5, krb5_is_thread_safe)
if test "x$ac_cv_lib_krb5_krb5_is_thread_safe" = xyes; then
AC_RUN_IFELSE([AC_LANG_PROGRAM([[#include <krb5.h>]], [[return krb5_is_thread_safe() ? 0 : 1]])],
- [krb5threadsafe="-DKRB5_IS_THREAD_SAFE"], [AC_MSG_WARN([[libkrb5 is not threadsafe]])])
+ [krb5threadsafe="-DKRB5_IS_THREAD_SAFE"], [AC_MSG_WARN([[libkrb5 is not threadsafe]])],
+ [AC_MSG_WARN(cross compiling: not checking)])
fi
else
krb5threadsafe=""

View File

@@ -0,0 +1,71 @@
From 5ba3d140842268cbbdd983266efecb1fba5bdd59 Mon Sep 17 00:00:00 2001
From: Changqing Li <changqing.li@windriver.com>
Date: Thu, 22 Aug 2019 10:45:46 +0800
Subject: [PATCH] Fix libtool detection
Use LT_INIT instead of the deprecated AC_PROG_LIBTOOL to detect libtool, so it
can work with our libtoolize and libtool.
Simplify the detection of ltdl. It will find the ltdl from the sysroot; the
switch --with-system-libltdl is no longer needed. The code is copied from
pulseaudio configure.ac, together with the comment paragraph.
Upstream-Status: Inappropriate [embedded specific]
Signed-off-by: Jesse Zhang <sen.zhang@windriver.com>
Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
Signed-off-by: Changqing Li <changqing.li@windriver.com>
---
configure.ac | 36 ++++++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)
diff --git a/configure.ac b/configure.ac
index ad8bc8cdda..ef8fced680 100644
--- a/configure.ac
+++ b/configure.ac
@@ -321,6 +321,42 @@ dnl # See if we have Git.
dnl #
AC_CHECK_PROG(GIT, git, yes, no)
+#### libtool stuff ####
+
+dnl set this shit so it doesn't force CFLAGS...
+LTCFLAGS=" "
+
+LT_PREREQ(2.2)
+LT_INIT([dlopen disable-static])
+
+dnl Unfortunately, even up to libtool 2.2.6a there is no way to know
+dnl exactly which version of libltdl is present in the system, so we
+dnl just assume that it's a working version as long as we have the
+dnl library and the header files.
+dnl
+dnl As an extra safety device, check for lt_dladvise_init() which is
+dnl only implemented in libtool 2.x, and refine as we go if we have
+dnl refined requirements.
+dnl
+dnl Check the header files first since the system may have a
+dnl libltdl.so for runtime, but no headers, and we want to bail out as
+dnl soon as possible.
+dnl
+dnl We don't need any special variable for this though, since the user
+dnl can give the proper place to find libltdl through the standard
+dnl variables like LDFLAGS and CPPFLAGS.
+
+AC_CHECK_HEADER([ltdl.h],
+ [AC_CHECK_LIB([ltdl], [lt_dladvise_init], [LIBLTDL=-lltdl], [LIBLTDL=])],
+ [LIBLTDL=])
+
+AS_IF([test "x$LIBLTDL" = "x"],
+ [AC_MSG_ERROR([Unable to find libltdl version 2. Makes sure you have libtool 2.2 or later installed.])])
+AC_SUBST([LIBLTDL])
+LTDL_SUBDIRS=
+INCLTDL=-DWITH_SYSTEM_LTDL
+AC_SUBST(LTDL_SUBDIRS)
+
dnl Put this in later, when all distributed modules use autoconf.
dnl AC_ARG_WITH(disablemodulefoo,
dnl [ --without-rlm_foo Disables module compilation. Module list:]
--
2.25.1

View File

@@ -0,0 +1,70 @@
From 9548dc5e1a6c835cd4f387ba384d8f3f14c3fc8b Mon Sep 17 00:00:00 2001
From: Changqing Li <changqing.li@windriver.com>
Date: Thu, 22 Aug 2019 10:50:21 +0800
Subject: [PATCH] configure.ac: add option for libcap
Upstream-Status: Pending
Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
Signed-off-by: Changqing Li <changqing.li@windriver.com>
---
configure.ac | 36 +++++++++++++++++++++++++++---------
1 file changed, 27 insertions(+), 9 deletions(-)
diff --git a/configure.ac b/configure.ac
index ef8fced680..263098f7fd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1161,6 +1161,22 @@ fi
dnl Set by FR_SMART_CHECKLIB
LIBS="${old_LIBS}"
+dnl #
+dnl # extra argument: --with-libcap
+dnl #
+WITH_LIBCAP=yes
+AC_ARG_WITH(libcap,
+[ --with-licap use licap for debugger checks. (default=yes)],
+[ case "$withval" in
+ no)
+ WITH_LIBCAP=no
+ ;;
+ *)
+ WITH_LIBCAP=yes
+ ;;
+ esac ]
+)
+
dnl Check for cap
dnl extra argument: --with-cap-lib-dir=DIR
cap_lib_dir=
@@ -1194,15 +1210,17 @@ AC_ARG_WITH(cap-include-dir,
;;
esac])
-smart_try_dir="$cap_lib_dir"
-FR_SMART_CHECK_LIB(cap, cap_get_proc)
-if test "x$ac_cv_lib_cap_cap_get_proc" != "xyes"; then
- AC_MSG_WARN([cap library not found, debugger checks will not be enabled. Use --with-cap-lib-dir=<path>.])
-else
- AC_DEFINE(HAVE_LIBCAP, 1,
- [Define to 1 if you have the `cap' library (-lcap).]
- )
- HAVE_LIBCAP=1
+if test "x$WITH_LIBCAP" = xyes; then
+ smart_try_dir="$cap_lib_dir"
+ FR_SMART_CHECK_LIB(cap, cap_get_proc)
+ if test "x$ac_cv_lib_cap_cap_get_proc" != "xyes"; then
+ AC_MSG_WARN([cap library not found, debugger checks will not be enabled. Use --with-cap-lib-dir=<path>.])
+ else
+ AC_DEFINE(HAVE_LIBCAP, 1,
+ [Define to 1 if you have the `cap' library (-lcap).]
+ )
+ HAVE_LIBCAP=1
+ fi
fi
dnl #
--
2.25.1

View File

@@ -0,0 +1,223 @@
From 8fe25b30b6fbb3170705f4468eb4c92eef3a968f Mon Sep 17 00:00:00 2001
From: Jackie Huang <jackie.huang@windriver.com>
Date: Mon, 4 Jan 2016 01:44:04 -0500
Subject: [PATCH] Avoid searching host dirs
Don't search the hardcoded host dirs to avoid
host contamination.
Upstream-Status: Inappropriate [embedded specific]
Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Rebased for 3.2.3
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
---
m4/fr_smart_check_include.m4 | 2 +-
m4/fr_smart_check_lib.m4 | 22 ----------------------
src/modules/rlm_sql/drivers/rlm_sql_db2/configure.ac | 4 ++--
src/modules/rlm_sql/drivers/rlm_sql_firebird/configure.ac | 4 ++--
src/modules/rlm_sql/drivers/rlm_sql_iodbc/configure.ac | 4 ++--
src/modules/rlm_sql/drivers/rlm_sql_mysql/configure.ac | 6 +++---
src/modules/rlm_sql/drivers/rlm_sql_oracle/configure.ac | 2 +-
src/modules/rlm_sql/drivers/rlm_sql_postgresql/configure.ac | 4 ++--
src/modules/rlm_sql/drivers/rlm_sql_unixodbc/configure.ac | 4 ++--
9 files changed, 15 insertions(+), 37 deletions(-)
diff --git a/m4/fr_smart_check_include.m4 b/m4/fr_smart_check_include.m4
index e7d4443f9c..2b69704f98 100644
--- a/m4/fr_smart_check_include.m4
+++ b/m4/fr_smart_check_include.m4
@@ -9,7 +9,7 @@ ac_safe=`echo "$1" | sed 'y%./+-%__pm%'`
old_CPPFLAGS="$CPPFLAGS"
smart_include=
dnl # The default directories we search in (in addition to the compilers search path)
-smart_include_dir="/usr/local/include /opt/include"
+smart_include_dir=""
dnl # Our local versions
_smart_try_dir=
diff --git a/src/modules/rlm_sql/drivers/rlm_sql_db2/configure.ac b/src/modules/rlm_sql/drivers/rlm_sql_db2/configure.ac
index 0d94ee9bf6..6108e62054 100644
--- a/src/modules/rlm_sql/drivers/rlm_sql_db2/configure.ac
+++ b/src/modules/rlm_sql/drivers/rlm_sql_db2/configure.ac
@@ -58,14 +58,14 @@ AC_ARG_WITH(ibmdb2-dir,
esac])
dnl Check for SQLConnect in -ldb2
-smart_try_dir="$ibmdb2_lib_dir /usr/local/db2/lib /usr/IBMdb2/V7.1/lib"
+smart_try_dir="$ibmdb2_lib_dir"
FR_SMART_CHECK_LIB(db2, SQLConnect)
if test "x$ac_cv_lib_db2_SQLConnect" != xyes; then
FR_MODULE_FAIL([libdb2])
fi
dnl Check for sqlcli.h
-smart_try_dir="$ibmdb2_include_dir /usr/local/db2/include /usr/IBMdb2/V7.1/include"
+smart_try_dir="$ibmdb2_include_dir"
FR_SMART_CHECK_INCLUDE(sqlcli.h)
if test "x$ac_cv_header_sqlcli_h" != xyes; then
FR_MODULE_FAIL([sqlcli.h])
diff --git a/src/modules/rlm_sql/drivers/rlm_sql_firebird/configure.ac b/src/modules/rlm_sql/drivers/rlm_sql_firebird/configure.ac
index 5aa7b4b6ee..2eda5b6cc5 100644
--- a/src/modules/rlm_sql/drivers/rlm_sql_firebird/configure.ac
+++ b/src/modules/rlm_sql/drivers/rlm_sql_firebird/configure.ac
@@ -58,14 +58,14 @@ AC_ARG_WITH(firebird-dir,
esac])
dnl Check for isc_attach_database in -lfbclient
-smart_try_dir="$firebird_lib_dir /usr/lib/firebird2/lib /usr/local/firebird/lib"
+smart_try_dir="$firebird_lib_dir"
FR_SMART_CHECK_LIB(fbclient, isc_attach_database)
if test "x$ac_cv_lib_fbclient_isc_attach_database" != xyes; then
FR_MODULE_FAIL([libfbclient])
fi
dnl Check for ibase.h
-smart_try_dir="$firebird_include_dir /usr/lib/firebird2/include /usr/local/firebird/include"
+smart_try_dir="$firebird_include_dir"
FR_SMART_CHECK_INCLUDE(ibase.h)
if test "x$ac_cv_header_ibase_h" != xyes; then
FR_MODULE_FAIL([ibase.h])
diff --git a/src/modules/rlm_sql/drivers/rlm_sql_iodbc/configure.ac b/src/modules/rlm_sql/drivers/rlm_sql_iodbc/configure.ac
index d96216aca8..88cbc469f7 100644
--- a/src/modules/rlm_sql/drivers/rlm_sql_iodbc/configure.ac
+++ b/src/modules/rlm_sql/drivers/rlm_sql_iodbc/configure.ac
@@ -58,14 +58,14 @@ AC_ARG_WITH(iodbc-dir,
esac])
dnl Check for SQLConnect in -liodbc
-smart_try_dir="$iodbc_lib_dir /usr/lib /usr/lib/iodbc /usr/local/lib/iodbc /usr/local/iodbc/lib/iodbc"
+smart_try_dir="$iodbc_lib_dir"
FR_SMART_CHECK_LIB(iodbc, SQLConnect)
if test "x$ac_cv_lib_iodbc_SQLConnect" != xyes; then
FR_MODULE_FAIL([libiodbc])
fi
dnl Check for isql.h
-smart_try_dir="$iodbc_include_dir /usr/include /usr/include/iodbc /usr/local/iodbc/include"
+smart_try_dir="$iodbc_include_dir"
FR_SMART_CHECK_INCLUDE(isql.h)
if test "x$ac_cv_header_isql_h" != xyes; then
FR_MODULE_FAIL([isql.h])
diff --git a/src/modules/rlm_sql/drivers/rlm_sql_mysql/configure.ac b/src/modules/rlm_sql/drivers/rlm_sql_mysql/configure.ac
index d36aecbda6..201a623d4e 100644
--- a/src/modules/rlm_sql/drivers/rlm_sql_mysql/configure.ac
+++ b/src/modules/rlm_sql/drivers/rlm_sql_mysql/configure.ac
@@ -138,7 +138,7 @@ fi
dnl # Check for libmysqlclient_r
if test "x$have_a_libmysqlclient" != "xyes"; then
- smart_try_dir="$mysql_lib_dir /usr/lib /usr/lib/mysql /usr/local/lib/mysql /usr/local/mysql/lib/mysql"
+ smart_try_dir="$mysql_lib_dir"
FR_SMART_CHECK_LIB(mysqlclient_r, mysql_init)
if test "x$ac_cv_lib_mysqlclient_r_mysql_init" = "xyes"; then
have_a_libmysqlclient='yes'
@@ -147,7 +147,7 @@ fi
dnl # Check for libmysqlclient
if test "x$have_a_libmysqlclient" != "xyes"; then
- smart_try_dir="$mysql_lib_dir /usr/lib /usr/lib/mysql /usr/local/lib/mysql /usr/local/mysql/lib/mysql"
+ smart_try_dir="$mysql_lib_dir"
FR_SMART_CHECK_LIB(mysqlclient, mysql_init)
if test "x$ac_cv_lib_mysqlclient_mysql_init" = "xyes"; then
have_a_libmysqlclient='yes'
@@ -242,7 +242,7 @@ if test "x$have_mysql_h" != "xyes"; then
fi
if test "x$have_mysql_h" != "xyes"; then
- smart_try_dir="$mysql_include_dir /usr/local/include /usr/local/mysql/include"
+ smart_try_dir="$mysql_include_dir"
FR_SMART_CHECK_INCLUDE(mysql/mysql.h)
if test "x$ac_cv_header_mysql_mysql_h" = "xyes"; then
AC_DEFINE(HAVE_MYSQL_MYSQL_H, [], [Define if you have <mysql/mysql.h>])
diff --git a/src/modules/rlm_sql/drivers/rlm_sql_oracle/configure.ac b/src/modules/rlm_sql/drivers/rlm_sql_oracle/configure.ac
index f31b7d2c5a..67bbf66df5 100644
--- a/src/modules/rlm_sql/drivers/rlm_sql_oracle/configure.ac
+++ b/src/modules/rlm_sql/drivers/rlm_sql_oracle/configure.ac
@@ -66,7 +66,7 @@ dnl ############################################################
dnl # Check for header files
dnl ############################################################
-smart_try_dir="$oracle_include_dir /usr/local/instaclient/include"
+smart_try_dir="$oracle_include_dir"
if test "x$ORACLE_HOME" != "x"; then
smart_try_dir="${smart_try_dir} ${ORACLE_HOME}/include"
diff --git a/src/modules/rlm_sql/drivers/rlm_sql_postgresql/configure.ac b/src/modules/rlm_sql/drivers/rlm_sql_postgresql/configure.ac
index 46587e4099..b41c51bda7 100644
--- a/src/modules/rlm_sql/drivers/rlm_sql_postgresql/configure.ac
+++ b/src/modules/rlm_sql/drivers/rlm_sql_postgresql/configure.ac
@@ -43,7 +43,7 @@ AC_ARG_WITH(rlm-sql-postgresql-include-dir,
;;
esac])
-smart_try_dir="$rlm_sql_postgresql_include_dir /usr/include/postgresql /usr/local/pgsql/include /usr/include/pgsql"
+smart_try_dir="$rlm_sql_postgresql_include_dir"
FR_SMART_CHECK_INCLUDE(libpq-fe.h)
if test "x$ac_cv_header_libpqmfe_h" != "xyes"; then
FR_MODULE_FAIL([libpq-fe.h])
@@ -95,7 +95,7 @@ else
])
fi
-smart_try_dir="$rlm_sql_postgresql_lib_dir /usr/lib /usr/local/pgsql/lib"
+smart_try_dir="$rlm_sql_postgresql_lib_dir"
FR_SMART_CHECK_LIB(pq, PQconnectdb)
if test "x$ac_cv_lib_pq_PQconnectdb" != "xyes"; then
FR_MODULE_FAIL([libpq])
diff --git a/src/modules/rlm_sql/drivers/rlm_sql_unixodbc/configure.ac b/src/modules/rlm_sql/drivers/rlm_sql_unixodbc/configure.ac
index 3bdfae6032..ce68c312c6 100644
--- a/src/modules/rlm_sql/drivers/rlm_sql_unixodbc/configure.ac
+++ b/src/modules/rlm_sql/drivers/rlm_sql_unixodbc/configure.ac
@@ -58,14 +58,14 @@ AC_ARG_WITH(unixodbc-dir,
esac])
dnl Check for SQLConnect in -lodbc
-smart_try_dir="$unixodbc_lib_dir /usr/local/unixodbc/lib"
+smart_try_dir="$unixodbc_lib_dir"
FR_SMART_CHECK_LIB(odbc, SQLConnect)
if test "x$ac_cv_lib_odbc_SQLConnect" != xyes; then
FR_MODULE_FAIL([libodbc])
fi
dnl Check for sql.h
-smart_try_dir="$unixodbc_include_dir /usr/local/unixodbc/include"
+smart_try_dir="$unixodbc_include_dir"
FR_SMART_CHECK_INCLUDE(sql.h)
if test "x$ac_cv_header_sql_h" != xyes; then
FR_MODULE_FAIL([sql.h])
diff --git a/m4/fr_smart_check_lib.m4 b/m4/fr_smart_check_lib.m4
index 16ac5b3c5e..0f5e9fc6d6 100644
--- a/m4/fr_smart_check_lib.m4
+++ b/m4/fr_smart_check_lib.m4
@@ -64,28 +64,6 @@ if test "x$smart_lib" = "x"; then
LIBS="$old_LIBS"
fi
-dnl #
-dnl # Try to guess possible locations.
-dnl #
-if test "x$smart_lib" = "x"; then
- for try in /usr/local/lib /opt/lib; do
- AC_MSG_CHECKING([for $2 in -l$1 in $try])
- LIBS="-l$1 $old_LIBS"
- CPPFLAGS="-L$try -Wl,-rpath,$try $old_CPPFLAGS"
- AC_TRY_LINK([extern char $2();],
- [$2()],
- [
- smart_lib="-l$1"
- smart_ldflags="-L$try -Wl,-rpath,$try"
- AC_MSG_RESULT(yes)
- break
- ],
- [AC_MSG_RESULT(no)])
- done
- LIBS="$old_LIBS"
- CPPFLAGS="$old_CPPFLAGS"
-fi
-
dnl #
dnl # Found it, set the appropriate variable.
dnl #

View File

@@ -0,0 +1,30 @@
From e4ff7a2a9834e2589bc7bdda4b74f5bc962b15e6 Mon Sep 17 00:00:00 2001
From: Jackie Huang <jackie.huang@windriver.com>
Date: Wed, 27 Jan 2016 05:07:19 -0500
Subject: [PATCH] rlm_python: add PY_INC_DIR in search dir
configure option --with-rlm-python-include-dir is used to set
PY_INC_DIR which is never used and it fails to find Python.h,
so add it into search dir to fix it.
Upstream-Status: Inappropriate [embedded specific]
Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
---
src/modules/rlm_python/configure.ac | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/modules/rlm_python/configure.ac b/src/modules/rlm_python/configure.ac
index c79c327064..5f4d274990 100644
--- a/src/modules/rlm_python/configure.ac
+++ b/src/modules/rlm_python/configure.ac
@@ -103,7 +103,7 @@ FR_MODULE_TEST_PASS_DO([
old_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS $PY_CFLAGS"
- smart_try_dir="$PY_PREFIX/include/python$PY_SYS_VERSION"
+ smart_try_dir="$PY_PREFIX/include/python$PY_SYS_VERSION $PY_INC_DIR"
FR_SMART_CHECK_INCLUDE(Python.h)
CFLAGS=$old_CFLAGS

View File

@@ -0,0 +1,160 @@
From d0fa5b259c2dc942d0a43a9cf1bfc32f40c184f9 Mon Sep 17 00:00:00 2001
From: Jackie Huang <jackie.huang@windriver.com>
Date: Thu, 7 Jan 2016 22:37:30 -0800
Subject: [PATCH] libtool: do not use jlibtool
jlibtool is hardcoded to be used but we need to use
our libtool, so fix the makfiles to make it compatible
with our libtool.
Upstream-Status: Inappropriate [embedded specific]
Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
---
Make.inc.in | 4 ++--
scripts/boiler.mk | 2 ++
scripts/install.mk | 14 +++++++-------
scripts/libtool.mk | 22 ++++++++++++++++------
4 files changed, 27 insertions(+), 15 deletions(-)
diff --git a/Make.inc.in b/Make.inc.in
index 05f82776ff..e78f3fe9dc 100644
--- a/Make.inc.in
+++ b/Make.inc.in
@@ -57,7 +57,7 @@ CPPFLAGS = @CPPFLAGS@
LIBPREFIX = @LIBPREFIX@
EXEEXT = @EXEEXT@
-LIBTOOL = JLIBTOOL
+LIBTOOL = @LIBTOOL@
ACLOCAL = @ACLOCAL@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
@@ -168,7 +168,7 @@ ANALYZE.c := @clang_path@
#
ifeq "$(USE_SHARED_LIBS)" "yes"
TESTBINDIR = ./$(BUILD_DIR)/bin/local
- TESTBIN = FR_LIBRARY_PATH=./build/lib/.libs $(JLIBTOOL) --quiet --mode=execute $(TESTBINDIR)
+ TESTBIN = FR_LIBRARY_PATH=./build/lib/.libs $(LIBTOOL) --quiet --mode=execute $(TESTBINDIR)
else
TESTBINDIR = ./$(BUILD_DIR)/bin
TESTBIN = ./$(BUILD_DIR)/bin
diff --git a/scripts/boiler.mk b/scripts/boiler.mk
index 2ce0c18f34..567cc0f22f 100644
--- a/scripts/boiler.mk
+++ b/scripts/boiler.mk
@@ -272,6 +272,7 @@ define COMPILE_C_CMDS
$(Q)$(ECHO) CC $<
$(Q)$(strip ${COMPILE.c} -o $@ -c -MD ${CPPFLAGS} ${CFLAGS} ${SRC_CFLAGS} ${INCDIRS} \
$(addprefix -I, ${SRC_INCDIRS}) ${SRC_DEFS} ${DEFS} $<)
+ ${Q}mv $(dir $@)/.libs/$(notdir $*.d) ${BUILD_DIR}/objs/$*.d
endef
else
#
@@ -287,6 +288,7 @@ define COMPILE_C_CMDS
$(Q)cppcheck --enable=style -q ${CHECKFLAGS} $(filter -isystem%,${SRC_CFLAGS}) \
$(filter -I%,${SRC_CFLAGS}) $(filter -D%,${SRC_CFLAGS}) ${INCDIRS} \
$(addprefix -I,${SRC_INCDIRS}) ${SRC_DEFS} ${DEFS} --suppress=variableScope --suppress=invalidscanf $<
+ ${Q}mv $(dir $@)/.libs/$(notdir $*.d) ${BUILD_DIR}/objs/$*.d
endef
endif
diff --git a/scripts/install.mk b/scripts/install.mk
index 916411563b..e38c1ed697 100644
--- a/scripts/install.mk
+++ b/scripts/install.mk
@@ -46,7 +46,7 @@ define ADD_INSTALL_RULE.exe
install: $${${1}_INSTALLDIR}/$(notdir ${1})
# Install executable ${1}
- $${${1}_INSTALLDIR}/$(notdir ${1}): ${JLIBTOOL} $${${1}_BUILD}/${1} | $${${1}_INSTALLDIR}
+ $${${1}_INSTALLDIR}/$(notdir ${1}): ${LIBTOOL} $${${1}_BUILD}/${1} | $${${1}_INSTALLDIR}
@$(ECHO) INSTALL ${1}
$(Q)$${PROGRAM_INSTALL} -c -m 755 $${BUILD_DIR}/bin/${1} $${${1}_INSTALLDIR}/
$(Q)$${${1}_POSTINSTALL}
@@ -65,7 +65,7 @@ define ADD_INSTALL_RULE.a
install: $${${1}_INSTALLDIR}/$(notdir ${1})
# Install static library ${1}
- $${${1}_INSTALLDIR}/$(notdir ${1}): ${JLIBTOOL} ${1} | $${${1}_INSTALLDIR}
+ $${${1}_INSTALLDIR}/$(notdir ${1}): ${LIBTOOL} ${1} | $${${1}_INSTALLDIR}
@$(ECHO) INSTALL ${1}
$(Q)$${PROGRAM_INSTALL} -c -m 755 $${BUILD_DIR}/lib/${1} $${${1}_INSTALLDIR}/
$(Q)$${${1}_POSTINSTALL}
@@ -87,9 +87,9 @@ define ADD_INSTALL_RULE.la
install: $${${1}_INSTALLDIR}/$(notdir ${1})
# Install libtool library ${1}
- $${${1}_INSTALLDIR}/$(notdir ${1}): ${JLIBTOOL} $${${1}_BUILD}/${1} | $${${1}_INSTALLDIR}
+ $${${1}_INSTALLDIR}/$(notdir ${1}): ${LIBTOOL} $${${1}_BUILD}/${1} | $${${1}_INSTALLDIR}
@$(ECHO) INSTALL ${1}
- $(Q)$${PROGRAM_INSTALL} -c -m 755 $${LOCAL_FLAGS_MIN} $${BUILD_DIR}/lib/${1} $${${1}_INSTALLDIR}/
+ $(Q)$${PROGRAM_INSTALL} -c -m 755 $${BUILD_DIR}/lib/${1} $${${1}_INSTALLDIR}/
$(Q)$${${1}_POSTINSTALL}
endef
@@ -107,7 +107,7 @@ define ADD_INSTALL_RULE.man
install: ${2}/$(notdir ${1})
# Install manual page ${1}
- ${2}/$(notdir ${1}): ${JLIBTOOL} ${1} | ${2}
+ ${2}/$(notdir ${1}): ${LIBTOOL} ${1} | ${2}
@$(ECHO) INSTALL $(notdir ${1})
$(Q)$${PROGRAM_INSTALL} -c -m 644 ${1} ${2}/
@@ -122,9 +122,9 @@ endef
define ADD_INSTALL_RULE.dir
# Install directory
.PHONY: ${1}
- ${1}: ${JLIBTOOL}
+ ${1}: ${LIBTOOL}
@$(ECHO) INSTALL -d -m 755 ${1}
- $(Q)$${PROGRAM_INSTALL} -d -m 755 ${1}
+ $(Q)$${INSTALL} -d -m 755 ${1}
endef
diff --git a/scripts/libtool.mk b/scripts/libtool.mk
index 381127ec2d..e83d7e6ad7 100644
--- a/scripts/libtool.mk
+++ b/scripts/libtool.mk
@@ -60,7 +60,9 @@ ifeq "${LIBTOOL}" "JLIBTOOL"
# Tell GNU Make to use this value, rather than anything specified
# on the command line.
override LIBTOOL := ${JLIBTOOL}
-endif # else we're not using jlibtool
+else # else we're not using jlibtool
+ all install: ${LIBTOOL}
+endif
# When using libtool, it produces a '.libs' directory. Ensure that it
# is removed on "make clean", too.
@@ -74,11 +76,19 @@ clean: .libs_clean
# Re-define compilers and linkers
#
OBJ_EXT = lo
-COMPILE.c = ${LIBTOOL} --silent --mode=compile ${CC}
-COMPILE.cxx = ${LIBTOOL} --mode=compile ${CXX}
-LINK.c = ${LIBTOOL} --silent --mode=link ${CC}
-LINK.cxx = ${LIBTOOL} --mode=link ${CXX}
-PROGRAM_INSTALL = ${LIBTOOL} --silent --mode=install ${INSTALL}
+ifeq "${LIBTOOL}" "JLIBTOOL"
+ COMPILE.c = ${LIBTOOL} --silent --mode=compile ${CC}
+ COMPILE.cxx = ${LIBTOOL} --mode=compile ${CXX}
+ LINK.c = ${LIBTOOL} --silent --mode=link ${CC}
+ LINK.cxx = ${LIBTOOL} --mode=link ${CXX}
+ PROGRAM_INSTALL = ${LIBTOOL} --silent --mode=install ${INSTALL}
+else
+ COMPILE.c = ${LIBTOOL} --mode=compile --tag=CC ${CC}
+ COMPILE.cxx = ${LIBTOOL} --mode=compile --tag=CC ${CXX}
+ LINK.c = ${LIBTOOL} --mode=link --tag=CC ${CC} -module -export-dynamic
+ LINK.cxx = ${LIBTOOL} --mode=link --tag=CC ${CXX} -module -export-dynamic
+ PROGRAM_INSTALL = ${LIBTOOL} --mode=install ${INSTALL}
+endif
# LIBTOOL_ENDINGS - Given a library ending in ".a" or ".so", replace that
--
2.25.1

View File

@@ -0,0 +1,58 @@
From 3e701d6274924adaed568e22af2362aa5af1f055 Mon Sep 17 00:00:00 2001
From: Peter Seebach <peter.seebach@windriver.com>
Date: Sun, 8 Jan 2023 23:01:28 +0800
Subject: [PATCH] Fix quoting for BUILD_WITH
The escaped quotes are to make the -D values produce strings which
can be used to display these values. However, if the values are more
than one word, with spaces, they also need shell quoting to make them
into single words.
Upstream-Status: Pending
Signed-off-by: Peter Seebach <peter.seebach@windriver.com>
Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
---
src/main/libfreeradius-server.mk | 2 +-
src/main/unittest.mk | 2 +-
src/modules/rlm_eap/radeapclient.mk | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/main/libfreeradius-server.mk b/src/main/libfreeradius-server.mk
index 4495f72481..07c28f1968 100644
--- a/src/main/libfreeradius-server.mk
+++ b/src/main/libfreeradius-server.mk
@@ -18,5 +18,5 @@ SOURCES := conffile.c \
TGT_LDLIBS := $(OPENSSL_LIBS)
ifneq ($(MAKECMDGOALS),scan)
-SRC_CFLAGS += -DBUILT_WITH_CPPFLAGS=\"$(CPPFLAGS)\" -DBUILT_WITH_CFLAGS=\"$(CFLAGS)\" -DBUILT_WITH_LDFLAGS=\"$(LDFLAGS)\" -DBUILT_WITH_LIBS=\"$(LIBS)\"
+SRC_CFLAGS += -DBUILT_WITH_CPPFLAGS="\"$(CPPFLAGS)\"" -DBUILT_WITH_CFLAGS="\"$(CFLAGS)\"" -DBUILT_WITH_LDFLAGS="\"$(LDFLAGS)\"" -DBUILT_WITH_LIBS="\"$(LIBS)\""
endif
diff --git a/src/main/unittest.mk b/src/main/unittest.mk
index edd4f133a7..b5b44d5e11 100644
--- a/src/main/unittest.mk
+++ b/src/main/unittest.mk
@@ -21,5 +21,5 @@ TGT_PREREQS += libfreeradius-eap.a
endif
ifneq ($(MAKECMDGOALS),scan)
-SRC_CFLAGS += -DBUILT_WITH_CPPFLAGS=\"$(CPPFLAGS)\" -DBUILT_WITH_CFLAGS=\"$(CFLAGS)\" -DBUILT_WITH_LDFLAGS=\"$(LDFLAGS)\" -DBUILT_WITH_LIBS=\"$(LIBS)\"
+SRC_CFLAGS += -DBUILT_WITH_CPPFLAGS="\"$(CPPFLAGS)\"" -DBUILT_WITH_CFLAGS="\"$(CFLAGS)\"" -DBUILT_WITH_LDFLAGS="\"$(LDFLAGS)\"" -DBUILT_WITH_LIBS="\"$(LIBS)\""
endif
diff --git a/src/modules/rlm_eap/radeapclient.mk b/src/modules/rlm_eap/radeapclient.mk
index 6068f54813..7d3c55625b 100644
--- a/src/modules/rlm_eap/radeapclient.mk
+++ b/src/modules/rlm_eap/radeapclient.mk
@@ -23,7 +23,7 @@ SRC_CFLAGS += -DWITH_EAPCLIENT
SRC_INCDIRS := ${top_srcdir}/src/modules/rlm_eap/libeap
ifneq ($(MAKECMDGOALS),scan)
-SRC_CFLAGS += -DBUILT_WITH_CPPFLAGS=\"$(CPPFLAGS)\" -DBUILT_WITH_CFLAGS=\"$(CFLAGS)\" -DBUILT_WITH_LDFLAGS=\"$(LDFLAGS)\" -DBUILT_WITH_LIBS=\"$(LIBS)\"
+SRC_CFLAGS += -DBUILT_WITH_CPPFLAGS="\"$(CPPFLAGS)\"" -DBUILT_WITH_CFLAGS="\"$(CFLAGS)\"" -DBUILT_WITH_LDFLAGS="\"$(LDFLAGS)\"" -DBUILT_WITH_LIBS="\"$(LIBS)\""
endif
endif
--
2.25.1

View File

@@ -0,0 +1,61 @@
From 30ce5ccd62446349d432ff65d3fe8d46872423c8 Mon Sep 17 00:00:00 2001
From: Yi Zhao <yi.zhao@windriver.com>
Date: Wed, 18 Jan 2017 14:59:39 +0800
Subject: [PATCH] fix error for expansion of macro in thread.h
The parameter declaration is missing in expansion of macro
which cause the build error:
| In file included from src/freeradius-devel/libradius.h:80:0,
| from src/lib/log.c:26:
| src/lib/log.c: In function '__fr_thread_local_destroy_fr_strerror_buffer':
| src/lib/log.c:37:31: error: 'fr_strerror_buffer' undeclared (first use in this function)
| fr_thread_local_setup(char *, fr_strerror_buffer) /* macro */
| ^
Add the missing declaration in macro.
Upstream-Status: Pending
Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
---
src/include/threads.h | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/include/threads.h b/src/include/threads.h
index e36d81dac0..2bcb6aadcb 100644
--- a/src/include/threads.h
+++ b/src/include/threads.h
@@ -89,7 +89,7 @@ static _t __fr_thread_local_init_##_n(pthread_destructor_t func)\
# define fr_thread_local_get(_n) _n
#elif defined(HAVE_PTHREAD_H)
# include <pthread.h>
-# define fr_thread_local_setup(_t, _n) \
+# define fr_thread_local_setup(_t, _n) static __thread _t _n;\
static pthread_key_t __fr_thread_local_key_##_n;\
static pthread_once_t __fr_thread_local_once_##_n = PTHREAD_ONCE_INIT;\
static pthread_destructor_t __fr_thread_local_destructor_##_n = NULL;\
@@ -100,17 +100,17 @@ static void __fr_thread_local_destroy_##_n(UNUSED void *unused)\
static void __fr_thread_local_key_init_##_n(void)\
{\
(void) pthread_key_create(&__fr_thread_local_key_##_n, __fr_thread_local_destroy_##_n);\
- (void) pthread_setspecific(__fr_thread_local_key_##_n, &(_n));\
}\
static _t __fr_thread_local_init_##_n(pthread_destructor_t func)\
{\
__fr_thread_local_destructor_##_n = func;\
if (_n) return _n; \
(void) pthread_once(&__fr_thread_local_once_##_n, __fr_thread_local_key_init_##_n);\
+ (void) pthread_setspecific(__fr_thread_local_key_##_n, &(_n));\
return _n;\
}
-# define fr_thread_local_init(_n, _f) __fr_thread_local_init_##_n(_f)
-# define fr_thread_local_set(_n, _v) __fr_thread_local_set_##_n(_v)
-# define fr_thread_local_get(_n) __fr_thread_local_get_##_n()
+# define fr_thread_local_init(_n, _f) __fr_thread_local_init_##_n(_f)
+# define fr_thread_local_set(_n, _v) ((int)!((_n = _v) || 1))
+# define fr_thread_local_get(_n) _n
#endif
#endif
--
2.25.1

View File

@@ -0,0 +1,28 @@
From f0e764826e3a85488047f7f4e94ebf91460d2c12 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Fri, 16 Jun 2017 20:10:49 -0700
Subject: [PATCH] rlm_mschap: Use includedir instead of hardcoding /usr/include
OE QA flags it correctly as a voilation of cross compilation
namespace
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
src/modules/rlm_mschap/configure.ac | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/modules/rlm_mschap/configure.ac b/src/modules/rlm_mschap/configure.ac
index 953336f475..77a18af55d 100644
--- a/src/modules/rlm_mschap/configure.ac
+++ b/src/modules/rlm_mschap/configure.ac
@@ -77,7 +77,7 @@ else
FR_MODULE_FEATURE([opendirectory], [without opendirectory support])
fi
-smart_try_dir="$winbind_include_dir /usr/include/samba-4.0"
+smart_try_dir="$winbind_include_dir =/usr/include/samba-4.0"
FR_SMART_CHECK_INCLUDE(wbclient.h, [#include <stdint.h>
#include <stdbool.h>])
if test "x$ac_cv_header_wbclient_h" != "xyes"; then

View File

@@ -0,0 +1,55 @@
From 0f9f18fc330fe88080be13e43f300fbf7ba4a85a Mon Sep 17 00:00:00 2001
From: Mingli Yu <mingli.yu@windriver.com>
Date: Mon, 13 Jul 2020 07:01:45 +0000
Subject: [PATCH] raddb/certs/Makefile: fix the existed certificate error
Fixes:
# ./bootstrap
[snip]
openssl ca -batch -keyfile ca.key -cert ca.pem -in client.csr -key 'whatever' -out client.crt -extensions xpclient_ext -extfile xpextensions -config ./client.cnf
Using configuration from ./client.cnf
Check that the request matches the signature
Signature ok
ERROR:There is already a certificate for /C=FR/ST=Radius/O=Example Inc./CN=user@example.org/emailAddress=user@example.org
The matching entry has the following details
Type :Valid
Expires on :200908024833Z
Serial Number :02
File name :unknown
Subject Name :/C=FR/ST=Radius/O=Example Inc./CN=user@example.org/emailAddress=user@example.org
make: *** [Makefile:128: client.crt] Error 1
Add the check to fix the above error and it does the same for server.crt.
Upstream-Status: Pending
Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
---
raddb/certs/Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/raddb/certs/Makefile b/raddb/certs/Makefile
index c9fbc9e864..d064fe252d 100644
--- a/raddb/certs/Makefile
+++ b/raddb/certs/Makefile
@@ -92,7 +92,7 @@ server.csr server.key: server.cnf
chmod g+r server.key
server.crt: ca.key ca.pem server.csr
- $(OPENSSL) ca -batch -keyfile ca.key -cert ca.pem -in server.csr -key $(PASSWORD_CA) -out server.crt -extensions xpserver_ext -extfile xpextensions -config ./server.cnf
+ @[ -f server.crt ] || $(OPENSSL) ca -batch -keyfile ca.key -cert ca.pem -in server.csr -key $(PASSWORD_CA) -out server.crt -extensions xpserver_ext -extfile xpextensions -config ./server.cnf
server.p12: server.crt
$(OPENSSL) pkcs12 -export -in server.crt -inkey server.key -out server.p12 -passin pass:$(PASSWORD_SERVER) -passout pass:$(PASSWORD_SERVER)
@@ -117,7 +117,7 @@ client.csr client.key: client.cnf
chmod g+r client.key
client.crt: ca.key ca.pem client.csr
- $(OPENSSL) ca -batch -keyfile ca.key -cert ca.pem -in client.csr -key $(PASSWORD_CA) -out client.crt -extensions xpclient_ext -extfile xpextensions -config ./client.cnf
+ @[ -f client.crt ] || $(OPENSSL) ca -batch -keyfile ca.key -cert ca.pem -in client.csr -key $(PASSWORD_CA) -out client.crt -extensions xpclient_ext -extfile xpextensions -config ./client.cnf
client.p12: client.crt
$(OPENSSL) pkcs12 -export -in client.crt -inkey client.key -out client.p12 -passin pass:$(PASSWORD_CLIENT) -passout pass:$(PASSWORD_CLIENT)
--
2.25.1

View File

@@ -0,0 +1,136 @@
From bb1cb2ffc7a31c0a2bb2de51ef82d304b0a107c3 Mon Sep 17 00:00:00 2001
From: Mingli Yu <mingli.yu@windriver.com>
Date: Wed, 5 Aug 2020 07:23:11 +0000
Subject: [PATCH] raddb/certs/Makefile: fix the occasional verification failure
Fixes:
# cd /etc/raddb/certs
# ./bootstrap
[snip]
chmod g+r ca.key
openssl pkcs12 -in server.p12 -out server.pem -passin pass:'whatever' -passout pass:'whatever'
chmod g+r server.pem
C = FR, ST = Radius, O = Example Inc., CN = Example Server Certificate, emailAddress = admin@example.org
error 7 at 0 depth lookup: certificate signature failure
140066667427072:error:04067084:rsa routines:rsa_ossl_public_decrypt:data too large for modulus:../openssl-1.1.1g/crypto/rsa/rsa_ossl.c:553:
140066667427072:error:0D0C5006:asn1 encoding routines:ASN1_item_verify:EVP lib:../openssl-1.1.1g/crypto/asn1/a_verify.c:170:
error server.pem: verification failed
make: *** [Makefile:107: server.vrfy] Error 2
It seems the ca.pem mismatchs server.pem which results in failing to
execute "openssl verify -CAfile ca.pem server.pem", so add to check
the file to avoid inconsistency.
Upstream-Status: Pending
Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
---
raddb/certs/Makefile | 30 +++++++++++++++---------------
1 file changed, 15 insertions(+), 15 deletions(-)
diff --git a/raddb/certs/Makefile b/raddb/certs/Makefile
index d064fe252d..86f4547804 100644
--- a/raddb/certs/Makefile
+++ b/raddb/certs/Makefile
@@ -59,7 +59,7 @@ passwords.mk: server.cnf ca.cnf client.cnf inner-server.cnf
#
######################################################################
dh:
- $(OPENSSL) dhparam -out dh -2 $(DH_KEY_SIZE)
+ @[ -f dh ] || $(OPENSSL) dhparam -out dh -2 $(DH_KEY_SIZE)
######################################################################
#
@@ -69,17 +69,17 @@ dh:
ca.key ca.pem: ca.cnf
@[ -f index.txt ] || $(MAKE) index.txt
@[ -f serial ] || $(MAKE) serial
- $(OPENSSL) req -new -x509 -keyout ca.key -out ca.pem \
+ @[ -f ca.pem ] || $(OPENSSL) req -new -x509 -keyout ca.key -out ca.pem \
-days $(CA_DEFAULT_DAYS) -config ./ca.cnf \
-passin pass:$(PASSWORD_CA) -passout pass:$(PASSWORD_CA)
chmod g+r ca.key
ca.der: ca.pem
- $(OPENSSL) x509 -inform PEM -outform DER -in ca.pem -out ca.der
+ @[ -f ca.der ] || $(OPENSSL) x509 -inform PEM -outform DER -in ca.pem -out ca.der
ca.crl: ca.pem
- $(OPENSSL) ca -gencrl -keyfile ca.key -cert ca.pem -config ./ca.cnf -out ca-crl.pem -key $(PASSWORD_CA)
- $(OPENSSL) crl -in ca-crl.pem -outform der -out ca.crl
+ @[ -f ca-crl.pem ] || $(OPENSSL) ca -gencrl -keyfile ca.key -cert ca.pem -config ./ca.cnf -out ca-crl.pem -key $(PASSWORD_CA)
+ @[ -f ca.crl ] || $(OPENSSL) crl -in ca-crl.pem -outform der -out ca.crl
rm ca-crl.pem
######################################################################
@@ -88,18 +88,18 @@ ca.crl: ca.pem
#
######################################################################
server.csr server.key: server.cnf
- $(OPENSSL) req -new -out server.csr -keyout server.key -config ./server.cnf
+ @[ -f server.csr ] || $(OPENSSL) req -new -out server.csr -keyout server.key -config ./server.cnf
chmod g+r server.key
server.crt: ca.key ca.pem server.csr
@[ -f server.crt ] || $(OPENSSL) ca -batch -keyfile ca.key -cert ca.pem -in server.csr -key $(PASSWORD_CA) -out server.crt -extensions xpserver_ext -extfile xpextensions -config ./server.cnf
server.p12: server.crt
- $(OPENSSL) pkcs12 -export -in server.crt -inkey server.key -out server.p12 -passin pass:$(PASSWORD_SERVER) -passout pass:$(PASSWORD_SERVER)
+ @[ -f server.p12 ] || $(OPENSSL) pkcs12 -export -in server.crt -inkey server.key -out server.p12 -passin pass:$(PASSWORD_SERVER) -passout pass:$(PASSWORD_SERVER)
chmod g+r server.p12
server.pem: server.p12
- $(OPENSSL) pkcs12 -in server.p12 -out server.pem -passin pass:$(PASSWORD_SERVER) -passout pass:$(PASSWORD_SERVER)
+ @[ -f server.pem ] || $(OPENSSL) pkcs12 -in server.p12 -out server.pem -passin pass:$(PASSWORD_SERVER) -passout pass:$(PASSWORD_SERVER)
chmod g+r server.pem
.PHONY: server.vrfy
@@ -113,19 +113,19 @@ server.vrfy: ca.pem
#
######################################################################
client.csr client.key: client.cnf
- $(OPENSSL) req -new -out client.csr -keyout client.key -config ./client.cnf
+ @[ -f client.csr ] || $(OPENSSL) req -new -out client.csr -keyout client.key -config ./client.cnf
chmod g+r client.key
client.crt: ca.key ca.pem client.csr
@[ -f client.crt ] || $(OPENSSL) ca -batch -keyfile ca.key -cert ca.pem -in client.csr -key $(PASSWORD_CA) -out client.crt -extensions xpclient_ext -extfile xpextensions -config ./client.cnf
client.p12: client.crt
- $(OPENSSL) pkcs12 -export -in client.crt -inkey client.key -out client.p12 -passin pass:$(PASSWORD_CLIENT) -passout pass:$(PASSWORD_CLIENT)
+ @[ -f client.p12 ] || $(OPENSSL) pkcs12 -export -in client.crt -inkey client.key -out client.p12 -passin pass:$(PASSWORD_CLIENT) -passout pass:$(PASSWORD_CLIENT)
chmod g+r client.p12
cp client.p12 $(USER_NAME).p12
client.pem: client.p12
- $(OPENSSL) pkcs12 -in client.p12 -out client.pem -passin pass:$(PASSWORD_CLIENT) -passout pass:$(PASSWORD_CLIENT)
+ @[ -f client.pem ] || $(OPENSSL) pkcs12 -in client.p12 -out client.pem -passin pass:$(PASSWORD_CLIENT) -passout pass:$(PASSWORD_CLIENT)
chmod g+r client.pem
cp client.pem $(USER_NAME).pem
@@ -140,18 +140,18 @@ client.vrfy: ca.pem client.pem
#
######################################################################
inner-server.csr inner-server.key: inner-server.cnf
- $(OPENSSL) req -new -out inner-server.csr -keyout inner-server.key -config ./inner-server.cnf
+ @[ -f inner-server.csr] || $(OPENSSL) req -new -out inner-server.csr -keyout inner-server.key -config ./inner-server.cnf
chmod g+r inner-server.key
inner-server.crt: ca.key ca.pem inner-server.csr
- $(OPENSSL) ca -batch -keyfile ca.key -cert ca.pem -in inner-server.csr -key $(PASSWORD_CA) -out inner-server.crt -extensions xpserver_ext -extfile xpextensions -config ./inner-server.cnf
+ @[ -f inner-server.crt ] || $(OPENSSL) ca -batch -keyfile ca.key -cert ca.pem -in inner-server.csr -key $(PASSWORD_CA) -out inner-server.crt -extensions xpserver_ext -extfile xpextensions -config ./inner-server.cnf
inner-server.p12: inner-server.crt
- $(OPENSSL) pkcs12 -export -in inner-server.crt -inkey inner-server.key -out inner-server.p12 -passin pass:$(PASSWORD_INNER) -passout pass:$(PASSWORD_INNER)
+ @[ -f inner-server.p12 ] || $(OPENSSL) pkcs12 -export -in inner-server.crt -inkey inner-server.key -out inner-server.p12 -passin pass:$(PASSWORD_INNER) -passout pass:$(PASSWORD_INNER)
chmod g+r inner-server.p12
inner-server.pem: inner-server.p12
- $(OPENSSL) pkcs12 -in inner-server.p12 -out inner-server.pem -passin pass:$(PASSWORD_INNER) -passout pass:$(PASSWORD_INNER)
+ @[ -f inner-server.pem ] || $(OPENSSL) pkcs12 -in inner-server.p12 -out inner-server.pem -passin pass:$(PASSWORD_INNER) -passout pass:$(PASSWORD_INNER)
chmod g+r inner-server.pem
.PHONY: inner-server.vrfy
--
2.25.1

View File

@@ -0,0 +1,42 @@
From c591da4a361496eec93625cf8c4f89bddfedaca7 Mon Sep 17 00:00:00 2001
From: Hongxu Jia <hongxu.jia@windriver.com>
Date: Sun, 7 Feb 2021 16:02:36 +0800
Subject: [PATCH] Workaround error with autoconf 2.7
While using autoconf 2.7, the AM_MISSING_PROG caused unexpected error:
...
configure.ac: error: required file 'missing' not found
...
Since these tools were explicitly added by autotools bbclass,
remove the testing to workaround the error with autoconf 2.7
Upstream-Status: Inappropriate [embedded specific]
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
configure.ac | 8 --------
1 file changed, 8 deletions(-)
diff --git a/configure.ac b/configure.ac
index 263098f7fd..fc296832d8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -878,14 +878,6 @@ fi
AC_PATH_PROG(RUSERS, rusers, /usr/bin/rusers)
-dnl #
-dnl # FIXME This is truly gross.
-dnl #
-missing_dir=`cd $ac_aux_dir && pwd`
-AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
-AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
-AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
-
AC_PATH_PROG(DIRNAME,dirname)
AC_PATH_PROG(GREP,grep)
--
2.25.1

View File

@@ -0,0 +1,44 @@
From 78494ea005bd38324953b05176d6eb2c3f55af2c Mon Sep 17 00:00:00 2001
From: Kai Kang <kai.kang@windriver.com>
Date: Sun, 8 Jan 2023 23:21:24 +0800
Subject: [PATCH] bootstrap: check commands of openssl exist
It calls openssl commands dhparam and pkcs12 in script bootstrap. These
commands are configurable based on configure options 'no-dh' and
'no-des', and may not be provided by openssl. So check existence of
these commands. If not, abort running of script bootstrap.
1. https://github.com/openssl/openssl/blob/master/apps/build.info#L37
2. https://github.com/openssl/openssl/blob/master/apps/build.info#L22
Upstream-Status: Denied [https://github.com/FreeRADIUS/freeradius-server/pull/4059]
The maintainer commented in the pull that the script could
be run on a host which provides these openssl commands.
Signed-off-by: Kai Kang <kai.kang@windriver.com>
---
raddb/certs/bootstrap | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/raddb/certs/bootstrap b/raddb/certs/bootstrap
index 57de8cf0d7..4641c71700 100755
--- a/raddb/certs/bootstrap
+++ b/raddb/certs/bootstrap
@@ -13,6 +13,14 @@
umask 027
cd `dirname $0`
+# check commands of openssl exist
+for cmd in dhparam pkcs12; do
+ if ! openssl ${cmd} -help >/dev/null 2>&1; then
+ echo "Error: command ${cmd} is not supported by openssl."
+ exit 1
+ fi
+done
+
make -h > /dev/null 2>&1
#
--
2.25.1

View File

@@ -0,0 +1,41 @@
From cbbb62ddda5c189c225f96bf6b599b3b3e8c8252 Mon Sep 17 00:00:00 2001
From: Mingli Yu <mingli.yu@windriver.com>
Date: Wed, 3 Aug 2022 16:44:29 +0800
Subject: [PATCH] version.c: don't print build flags
Don't print the build flags to avoid collecting the build environment info.
Upstream-Status: Inappropriate [embedded specific]
Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
---
src/main/version.c | 13 -------------
1 file changed, 13 deletions(-)
diff --git a/src/main/version.c b/src/main/version.c
index f1f1e87810..3ffcbb25a0 100644
--- a/src/main/version.c
+++ b/src/main/version.c
@@ -589,19 +589,6 @@ void version_print(void)
DEBUG2(" unknown");
#endif
- DEBUG2("Compilation flags:");
-#ifdef BUILT_WITH_CPPFLAGS
- DEBUG2(" cppflags : " BUILT_WITH_CPPFLAGS);
-#endif
-#ifdef BUILT_WITH_CFLAGS
- DEBUG2(" cflags : " BUILT_WITH_CFLAGS);
-#endif
-#ifdef BUILT_WITH_LDFLAGS
- DEBUG2(" ldflags : " BUILT_WITH_LDFLAGS);
-#endif
-#ifdef BUILT_WITH_LIBS
- DEBUG2(" libs : " BUILT_WITH_LIBS);
-#endif
DEBUG2(" ");
}
INFO("FreeRADIUS Version " RADIUSD_VERSION_STRING);
--
2.25.1

View File

@@ -0,0 +1,61 @@
From 40abff4062d0521cf2b2a8a4660a3d2933f86f9d Mon Sep 17 00:00:00 2001
From: Robert Yang <liezhi.yang@windriver.com>
Date: Mon, 1 Apr 2024 09:09:07 +0000
Subject: [PATCH] Add acinclude.m4 to include required macros
* These micro files are in the m4 directories, but the aclocal didn't
add them to aclocal.m4 automatically, so add them to acinclude.m4
manually.
* The runlog.m4 is added for python.m4.
Upstream-Status: Inappropriate [OE Specific]
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
---
acinclude.m4 | 8 ++++++++
m4/runlog.m4 | 17 +++++++++++++++++
2 files changed, 25 insertions(+)
create mode 100644 acinclude.m4
create mode 100644 m4/runlog.m4
diff --git a/acinclude.m4 b/acinclude.m4
new file mode 100644
index 0000000000..118b7f0e5f
--- /dev/null
+++ b/acinclude.m4
@@ -0,0 +1,8 @@
+m4_include([m4/fr_init_module.m4])
+m4_include([m4/ax_with_prog.m4])
+m4_include([m4/runlog.m4])
+m4_include([m4/python.m4])
+m4_include([m4/ax_compare_version.m4])
+m4_include([m4/libcurl_check_config.m4])
+m4_include([m4/ax_ruby_devel.m4])
+m4_include([m4/ax_prog_ruby_version.m4])
diff --git a/m4/runlog.m4 b/m4/runlog.m4
new file mode 100644
index 0000000000..690efc3258
--- /dev/null
+++ b/m4/runlog.m4
@@ -0,0 +1,17 @@
+## -*- Autoconf -*-
+# Copyright (C) 2001-2018 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_RUN_LOG(COMMAND)
+# -------------------
+# Run COMMAND, save the exit status in ac_status, and log it.
+# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
+AC_DEFUN([AM_RUN_LOG],
+[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
+ ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+ (exit $ac_status); }])
--
2.35.5

View File

@@ -0,0 +1,110 @@
#!/bin/sh
# Start/stop the FreeRADIUS daemon.
### BEGIN INIT INFO
# Provides: freeradius
# Required-Start: $remote_fs $network $syslog
# Should-Start: $time mysql slapd postgresql samba krb5-kdc
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Radius Daemon
# Description: Extensible, configurable radius daemon
### END INIT INFO
set -e
# Source function library.
. /etc/init.d/functions
if [ -f /lib/lsb/init-functions ]; then
. /lib/lsb/init-functions
fi
PROG="radiusd"
PROGRAM="/usr/sbin/radiusd"
PIDFILE="/var/run/radiusd/radiusd.pid"
DESCR="FreeRADIUS daemon"
if [ -r /etc/default/$PROG ]; then
. /etc/default/$PROG
fi
test -f $PROGRAM || exit 0
check_certs() {
if [ ! -f /etc/raddb/certs/server.pem ]; then
echo -n "Creating certificates for freeradius..."
if sudo -u radiusd /etc/raddb/certs/bootstrap 1> /dev/null 2> /dev/null; then
echo "done"
else
echo "failed!"
fi
fi
}
# /var/run may be a tmpfs
if [ ! -d /var/run/radiusd ]; then
mkdir -p /var/run/radiusd
chown radiusd:radiusd /var/run/radiusd
fi
if [ ! -d /var/log/radius ]; then
mkdir -p /var/log/radius
touch /var/log/radius/radius.log
chown radiusd:radiusd /var/run/radius
fi
if [ ! -f ${PIDFILE} ]; then
touch ${PIDFILE}
chown radiusd:radiusd ${PIDFILE}
fi
export PATH="${PATH:+$PATH:}/usr/sbin:/sbin"
ret=0
case "$1" in
start)
check_certs
echo -n "Starting $DESCR" "$PROG"
start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $PROGRAM -- $FREERADIUS_OPTIONS || ret=$?
[ "$ret" == 0 ] && echo " Success" || echo " Failed"
exit $ret
;;
stop)
echo -n "Stopping $DESCR" "$PROG"
if [ -f "$PIDFILE" ] ; then
start-stop-daemon --stop --retry=TERM/30/KILL/5 --quiet --pidfile $PIDFILE || ret=$?
else
echo -n "$PIDFILE not found"
ret=1
fi
[ "$ret" == 0 ] && echo " Success" || echo " Failed"
;;
status)
status $PROGRAM;
exit $?
;;
restart)
$0 stop
$0 start
;;
reload|force-reload)
echo -n "Reloading $DESCR" "$PROG"
if [ -f "$PIDFILE" ] ; then
start-stop-daemon --stop --signal HUP --quiet --pidfile $PIDFILE || ret=$?
else
echo -n "$PIDFILE not found"
ret=1
fi
[ "$ret" == 0 ] && echo " Success" || echo " Failed"
;;
*)
echo "Usage: $0 start|stop|status|restart|force-reload|reload"
exit 1
;;
esac
exit 0

View File

@@ -0,0 +1,2 @@
d /var/log/radius 0755 radiusd radiusd -
d /run/radiusd 0755 radiusd radiusd -

View File

@@ -0,0 +1,16 @@
[Unit]
Description=FreeRADIUS high performance RADIUS server.
After=syslog.target network.target
[Service]
Type=forking
EnvironmentFile=-/etc/sysconfig/radiusd
PIDFile=/run/radiusd/radiusd.pid
ExecStartPre=-@BASE_BINDIR@/chown -R radiusd:radiusd /run/radiusd
ExecStartPre=@SBINDIR@/radiusd -C
ExecStart=@SBINDIR@/radiusd -d @SYSCONFDIR@/${MLPREFIX}raddb
ExecReload=@SBINDIR@/radiusd -C
ExecReload=@BASE_BINDIR@/kill -HUP $MAINPID
[Install]
WantedBy=multi-user.target

View File

@@ -0,0 +1,3 @@
# <type> <owner> <group> <mode> <path> <linksource>
d radiusd radiusd 0755 /var/run/radiusd none
d radiusd radiusd 0755 /var/log/radius none

View File

@@ -0,0 +1,298 @@
DESCRIPTION = "FreeRADIUS is an Internet authentication daemon, which implements the RADIUS \
protocol, as defined in RFC 2865 (and others). It allows Network Access \
Servers (NAS boxes) to perform authentication for dial-up users. There are \
also RADIUS clients available for Web servers, firewalls, Unix logins, and \
more. Using RADIUS allows authentication and authorization for a network to \
be centralized, and minimizes the amount of re-configuration which has to be \
done when adding or deleting new users."
SUMMARY = "High-performance and highly configurable RADIUS server"
HOMEPAGE = "http://www.freeradius.org/"
SECTION = "System/Servers"
LICENSE = "GPL-2.0-only & LGPL-2.0-or-later"
LIC_FILES_CHKSUM = "file://LICENSE;md5=eb723b61539feef013de476e68b5c50a"
DEPENDS = "openssl-native openssl libidn libtool libpcap libtalloc"
SRC_URI = "git://github.com/FreeRADIUS/freeradius-server.git;branch=v3.2.x;lfs=0;;protocol=https \
file://freeradius \
file://volatiles.58_radiusd \
file://radiusd.service \
file://radiusd-volatiles.conf \
file://0001-Add-autogen.sh.patch \
file://0002-Enable-and-change-user-and-group-of-freeradius-serve.patch \
file://0003-configure.ac-allow-cross-compilation.patch \
file://0004-Fix-libtool-detection.patch \
file://0005-configure.ac-add-option-for-libcap.patch \
file://0006-Avoid-searching-host-dirs.patch \
file://0007-rlm_python-add-PY_INC_DIR-in-search-dir.patch \
file://0008-libtool-do-not-use-jlibtool.patch \
file://0009-Fix-quoting-for-BUILD_WITH.patch \
file://0010-fix-error-for-expansion-of-macro-in-thread.h.patch \
file://0011-rlm_mschap-Use-includedir-instead-of-hardcoding-usr-.patch \
file://0012-raddb-certs-Makefile-fix-the-existed-certificate-err.patch \
file://0013-raddb-certs-Makefile-fix-the-occasional-verification.patch \
file://0014-Workaround-error-with-autoconf-2.7.patch \
file://0015-bootstrap-check-commands-of-openssl-exist.patch \
file://0016-version.c-don-t-print-build-flags.patch \
file://0017-Add-acinclude.m4-to-include-required-macros.patch \
"
raddbdir = "${sysconfdir}/${MLPREFIX}raddb"
SRCREV = "a7acce80f5ba2271d9aeb737a4a91a5bf8317f31"
UPSTREAM_CHECK_GITTAGREGEX = "release_(?P<pver>\d+(\_\d+)+)"
CVE_STATUS[CVE-2002-0318] = "fixed-version: The CPE in the NVD database doesn't reflect correctly the vulnerable versions."
CVE_STATUS[CVE-2011-4966] = "fixed-version: The CPE in the NVD database doesn't reflect correctly the vulnerable versions."
PARALLEL_MAKE = ""
S = "${WORKDIR}/git"
LDFLAGS:append:powerpc = " -latomic"
LDFLAGS:append:mipsarch = " -latomic"
LDFLAGS:append:armv5 = " -latomic"
EXTRA_OECONF = " --enable-strict-dependencies \
--with-docdir=${docdir}/freeradius-${PV} \
--with-openssl-includes=${STAGING_INCDIR} \
--with-openssl-libraries=${STAGING_LIBDIR} \
--with-raddbdir=${raddbdir} \
--without-rlm_ippool \
--without-rlm_cache_memcached \
--without-rlm_counter \
--without-rlm_couchbase \
--without-rlm_dbm \
--without-rlm_eap_tnc \
--without-rlm_eap_ikev2 \
--without-rlm_opendirectory \
--without-rlm_redis \
--without-rlm_rediswho \
--without-rlm_cache_redis \
--without-rlm_sql_db2 \
--without-rlm_sql_firebird \
--without-rlm_sql_freetds \
--without-rlm_sql_iodbc \
--without-rlm_sql_oracle \
--without-rlm_sql_sybase \
--without-rlm_sql_mongo \
--without-rlm_sqlhpwippool \
--without-rlm_securid \
--without-rlm_unbound \
--without-rlm_python \
ac_cv_path_PERL=${bindir}/perl \
ax_cv_cc_builtin_choose_expr=no \
ax_cv_cc_builtin_types_compatible_p=no \
ax_cv_cc_builtin_bswap64=no \
ax_cv_cc_bounded_attribute=no \
"
PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)} \
pcre libcap \
openssl rlm-eap-fast rlm-eap-pwd \
"
PACKAGECONFIG[krb5] = "--with-rlm_krb5,--without-rlm_krb5,krb5"
PACKAGECONFIG[pam] = "--with-rlm_pam,--without-rlm_pam,libpam"
PACKAGECONFIG[libcap] = "--with-libcap,--without-libcap,libcap"
PACKAGECONFIG[ldap] = "--with-rlm_ldap,--without-rlm_ldap,openldap"
PACKAGECONFIG[mysql] = "--with-rlm_sql_mysql,--without-rlm_sql_mysql,mysql5"
PACKAGECONFIG[sqlite] = "--with-rlm_sql_sqlite,--without-rlm_sql_sqlite,sqlite3"
PACKAGECONFIG[unixodbc] = "--with-rlm_sql_unixodbc,--without-rlm_sql_unixodbc,unixodbc"
PACKAGECONFIG[postgresql] = "--with-rlm_sql_postgresql,--without-rlm_sql_postgresql,postgresql"
PACKAGECONFIG[pcre] = "--with-pcre,--without-pcre,libpcre"
PACKAGECONFIG[perl] = "--with-perl=${STAGING_BINDIR_NATIVE}/perl-native/perl --with-rlm_perl,--without-rlm_perl,perl-native perl,perl"
PACKAGECONFIG[python3] = "--with-rlm_python3 --with-rlm-python3-bin=${STAGING_BINDIR_NATIVE}/python3-native/python3 --with-rlm-python3-include-dir=${STAGING_INCDIR}/${PYTHON_DIR},--without-rlm_python3,python3-native python3"
PACKAGECONFIG[rest] = "--with-rlm_rest,--without-rlm_rest --without-rlm_json,curl json-c"
PACKAGECONFIG[ruby] = "--with-rlm_ruby,--without-rlm_ruby,ruby"
PACKAGECONFIG[openssl] = "--with-openssl, --without-openssl"
PACKAGECONFIG[rlm-eap-fast] = "--with-rlm_eap_fast, --without-rlm_eap_fast"
PACKAGECONFIG[rlm-eap-pwd] = "--with-rlm_eap_pwd, --without-rlm_eap_pwd"
inherit useradd autotools-brokensep update-rc.d systemd multilib_script multilib_header
MULTILIB_SCRIPTS = "${PN}:${sbindir}/checkrad"
# This is not a cpan or python based package, but it needs some definitions
# from cpan-base and python3-dir bbclasses for building rlm_perl and rlm_python
# correctly.
inherit cpan-base python3-dir
# The modules subdirs also need to be processed by autoreconf. Use autogen.sh
# in order to handle the subdirs correctly.
do_configure() {
./autogen.sh
# the configure of rlm_perl needs this to get correct
# mod_cflags and mod_ldflags
if ${@bb.utils.contains('PACKAGECONFIG', 'perl', 'true', 'false', d)}; then
export PERL5LIB="${STAGING_LIBDIR}${PERL_OWN_DIR}/perl/${@get_perl_version(d)}"
fi
oe_runconf
# we don't need dhcpclient
sed -i -e 's/dhcpclient.mk//' ${S}/src/modules/proto_dhcp/all.mk
}
INITSCRIPT_NAME = "radiusd"
SYSTEMD_SERVICE:${PN} = "radiusd.service"
USERADD_PACKAGES = "${PN}"
USERADD_PARAM:${PN} = "--system --no-create-home --shell /bin/false --user-group radiusd"
do_install() {
rm -rf ${D}
install -d ${D}/${sysconfdir}/logrotate.d
install -d ${D}/${sysconfdir}/pam.d
install -d ${D}/${localstatedir}/lib/radiusd
export LD_LIBRARY_PATH=${D}/${libdir}
oe_runmake install R=${D} INSTALLSTRIP=""
# remove unsupported config files
rm -f ${D}/${raddbdir}/experimental.conf
# remove scripts that required Perl(DBI)
rm -rf ${D}/${bindir}/radsqlrelay
rm -f ${D}/${sbindir}/rc.radiusd
rm -rf ${D}/${localstatedir}/run/
rm -rf ${D}/${localstatedir}/log/
chown -R radiusd:radiusd ${D}/${raddbdir}
chown -R radiusd:radiusd ${D}/${localstatedir}/lib/radiusd
# For sysvinit
if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
install -d ${D}${sysconfdir}/init.d
install -d ${D}${sysconfdir}/default/volatiles
install -m 0755 ${WORKDIR}/freeradius ${D}/etc/init.d/radiusd
install -m 0644 ${WORKDIR}/volatiles.58_radiusd ${D}${sysconfdir}/default/volatiles/58_radiusd
fi
# For systemd
if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
install -d ${D}${systemd_unitdir}/system
install -m 0644 ${WORKDIR}/radiusd.service ${D}${systemd_unitdir}/system
sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \
-e 's,@SBINDIR@,${sbindir},g' \
-e 's,@STATEDIR@,${localstatedir},g' \
-e 's,@SYSCONFDIR@,${sysconfdir},g' \
${D}${systemd_unitdir}/system/radiusd.service
install -d ${D}${sysconfdir}/tmpfiles.d/
install -m 0644 ${WORKDIR}/radiusd-volatiles.conf ${D}${sysconfdir}/tmpfiles.d/radiusd.conf
fi
oe_multilib_header freeradius/autoconf.h
oe_multilib_header freeradius/missing.h
oe_multilib_header freeradius/radpaths.h
}
# This is only needed when we install/update on a running target.
#
pkg_postinst:${PN} () {
if [ -z "$D" ]; then
if command -v systemd-tmpfiles >/dev/null; then
# create /var/log/radius, /var/run/radiusd
systemd-tmpfiles --create ${sysconfdir}/tmpfiles.d/radiusd.conf
elif [ -e ${sysconfdir}/init.d/populate-volatile.sh ]; then
${sysconfdir}/init.d/populate-volatile.sh update
fi
# Fix ownership for /etc/raddb/*, /var/lib/radiusd
chown -R radiusd:radiusd ${raddbdir}
chown -R radiusd:radiusd ${localstatedir}/lib/radiusd
# for radiusd.service with multilib
if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
install -d ${sysconfdir}/sysconfig
echo "MLPREFIX=${MLPREFIX}" > ${sysconfdir}/sysconfig/radiusd
fi
else
if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
install -d $D${sysconfdir}/sysconfig
echo "MLPREFIX=${MLPREFIX}" > $D${sysconfdir}/sysconfig/radiusd
fi
fi
}
pkg_postrm:${PN} () {
# only try to remove ${sysconfdir}/sysconfig/radiusd for systemd
if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'false', 'true', d)}; then
exit 0
fi
if [ -d ${sysconfdir}/raddb ]; then
exit 0
fi
for variant in ${MULTILIB_GLOBAL_VARIANTS}; do
if [ -d ${sysconfdir}/${variant}-raddb ]; then
exit 0
fi
done
rm -f ${sysconfdir}/sysconfig/radiusd
rmdir --ignore-fail-on-non-empty ${sysconfdir}/sysconfig
}
# We really need the symlink :(
INSANE_SKIP:${PN} = "dev-so"
INSANE_SKIP:${PN}-krb5 = "dev-so"
INSANE_SKIP:${PN}-ldap = "dev-so"
INSANE_SKIP:${PN}-mysql = "dev-so"
INSANE_SKIP:${PN}-perl = "dev-so"
INSANE_SKIP:${PN}-postgresql = "dev-so"
INSANE_SKIP:${PN}-python = "dev-so"
INSANE_SKIP:${PN}-unixodbc = "dev-so"
PACKAGES =+ "${PN}-utils ${PN}-ldap ${PN}-krb5 ${PN}-perl \
${PN}-python ${PN}-mysql ${PN}-postgresql ${PN}-unixodbc"
FILES:${PN}-utils = "${bindir}/*"
FILES:${PN}-ldap = "${libdir}/rlm_ldap.so* \
${raddbdir}/mods-available/ldap \
"
FILES:${PN}-krb5 = "${libdir}/rlm_krb5.so* \
${raddbdir}/mods-available/krb5 \
"
FILES:${PN}-perl = "${libdir}/rlm_perl.so* \
${raddbdir}/mods-config/perl \
${raddbdir}/mods-available/perl \
"
FILES:${PN}-python = "${libdir}/rlm_python3.so* \
${raddbdir}/mods-config/python3 \
${raddbdir}/mods-available/python3 \
"
FILES:${PN}-mysql = "${libdir}/rlm_sql_mysql.so* \
${raddbdir}/mods-config/sql/*/mysql \
${raddbdir}/mods-available/sql \
"
FILES:${PN}-postgresql = "${libdir}/rlm_sql_postgresql.so* \
${raddbdir}/mods-config/sql/*/postgresql \
"
FILES:${PN}-unixodbc = "${libdir}/rlm_sql_unixodbc.so*"
FILES:${PN} =+ "${libdir}/rlm_*.so* ${libdir}/proto_*so*"
RDEPENDS:${PN} += "perl"
RDEPENDS:${PN}-utils = "${PN} perl"
RDEPENDS:${PN}-krb5 = "${PN}"
RDEPENDS:${PN}-ldap = "${PN}"
RDEPENDS:${PN}-mysql = "${PN}"
RDEPENDS:${PN}-perl = "${PN}"
RDEPENDS:${PN}-postgresql = "${PN}"
RDEPENDS:${PN}-python = "${PN}"
RDEPENDS:${PN}-unixodbc = "${PN}"
CLEANBROKEN = "1"

View File

@@ -0,0 +1,31 @@
DESCRIPTION = "LFTP is a sophisticated file transfer program with \
command line interface. It supports FTP, HTTP, \
FISH, SFTP, HTTPS and FTPS protocols"
HOMEPAGE = "http://lftp.yar.ru/"
SECTION = "console/network"
LICENSE = "GPL-3.0-only"
LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
SRC_URI = "http://lftp.yar.ru/ftp/lftp-${PV}.tar.bz2"
SRC_URI[md5sum] = "42ec1793c386702bc2734ffbc8a5cff1"
SRC_URI[sha256sum] = "8a07cbf4df09b107fe3fc41d133ee2f6cea6ef4c33ccf06c8448ad058cd96b7e"
inherit autotools gettext pkgconfig
acpaths = "-I ./m4"
EXTRA_OECONF += "--with-modules --disable-rpath"
PACKAGECONFIG ??= "openssl zlib gnutls readline expat"
PACKAGECONFIG[openssl] = "--with-openssl, --without-openssl, openssl"
PACKAGECONFIG[zlib] = "--with-zlib=${STAGING_INCDIR}/.., --without-zlib, zlib"
PACKAGECONFIG[gnutls] = "--with-gnutls, --without-gnutls, gnutls"
PACKAGECONFIG[readline] = "--with-readline=${STAGING_INCDIR}/.. --with-readline-inc=${STAGING_INCDIR} --with-readline-lib=-lreadline, --with-readline=no, readline"
PACKAGECONFIG[expat] = "--with-expat=${STAGING_INCDIR}/.. --with-expat-inc=${STAGING_INCDIR} --with-expat-lib=-lexpat, , expat"
do_install:append() {
rm -rf ${D}${libdir}/charset.alias
}
FILES:${PN} += "${datadir}/icons/hicolor"
FILES:${PN}-dbg += "${libdir}/lftp/${PV}/.debug"
RDEPENDS:${PN} = "perl bash readline"

View File

@@ -0,0 +1,22 @@
SUMMARY = "dumb networking library"
HOMEPAGE = "https://github.com/ofalk/libdnet"
SECTION = "libs"
LICENSE = "BSD-3-Clause"
LIC_FILES_CHKSUM = "file://LICENSE;md5=0036c1b155f4e999f3e0a373490b5db9"
SRC_URI = "git://github.com/ofalk/libdnet.git;nobranch=1;protocol=https"
SRCREV = "3dfbe889b1f65077efe579da34fc1d6819fcb7f3"
UPSTREAM_CHECK_GITTAGREGEX = "libdnet-(?P<pver>\d+(\.\d+)+)"
S = "${WORKDIR}/git"
inherit autotools multilib_script pkgconfig
DEPENDS += "libcheck"
EXTRA_AUTORECONF += "-I ./config"
BBCLASSEXTEND = "native"
MULTILIB_SCRIPTS = "${PN}:${bindir}/dnet-config"

View File

@@ -0,0 +1,29 @@
From 16d07a82242c3263ec0038c9b4c97355795d2dd9 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sat, 19 Mar 2022 23:16:51 -0700
Subject: [PATCH] pyiec61850: Use CMAKE_INSTALL_LIBDIR from GNUInstallDirs in
cmake
This ensures that it gets installed in platform specified system libdir
all platforms do not use /usr/lib as assumed here e.g. ppc64 uses lib64
Upstream-Status: Submitted [https://github.com/mz-automation/libiec61850/pull/376]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
pyiec61850/CMakeLists.txt | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
--- a/pyiec61850/CMakeLists.txt
+++ b/pyiec61850/CMakeLists.txt
@@ -31,7 +31,9 @@ endif()
swig_link_libraries(iec61850 ${PYTHON_LIBRARIES} ${LIBS})
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/iec61850.py DESTINATION /usr/lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages)
-install(TARGETS _iec61850 LIBRARY DESTINATION /usr/lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages)
+include(GNUInstallDirs)
+
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/iec61850.py DESTINATION ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages)
+install(TARGETS _iec61850 LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}//python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages)
add_test(test_pyiec61850 ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_LIST_DIR}/test_pyiec61850.py)

View File

@@ -0,0 +1,39 @@
From d4ddfc7a350011b7944ed8d6bca80f164dfd1387 Mon Sep 17 00:00:00 2001
From: Romain Naour <romain.naour@smile.fr>
Date: Fri, 10 Jul 2020 17:08:34 +0200
Subject: [PATCH] pyiec61850: don't break CMAKE_INSTALL_PATH by trying to find
python modules install path (site-packages)
https://stackoverflow.com/questions/1242904/finding-python-site-packages-directory-with-cmake
Signed-off-by: Romain Naour <romain.naour@smile.fr>
---
Upstream-Status: Pending
pyiec61850/CMakeLists.txt | 11 ++---------
1 file changed, 2 insertions(+), 9 deletions(-)
diff --git a/pyiec61850/CMakeLists.txt b/pyiec61850/CMakeLists.txt
index 159ef4b..d1732a1 100644
--- a/pyiec61850/CMakeLists.txt
+++ b/pyiec61850/CMakeLists.txt
@@ -31,14 +31,7 @@ endif()
swig_link_libraries(iec61850 ${PYTHON_LIBRARIES} ${LIBS})
-# Finding python modules install path
-execute_process(
- COMMAND ${PYTHON_EXECUTABLE} -c
- "from distutils.sysconfig import get_python_lib; import sys; sys.stdout.write(get_python_lib())"
- OUTPUT_VARIABLE PYTHON_SITE_DIR
-)
-
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/iec61850.py DESTINATION ${PYTHON_SITE_DIR})
-install(TARGETS _iec61850 LIBRARY DESTINATION ${PYTHON_SITE_DIR})
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/iec61850.py DESTINATION /usr/lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages)
+install(TARGETS _iec61850 LIBRARY DESTINATION /usr/lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages)
add_test(test_pyiec61850 ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_LIST_DIR}/test_pyiec61850.py)
--
2.31.1

View File

@@ -0,0 +1,38 @@
SUMMARY = "Open source iec61850 implementation"
DESCRIPTION = "IEC 61850 is an international standard for \
communication systems in Substation Automation Systems \
(SAS) and management of Decentralized Energy Resources \
(DER). It is seen as one of the communication standards \
of the emerging Smart Grid. \
The project libIEC61850 provides a server and client \
library for the IEC 61850/MMS, IEC 61850/GOOSE and IEC \
61850-9-2/Sampled Values communication protocols \
written in C. It is available under the GPLv3 license."
HOMEPAGE = "http://libiec61850.com"
SECTION = "console/network"
LICENSE = "GPL-3.0-only"
LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
DEPENDS = "swig-native python3"
SRCREV = "210cf30897631fe2006ac50483caf8fd616622a2"
SRC_URI = "git://github.com/mz-automation/${BPN}.git;branch=v1.5;protocol=https \
file://0001-pyiec61850-don-t-break-CMAKE_INSTALL_PATH-by-trying-.patch \
file://0001-pyiec61850-Use-CMAKE_INSTALL_LIBDIR-from-GNUInstallD.patch \
"
S = "${WORKDIR}/git"
inherit cmake pkgconfig python3-dir python3native siteinfo
EXTRA_OECMAKE = " \
-DBUILD_EXAMPLES=OFF \
-DBUILD_PYTHON_BINDINGS=ON \
"
RDEPENDS:${PN}-python = " python3-core "
RDEPENDS:${PN} = " python3-core "
FILES:${PN} += " \
${PYTHON_SITEPACKAGES_DIR}/iec61850.py \
${PYTHON_SITEPACKAGES_DIR}/_iec61850.so \
"

View File

@@ -0,0 +1,17 @@
#!/bin/sh
ptestdir=$(dirname "$(readlink -f "$0")")
cd "$ptestdir"/tests || exit
tests=$(find * -type f -name 'test_suite_*')
for f in $tests
do
if test -x ./"$f"; then
if ./"$f" > ./"$f".out 2> ./"$f".err; then
echo "PASS: $f"
else
echo "FAIL: $f"
fi
fi
done

View File

@@ -0,0 +1,80 @@
SUMMARY = "Lightweight crypto and SSL/TLS library"
DESCRIPTION = "mbedtls is a lean open source crypto library \
for providing SSL and TLS support in your programs. It offers \
an intuitive API and documented header files, so you can actually \
understand what the code does. It features: \
\
- Symmetric algorithms, like AES, Blowfish, Triple-DES, DES, ARC4, \
Camellia and XTEA \
- Hash algorithms, like SHA-1, SHA-2, RIPEMD-160 and MD5 \
- Entropy pool and random generators, like CTR-DRBG and HMAC-DRBG \
- Public key algorithms, like RSA, Elliptic Curves, Diffie-Hellman, \
ECDSA and ECDH \
- SSL v3 and TLS 1.0, 1.1 and 1.2 \
- Abstraction layers for ciphers, hashes, public key operations, \
platform abstraction and threading \
"
HOMEPAGE = "https://tls.mbed.org/"
LICENSE = "Apache-2.0 | GPL-2.0-or-later"
LIC_FILES_CHKSUM = "file://LICENSE;md5=379d5819937a6c2f1ef1630d341e026d"
SECTION = "libs"
S = "${WORKDIR}/git"
SRCREV = "2fc8413bfcb51354c8e679141b17b3f1a5942561"
SRC_URI = "git://github.com/Mbed-TLS/mbedtls.git;protocol=https;branch=mbedtls-2.28 \
file://run-ptest \
"
inherit cmake update-alternatives ptest
PACKAGECONFIG ??= "shared-libs programs ${@bb.utils.contains('PTEST_ENABLED', '1', 'tests', '', d)}"
PACKAGECONFIG[shared-libs] = "-DUSE_SHARED_MBEDTLS_LIBRARY=ON,-DUSE_SHARED_MBEDTLS_LIBRARY=OFF"
PACKAGECONFIG[programs] = "-DENABLE_PROGRAMS=ON,-DENABLE_PROGRAMS=OFF"
PACKAGECONFIG[werror] = "-DMBEDTLS_FATAL_WARNINGS=ON,-DMBEDTLS_FATAL_WARNINGS=OFF"
# Make X.509 and TLS calls use PSA
# https://github.com/Mbed-TLS/mbedtls/blob/development/docs/use-psa-crypto.md
PACKAGECONFIG[psa] = ""
PACKAGECONFIG[tests] = "-DENABLE_TESTING=ON,-DENABLE_TESTING=OFF"
EXTRA_OECMAKE = "-DLIB_INSTALL_DIR:STRING=${libdir}"
# For now the only way to enable PSA is to explicitly pass a -D via CFLAGS
CFLAGS:append = "${@bb.utils.contains('PACKAGECONFIG', 'psa', ' -DMBEDTLS_USE_PSA_CRYPTO', '', d)}"
PROVIDES += "polarssl"
RPROVIDES:${PN} = "polarssl"
PACKAGES =+ "${PN}-programs"
FILES:${PN}-programs = "${bindir}/"
ALTERNATIVE:${PN}-programs = "hello"
ALTERNATIVE_LINK_NAME[hello] = "${bindir}/hello"
BBCLASSEXTEND = "native nativesdk"
CVE_PRODUCT = "mbed_tls"
CVE_STATUS[CVE-2021-43666] = "backported-patch: Fix merged upstream https://github.com/Mbed-TLS/mbedtls/pull/5310"
CVE_STATUS[CVE-2021-45451] = "backported-patch: Fix merged upstream https://github.com/Mbed-TLS/mbedtls/commit/9a4a9c66a48edfe9ece03c7e4a53310adf73a86c"
# Strip host paths from autogenerated test files
do_compile:append() {
sed -i 's+${S}/++g' ${B}/tests/*.c 2>/dev/null || :
sed -i 's+${B}/++g' ${B}/tests/*.c 2>/dev/null || :
}
# Export source files/headers needed by Arm Trusted Firmware
sysroot_stage_all:append() {
sysroot_stage_dir "${S}/library" "${SYSROOT_DESTDIR}/usr/share/mbedtls-source/library"
sysroot_stage_dir "${S}/include" "${SYSROOT_DESTDIR}/usr/share/mbedtls-source/include"
}
do_install_ptest () {
install -d ${D}${PTEST_PATH}/tests
cp -f ${B}/tests/test_suite_* ${D}${PTEST_PATH}/tests/
find ${D}${PTEST_PATH}/tests/ -type f -name "*.c" -delete
cp -fR ${S}/tests/data_files ${D}${PTEST_PATH}/tests/
}

View File

@@ -0,0 +1,80 @@
SUMMARY = "Lightweight crypto and SSL/TLS library"
DESCRIPTION = "mbedtls is a lean open source crypto library \
for providing SSL and TLS support in your programs. It offers \
an intuitive API and documented header files, so you can actually \
understand what the code does. It features: \
\
- Symmetric algorithms, like AES, Blowfish, Triple-DES, DES, ARC4, \
Camellia and XTEA \
- Hash algorithms, like SHA-1, SHA-2, RIPEMD-160 and MD5 \
- Entropy pool and random generators, like CTR-DRBG and HMAC-DRBG \
- Public key algorithms, like RSA, Elliptic Curves, Diffie-Hellman, \
ECDSA and ECDH \
- SSL v3 and TLS 1.0, 1.1 and 1.2 \
- Abstraction layers for ciphers, hashes, public key operations, \
platform abstraction and threading \
"
HOMEPAGE = "https://tls.mbed.org/"
LICENSE = "Apache-2.0 | GPL-2.0-or-later"
LIC_FILES_CHKSUM = "file://LICENSE;md5=379d5819937a6c2f1ef1630d341e026d"
SECTION = "libs"
S = "${WORKDIR}/git"
SRC_URI = "git://github.com/Mbed-TLS/mbedtls.git;protocol=https;branch=mbedtls-3.6 \
file://run-ptest"
SRCREV = "22098d41c6620ce07cf8a0134d37302355e1e5ef"
UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>\d+(\.\d+)+)"
inherit cmake update-alternatives ptest
PACKAGECONFIG ??= "shared-libs programs ${@bb.utils.contains('PTEST_ENABLED', '1', 'tests', '', d)}"
PACKAGECONFIG[shared-libs] = "-DUSE_SHARED_MBEDTLS_LIBRARY=ON,-DUSE_SHARED_MBEDTLS_LIBRARY=OFF"
PACKAGECONFIG[programs] = "-DENABLE_PROGRAMS=ON,-DENABLE_PROGRAMS=OFF"
PACKAGECONFIG[werror] = "-DMBEDTLS_FATAL_WARNINGS=ON,-DMBEDTLS_FATAL_WARNINGS=OFF"
# Make X.509 and TLS calls use PSA
# https://github.com/Mbed-TLS/mbedtls/blob/development/docs/use-psa-crypto.md
PACKAGECONFIG[psa] = ""
PACKAGECONFIG[tests] = "-DENABLE_TESTING=ON,-DENABLE_TESTING=OFF"
EXTRA_OECMAKE = "-DLIB_INSTALL_DIR:STRING=${libdir}"
# For now the only way to enable PSA is to explicitly pass a -D via CFLAGS
CFLAGS:append = "${@bb.utils.contains('PACKAGECONFIG', 'psa', ' -DMBEDTLS_USE_PSA_CRYPTO', '', d)}"
PROVIDES += "polarssl"
RPROVIDES:${PN} = "polarssl"
PACKAGES =+ "${PN}-programs"
FILES:${PN}-programs = "${bindir}/"
ALTERNATIVE:${PN}-programs = "hello"
ALTERNATIVE_LINK_NAME[hello] = "${bindir}/hello"
BBCLASSEXTEND = "native nativesdk"
CVE_PRODUCT = "mbed_tls"
# Strip host paths from autogenerated test files
do_compile:append() {
sed -i 's+${S}/++g' ${B}/tests/*.c 2>/dev/null || :
sed -i 's+${B}/++g' ${B}/tests/*.c 2>/dev/null || :
}
# Export source files/headers needed by Arm Trusted Firmware
sysroot_stage_all:append() {
sysroot_stage_dir "${S}/library" "${SYSROOT_DESTDIR}/usr/share/mbedtls-source/library"
sysroot_stage_dir "${S}/include" "${SYSROOT_DESTDIR}/usr/share/mbedtls-source/include"
}
do_install_ptest () {
install -d ${D}${PTEST_PATH}/tests
install -d ${D}${PTEST_PATH}/framework
cp -f ${B}/tests/test_suite_* ${D}${PTEST_PATH}/tests/
find ${D}${PTEST_PATH}/tests/ -type f -name "*.c" -delete
cp -fR ${S}/framework/data_files ${D}${PTEST_PATH}/framework/
}

View File

@@ -0,0 +1,38 @@
From 54698856e5602bbd9d61e855814c854a013b4840 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sat, 22 Dec 2018 18:47:45 -0800
Subject: [PATCH] Add OpenEmbedded cross compile case
Upstream-Status: Submitted [https://github.com/miniupnp/miniupnp/pull/410]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
genconfig.sh | 11 +++++++++++
1 file changed, 11 insertions(+)
--- a/genconfig.sh
+++ b/genconfig.sh
@@ -103,6 +103,12 @@ if [ -f ../shared/tomato_version ]; then
OS_VERSION="Tomato $TOMATO_VER"
fi
+# OpenEmbedded special case
+if [ -f ./os.openembedded ]; then
+ OS_NAME=OpenEmbedded
+ OS_VERSION=$(cat ./os.openembedded)
+fi
+
${RM} ${CONFIGFILE}
echo "/* MiniUPnP Project" >> ${CONFIGFILE}
@@ -346,6 +352,11 @@ case $OS_NAME in
echo "#define USE_IFACEWATCHER 1" >> ${CONFIGFILE}
FW=iptables
;;
+ OpenEmbedded)
+ OS_URL=http://www.openembedded.org/
+ echo "#define USE_IFACEWATCHER 1" >> ${CONFIGFILE}
+ FW=iptables
+ ;;
AstLinux)
OS_URL=http://www.astlinux.org/
echo "#define USE_IFACEWATCHER 1" >> ${CONFIGFILE}

View File

@@ -0,0 +1,14 @@
[Unit]
Description=Lightweight UPnP IGD daemon
Documentation=man:miniupnpd(8)
After=network.target
[Service]
Type=forking
ExecStartPre=/etc/miniupnpd/iptables_init.sh
ExecStart=/usr/sbin/miniupnpd -f /etc/miniupnpd/miniupnpd.conf
ExecStopPost=/etc/miniupnpd/iptables_removeall.sh
PIDFile=/run/miniupnpd.pid
[Install]
WantedBy=network.target

View File

@@ -0,0 +1,50 @@
SUMMARY = "Lightweight UPnP IGD daemon"
DESCRIPTION = "The miniUPnP daemon is an UPnP IGD (internet gateway device) \
which provide NAT traversal services to any UPnP enabled client on \
the network."
SECTION = "networking"
LICENSE = "BSD-3-Clause"
LIC_FILES_CHKSUM = "file://LICENSE;md5=a1ed15843ce66639bcf9f109cf247870"
inherit autotools gettext pkgconfig systemd
DEPENDS += "iptables net-tools util-linux libmnl libnetfilter-conntrack"
SRC_URI = "http://miniupnp.tuxfamily.org/files/download.php?file=${BP}.tar.gz;downloadfilename=${BP}.tar.gz \
file://miniupnpd.service \
file://0001-Add-OpenEmbedded-cross-compile-case.patch \
"
SRC_URI[md5sum] = "340789edd49c113afe37834cc901a1e8"
SRC_URI[sha256sum] = "218fad7af31f3c22fb4c9db28a55a2a8b5067d41f5b38f52008a057a00d2206d"
IPV6 = "${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', '--ipv6', '', d)}"
do_configure:prepend() {
echo "${@d.getVar('DISTRO_VERSION')}" > ${S}/os.openembedded
}
do_compile() {
cd ${S}
CONFIG_OPTIONS="${IPV6} --leasefile --vendorcfg" oe_runmake -f Makefile.linux config.h
CONFIG_OPTIONS="${IPV6} --leasefile --vendorcfg" oe_runmake -f Makefile.linux
}
do_install() {
install -d ${D}/${sbindir}
install ${S}/miniupnpd ${D}/${sbindir}
install -d ${D}/${sysconfdir}/${BPN}
install ${S}/netfilter/iptables_init.sh ${D}/${sysconfdir}/${BPN}
install ${S}/netfilter/iptables_removeall.sh ${D}/${sysconfdir}/${BPN}
install ${S}/netfilter/ip6tables_init.sh ${D}/${sysconfdir}/${BPN}
install ${S}/netfilter/miniupnpd_functions.sh ${D}/${sysconfdir}/${BPN}
install ${S}/netfilter/ip6tables_removeall.sh ${D}/${sysconfdir}/${BPN}
install -m 0644 -b ${S}/miniupnpd.conf ${D}/${sysconfdir}/${BPN}
install -d ${D}/${sysconfdir}/init.d
install ${S}/linux/miniupnpd.init.d.script ${D}/${sysconfdir}/init.d/miniupnpd
install -d ${D}${systemd_unitdir}/system
install -m 0644 ${WORKDIR}/miniupnpd.service ${D}${systemd_unitdir}/system/
}
SYSTEMD_SERVICE:${PN} = "miniupnpd.service"

View File

@@ -0,0 +1,27 @@
From: Joachim Zobel <jz-2017@heute-morgen.de>
Date: Wed, 13 Sep 2023 10:05:43 +0200
Subject: [PATCH] Mosquitto now waits for network-online when starting
(Closes: #1036450)
See: https://github.com/eclipse/mosquitto/issues/2878
---
Upstream-Status: Pending
service/systemd/mosquitto.service.simple | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/service/systemd/mosquitto.service.simple b/service/systemd/mosquitto.service.simple
index 15ee0d6..c2a330b 100644
--- a/service/systemd/mosquitto.service.simple
+++ b/service/systemd/mosquitto.service.simple
@@ -1,8 +1,8 @@
[Unit]
Description=Mosquitto MQTT Broker
Documentation=man:mosquitto.conf(5) man:mosquitto(8)
-After=network.target
-Wants=network.target
+After=network-online.target
+Wants=network-online.target
[Service]
ExecStart=/usr/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf

View File

@@ -0,0 +1,89 @@
#!/bin/sh
# Based on the Debian initscript for mosquitto
### BEGIN INIT INFO
# Provides: mosquitto
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: mosquitto MQTT 3.1/3.1.1 message broker
# Description:
# This is a message broker that supports version 3.1 of the MQ Telemetry
# Transport (MQTT) protocol.
#
# MQTT provides a method of carrying out messaging using a publish/subscribe
# model. It is lightweight, both in terms of bandwidth usage and ease of
# implementation. This makes it particularly useful at the edge of the network
# where a sensor or other simple device may be implemented using an arduino for
# example.
### END INIT INFO
set -e
PIDFILE=@LOCALSTATEDIR@/run/mosquitto.pid
DAEMON=@SBINDIR@/mosquitto
# start and stop the mosquitto MQTT message broker
test -x ${DAEMON} || exit 0
umask 022
. @SYSCONFDIR@/init.d/functions
export PATH="${PATH:+$PATH:}@SBINDIR@:@BASE_SBINDIR@"
case "$1" in
start)
echo "Starting Mosquitto message broker" "mosquitto"
if start-stop-daemon --start --quiet --oknodo --background --make-pidfile --pidfile ${PIDFILE} --exec ${DAEMON} -- -c @SYSCONFDIR@/mosquitto/mosquitto.conf ; then
exit 0
else
exit 1
fi
;;
stop)
echo "Stopping Mosquitto message broker" "mosquitto"
if start-stop-daemon --stop --quiet --oknodo --pidfile ${PIDFILE}; then
rm -f ${PIDFILE}
exit 0
else
exit 1
fi
;;
reload|force-reload)
if [ -f ${PIDFILE} ] ; then
echo "Reloading configuration for mosquitto"
pid=`cat ${PIDFILE}`
kill -HUP $pid
else
echo "mosquitto does not seem to be running"
fi
;;
restart)
echo "Restarting Mosquitto message broker" "mosquitto"
if start-stop-daemon --stop --quiet --oknodo --retry 30 --pidfile ${PIDFILE}; then
rm -f ${PIDFILE}
fi
if start-stop-daemon --start --quiet --oknodo --background --make-pidfile --pidfile ${PIDFILE} --exec ${DAEMON} -- -c @SYSCONFDIR@/mosquitto/mosquitto.conf ; then
exit 0
else
exit 1
fi
;;
status)
status ${DAEMON} && exit 0 || exit $?
;;
*)
echo "Usage: $0 {start|stop|reload|force-reload|restart|status}"
exit 1
esac
exit 0

View File

@@ -0,0 +1,90 @@
SUMMARY = "Open source MQTT implementation"
DESCRIPTION = "Mosquitto is an open source (Eclipse licensed) message broker \
that implements the MQ Telemetry Transport protocol version 3.1, 3.1.1 and \
5, providing both an MQTT broker and several command-line clients. MQTT \
provides a lightweight method of carrying out messaging using a \
publish/subscribe model. "
HOMEPAGE = "http://mosquitto.org/"
SECTION = "console/network"
LICENSE = "EPL-2.0 | EDL-1.0"
LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=ca9a8f366c6babf593e374d0d7d58749 \
file://edl-v10;md5=9f6accb1afcb570f8be65039e2fcd49e \
file://epl-v20;md5=2dd765ca47a05140be15ebafddbeadfe \
file://NOTICE.md;md5=a7a91b4754c6f7995020d1b49bc829c6 \
"
DEPENDS = "uthash cjson"
SRC_URI = "http://mosquitto.org/files/source/mosquitto-${PV}.tar.gz \
file://mosquitto.init \
file://2895.patch \
"
SRC_URI[sha256sum] = "ebd07d89d2a446a7f74100ad51272e4a8bf300b61634a7812e19f068f2759de8"
inherit systemd update-rc.d useradd cmake pkgconfig
PACKAGECONFIG ??= "ssl websockets \
${@bb.utils.filter('DISTRO_FEATURES','systemd', d)} \
"
PACKAGECONFIG[manpages] = "-DDOCUMENTATION=ON,-DDOCUMENTATION=OFF,libxslt-native docbook-xsl-stylesheets-native"
PACKAGECONFIG[dns-srv] = "-DWITH_SRV=ON,-DWITH_SRV=OFF,c-ares"
PACKAGECONFIG[ssl] = "-DWITH_TLS=ON -DWITH_TLS_PSK=ON -DWITH_EC=ON,-DWITH_TLS=OFF -DWITH_TLS_PSK=OFF -DWITH_EC=OFF,openssl"
PACKAGECONFIG[systemd] = "-DWITH_SYSTEMD=ON,-DWITH_SYSTEMD=OFF,systemd"
PACKAGECONFIG[websockets] = "-DWITH_WEBSOCKETS=ON,-DWITH_WEBSOCKETS=OFF,libwebsockets"
PACKAGECONFIG[dlt] = "-DWITH_DLT=ON,-DWITH_DLT=OFF,dlt-daemon"
EXTRA_OECMAKE = " \
-DWITH_BUNDLED_DEPS=OFF \
-DWITH_ADNS=ON \
"
do_install:append() {
install -d ${D}${systemd_unitdir}/system/
install -m 0644 ${S}/service/systemd/mosquitto.service.notify ${D}${systemd_unitdir}/system/mosquitto.service
install -d ${D}${sysconfdir}/init.d/
install -m 0755 ${WORKDIR}/mosquitto.init ${D}${sysconfdir}/init.d/mosquitto
sed -i -e 's,@SBINDIR@,${sbindir},g' \
-e 's,@BASE_SBINDIR@,${base_sbindir},g' \
-e 's,@LOCALSTATEDIR@,${localstatedir},g' \
-e 's,@SYSCONFDIR@,${sysconfdir},g' \
${D}${sysconfdir}/init.d/mosquitto
}
PACKAGES += "libmosquitto1 libmosquittopp1 ${PN}-clients"
PACKAGE_BEFORE_PN = "${PN}-examples"
FILES:${PN} = "${sbindir}/mosquitto \
${bindir}/mosquitto_passwd \
${bindir}/mosquitto_ctrl \
${libdir}/mosquitto_dynamic_security.so \
${sysconfdir}/mosquitto \
${sysconfdir}/init.d \
${systemd_unitdir}/system/mosquitto.service \
"
CONFFILES:${PN} += "${sysconfdir}/mosquitto/mosquitto.conf"
FILES:libmosquitto1 = "${libdir}/libmosquitto.so.*"
FILES:libmosquittopp1 = "${libdir}/libmosquittopp.so.*"
FILES:${PN}-clients = "${bindir}/mosquitto_pub \
${bindir}/mosquitto_sub \
${bindir}/mosquitto_rr \
"
FILES:${PN}-examples = "${sysconfdir}/mosquitto/*.example"
SYSTEMD_SERVICE:${PN} = "mosquitto.service"
INITSCRIPT_NAME = "mosquitto"
INITSCRIPT_PARAMS = "defaults 30"
USERADD_PACKAGES = "${PN}"
USERADD_PARAM:${PN} = "--system --no-create-home --shell /bin/false \
--user-group mosquitto"
BBCLASSEXTEND = "native"

View File

@@ -0,0 +1,28 @@
SUMMARY = "nanomsg socket library"
DESCRIPTION = "nanomsg is a socket library that provides several common \
communication patterns. It aims to make the networking layer fast, scalable, \
and easy to use. Implemented in C, it works on a wide range of operating \
systems with no further dependencies."
HOMEPAGE = "https://nanomsg.org/"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://COPYING;md5=587b3fd7fd291e418ff4d2b8f3904755"
SECTION = "libs/networking"
SRC_URI = "git://github.com/nanomsg/nanomsg.git;protocol=https;branch=master"
SRCREV = "fc3f684a80151a3319446fc96083a9ff384ee4fe"
S = "${WORKDIR}/git"
inherit cmake pkgconfig
# nanomsg documentation generation requires asciidoctor,
# not asciidoc, and currently there's no asciidoctor-native
# recipe anywhere in openembedded-core or meta-openembedded
EXTRA_OECMAKE = " -DNN_ENABLE_DOC=OFF "
# we don't want nanomsg-tools to be renamed to libnanomsg-tools
DEBIAN_NOAUTONAME:${PN}-tools = "1"
PACKAGES =+ "${PN}-tools"
FILES:${PN}-tools = "${bindir}/*"

View File

@@ -0,0 +1,22 @@
SUMMARY = "nanomsg-next-generation -- light-weight brokerless messaging"
DESCRIPTION = "NNG, like its predecessors nanomsg (and to some extent ZeroMQ), is a lightweight, broker-less library, offering a simple API to solve common recurring messaging problems, such as publish/subscribe, RPC-style request/reply, or service discovery."
HOMEPAGE = "https://github.com/nanomsg/nng"
SECTION = "libs/networking"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=a41e579bb4326c21c774f8e51e41d8a3"
SRC_URI = "git://github.com/nanomsg/nng.git;branch=master;protocol=https"
SRCREV = "85fbe7f9e4642b554d0d97f2e3ff2aa12978691a"
S = "${WORKDIR}/git"
inherit cmake pkgconfig
EXTRA_OECMAKE = "-DBUILD_SHARED_LIBS=ON -DNNG_ENABLE_NNGCAT=ON"
PACKAGECONFIG ??= ""
PACKAGECONFIG[mbedtls] = "-DNNG_ENABLE_TLS=ON,-DNNG_ENABLE_TLS=OFF,mbedtls"
PACKAGES =+ "${PN}-tools"
FILES:${PN}-tools = "${bindir}/*"

View File

@@ -0,0 +1,14 @@
DESCRIPTION = "C++ wrapper around the nanomsg NNG API"
HOMEPAGE = "https://github.com/cwzx/nngpp"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://license.txt;md5=6d17d78c3597e0d4452fb1c63bf7c58e"
DEPENDS = "nng"
SRCREV = "cc5d2641babab165d8a9943817c46d36c6dc17c2"
PV = "1.3.0"
SRC_URI = "git://github.com/cwzx/nngpp;branch=master;protocol=https"
S = "${WORKDIR}/git"
inherit cmake

View File

@@ -0,0 +1,306 @@
From 084ef529c5fb816927ca54866f66b340265aa9f6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Eivind=20N=C3=A6ss?= <eivnaes@yahoo.com>
Date: Sat, 4 Mar 2023 21:20:43 +0000
Subject: [PATCH] Adding support for compiling against pppd-2.5.0 (or master
branch)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Upstream-Status: Backport
Signed-off-by: Eivind Næss <eivnaes@yahoo.com>
---
Makefile.am | 5 +-
configure.ac | 37 +++++++-
src/nm-fortisslvpn-pppd-compat.h | 93 +++++++++++++++++++
src/nm-fortisslvpn-pppd-plugin.c | 24 ++---
...-status.h => nm-fortisslvpn-pppd-status.h} | 0
src/nm-fortisslvpn-service.c | 2 +-
6 files changed, 145 insertions(+), 16 deletions(-)
create mode 100644 src/nm-fortisslvpn-pppd-compat.h
rename src/{nm-ppp-status.h => nm-fortisslvpn-pppd-status.h} (100%)
diff --git a/Makefile.am b/Makefile.am
index b2e5533..e1e5ec9 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -81,7 +81,7 @@ libexec_PROGRAMS += src/nm-fortisslvpn-service
src_nm_fortisslvpn_service_SOURCES = \
shared/nm-utils/nm-shared-utils.c \
shared/nm-utils/nm-shared-utils.h \
- src/nm-ppp-status.h \
+ src/nm-fortisslvpn-pppd-status.h \
src/nm-fortisslvpn-service.h \
src/nm-fortisslvpn-service.c \
shared/nm-fortissl-properties.c \
@@ -106,7 +106,8 @@ src_nm_fortisslvpn_pppd_plugin_la_SOURCES = \
shared/nm-utils/nm-shared-utils.c \
shared/nm-utils/nm-shared-utils.h \
src/nm-fortisslvpn-pppd-plugin.c \
- src/nm-ppp-status.h
+ src/nm-fortisslvpn-pppd-compat.h \
+ src/nm-fortisslvpn-pppd-status.h
nodist_src_nm_fortisslvpn_pppd_plugin_la_SOURCES = \
src/nm-fortisslvpn-pppd-service-dbus.h
src_nm_fortisslvpn_pppd_plugin_la_CPPFLAGS = $(src_cppflags)
diff --git a/configure.ac b/configure.ac
index a998707..877493e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -19,7 +19,10 @@ AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_INSTALL
AC_PROG_LIBTOOL
+AC_PROG_CPP
+AC_PROG_EGREP
AC_PATH_PROG(GLIB_COMPILE_RESOURCES, glib-compile-resources)
+PKG_PROG_PKG_CONFIG()
AC_GNU_SOURCE
@@ -37,20 +40,50 @@ dnl
dnl Required headers
dnl
AC_HEADER_STDC
-AC_CHECK_HEADERS(fcntl.h paths.h sys/ioctl.h sys/time.h syslog.h unistd.h)
+AC_CHECK_HEADERS(fcntl.h paths.h stdarg.h stdbool.h sys/ioctl.h sys/time.h syslog.h unistd.h)
AC_CHECK_HEADERS(pppd/pppd.h,,
AC_MSG_ERROR(couldn't find pppd.h. pppd development headers are required.))
+dnl
+dnl Check the presense of other pppd/*.h files
+AC_CHECK_HEADERS([
+ pppd/chap.h
+ pppd/chap-new.h
+ pppd/chap_ms.h
+ ])
+
+dnl
+dnl Versions >= 2.5.0 will have pkg-config support
+PKG_CHECK_EXISTS([pppd],
+ [AS_VAR_SET([pppd_pkgconfig_support],[yes])])
+
+dnl
+dnl Get the version of pppd using pkg-config, assume 2.4.9 if not present
+PPPD_VERSION=2.4.5
+if test x"$pppd_pkgconfig_support" = xyes; then
+ PPPD_VERSION=`$PKG_CONFIG --modversion pppd`
+fi
+
+
AC_ARG_WITH([pppd-plugin-dir], AS_HELP_STRING([--with-pppd-plugin-dir=DIR], [path to the pppd plugins directory]))
if test -n "$with_pppd_plugin_dir" ; then
PPPD_PLUGIN_DIR="$with_pppd_plugin_dir"
else
- PPPD_PLUGIN_DIR="${libdir}/pppd/2.4.5"
+ PPPD_PLUGIN_DIR="${libdir}/pppd/$PPPD_VERSION"
fi
AC_SUBST(PPPD_PLUGIN_DIR)
+dnl The version of pppd dictates what code can be included, i.e. enable use of
+dnl #if WITH_PPP_VERSION >= PPP_VERSION(2,5,0) in the code
+AC_DEFINE_UNQUOTED([PPP_VERSION(x,y,z)],
+ [((x & 0xFF) << 16 | (y & 0xFF) << 8 | (z & 0xFF) << 0)],
+ [Macro to help determine the particular version of pppd])
+PPP_VERSION=$(echo $PPPD_VERSION | sed -e "s/\./\,/g")
+AC_DEFINE_UNQUOTED(WITH_PPP_VERSION, PPP_VERSION($PPP_VERSION),
+ [The real version of pppd represented as an int])
+
dnl
dnl Checks for typedefs, structures, and compiler characteristics.
dnl
diff --git a/src/nm-fortisslvpn-pppd-compat.h b/src/nm-fortisslvpn-pppd-compat.h
new file mode 100644
index 0000000..9a02908
--- /dev/null
+++ b/src/nm-fortisslvpn-pppd-compat.h
@@ -0,0 +1,93 @@
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
+/* nm-sstp-service - sstp (and other pppd) integration with NetworkManager
+ *
+ * Copyright (C) Eivind Næss, eivnaes@yahoo.com
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ */
+
+#ifndef __NM_FORTISSLVPN_PPPD_COMPAT_H__
+#define __NM_FORTISSLVPN_PPPD_COMPAT_H__
+
+#define INET6 1
+
+// PPP < 2.5.0 defines and exports VERSION which overlaps with current package VERSION define.
+// this silly macro magic is to work around that.
+
+#undef VERSION
+#include <pppd/pppd.h>
+
+#ifndef PPPD_VERSION
+#define PPPD_VERSION VERSION
+#endif
+
+#include <pppd/fsm.h>
+#include <pppd/ccp.h>
+#include <pppd/eui64.h>
+#include <pppd/ipcp.h>
+#include <pppd/ipv6cp.h>
+#include <pppd/eap.h>
+#include <pppd/upap.h>
+
+#ifdef HAVE_PPPD_CHAP_H
+ #include <pppd/chap.h>
+#endif
+
+#ifdef HAVE_PPPD_CHAP_NEW_H
+ #include <pppd/chap-new.h>
+#endif
+
+#ifdef HAVE_PPPD_CHAP_MS_H
+ #include <pppd/chap_ms.h>
+#endif
+
+#ifndef PPP_PROTO_CHAP
+#define PPP_PROTO_CHAP 0xc223
+#endif
+
+#ifndef PPP_PROTO_EAP
+#define PPP_PROTO_EAP 0xc227
+#endif
+
+#if WITH_PPP_VERSION < PPP_VERSION(2,5,0)
+
+static inline bool debug_on(void)
+{
+ return debug;
+}
+
+static inline const char *ppp_ipparam(void)
+{
+ return ipparam;
+}
+
+static inline int ppp_ifunit(void)
+{
+ return ifunit;
+}
+
+static inline const char *ppp_ifname(void)
+{
+ return ifname;
+}
+
+static inline int ppp_get_mtu(int idx)
+{
+ return netif_get_mtu(idx);
+}
+
+#endif // #if WITH_PPP_VERSION < PPP_VERSION(2,5,0)
+#endif // #ifdef __NM_FORTISSLVPN_PPPD_COMPAT_H__
diff --git a/src/nm-fortisslvpn-pppd-plugin.c b/src/nm-fortisslvpn-pppd-plugin.c
index f2ad262..c2efb9a 100644
--- a/src/nm-fortisslvpn-pppd-plugin.c
+++ b/src/nm-fortisslvpn-pppd-plugin.c
@@ -23,12 +23,6 @@
#define ___CONFIG_H__
#include <config.h>
-#include <pppd/pppd.h>
-#include <pppd/fsm.h>
-#include <pppd/ipcp.h>
-
-#include "nm-default.h"
-
#include <sys/types.h>
#include <string.h>
#include <sys/socket.h>
@@ -42,10 +36,12 @@
#include <grp.h>
#include <glib/gstdio.h>
+#include "nm-fortisslvpn-pppd-status.h"
+#include "nm-fortisslvpn-pppd-compat.h"
#include "nm-fortisslvpn-pppd-service-dbus.h"
-#include "nm-fortisslvpn-service.h"
-#include "nm-ppp-status.h"
+#include "nm-default.h"
+#include "nm-fortisslvpn-service.h"
#include "nm-utils/nm-shared-utils.h"
#include "nm-utils/nm-vpn-plugin-macros.h"
@@ -80,7 +76,7 @@ static struct {
int plugin_init (void);
-char pppd_version[] = VERSION;
+char pppd_version[] = PPPD_VERSION;
static void
chroot_sandbox (void)
@@ -296,7 +292,7 @@ get_ip4_routes (in_addr_t ouraddr)
static void
nm_ip_up (void *data, int arg)
{
- guint32 pppd_made_up_address = htonl (0x0a404040 + ifunit);
+ guint32 pppd_made_up_address = htonl (0x0a404040 + ppp_ifunit());
ipcp_options opts = ipcp_gotoptions[0];
ipcp_options peer_opts = ipcp_hisoptions[0];
GVariantBuilder builder;
@@ -317,7 +313,7 @@ nm_ip_up (void *data, int arg)
g_variant_builder_add (&builder, "{sv}",
NM_VPN_PLUGIN_IP4_CONFIG_TUNDEV,
- g_variant_new_string (ifname));
+ g_variant_new_string (ppp_ifname()));
str = g_getenv ("VPN_GATEWAY");
if (str) {
@@ -442,8 +438,14 @@ plugin_init (void)
return -1;
}
+#if WITH_PPP_VERSION < PPP_VERSION(2,5,0)
add_notifier (&phasechange, nm_phasechange, NULL);
add_notifier (&ip_up_notifier, nm_ip_up, NULL);
add_notifier (&exitnotify, nm_exit_notify, NULL);
+#else
+ ppp_add_notify (NF_PHASE_CHANGE, nm_phasechange, NULL);
+ ppp_add_notify (NF_IP_UP, nm_ip_up, NULL);
+ ppp_add_notify (NF_EXIT, nm_exit_notify, NULL);
+#endif
return 0;
}
diff --git a/src/nm-ppp-status.h b/src/nm-fortisslvpn-pppd-status.h
similarity index 100%
rename from src/nm-ppp-status.h
rename to src/nm-fortisslvpn-pppd-status.h
diff --git a/src/nm-fortisslvpn-service.c b/src/nm-fortisslvpn-service.c
index 6c340d0..a8483c2 100644
--- a/src/nm-fortisslvpn-service.c
+++ b/src/nm-fortisslvpn-service.c
@@ -40,7 +40,7 @@
#include <glib/gstdio.h>
#include "nm-fortissl-properties.h"
-#include "nm-ppp-status.h"
+#include "nm-fortisslvpn-pppd-status.h"
#include "nm-fortisslvpn-pppd-service-dbus.h"
#include "nm-utils/nm-shared-utils.h"
#include "nm-utils/nm-vpn-plugin-macros.h"
--
GitLab

View File

@@ -0,0 +1,34 @@
From 8773f772d39f8eee6edc1fd2e5437c754ed41e1e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Eivind=20N=C3=A6ss?= <eivnaes@yahoo.com>
Date: Sat, 4 Mar 2023 21:29:54 +0000
Subject: [PATCH] Fixing configure.ac from previous change
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Upstream-Status: Backport
Signed-off-by: Eivind Næss <eivnaes@yahoo.com>
---
configure.ac | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/configure.ac b/configure.ac
index 877493e..a5b4abb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -47,11 +47,7 @@ AC_CHECK_HEADERS(pppd/pppd.h,,
dnl
dnl Check the presense of other pppd/*.h files
-AC_CHECK_HEADERS([
- pppd/chap.h
- pppd/chap-new.h
- pppd/chap_ms.h
- ])
+AC_CHECK_HEADERS(pppd/chap.h pppd/chap-new.h pppd/chap_ms.h)
dnl
dnl Versions >= 2.5.0 will have pkg-config support
--
GitLab

View File

@@ -0,0 +1,71 @@
SUMMARY = "Fortinet SSLVPN support for NetworkManager"
SECTION = "net/misc"
LICENSE = "GPL-2.0-or-later"
LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552"
DEPENDS = "glib-2.0-native libxml2-native networkmanager ppp python3-packaging-native"
GNOMEBASEBUILDCLASS = "autotools"
inherit gnomebase gettext useradd python3native
SRC_URI = " \
${GNOME_MIRROR}/NetworkManager-fortisslvpn/${@gnome_verdir("${PV}")}/NetworkManager-fortisslvpn-${PV}.tar.xz \
file://0001-fix-ppp-2.5.0-build.patch \
file://0002-fix-ppp-2.5.0-build.patch \
"
SRC_URI[sha256sum] = "b055e26349b516b23585798ab3ef57b436b014800e92a8ac732cfc8e76c5dafa"
S = "${WORKDIR}/NetworkManager-fortisslvpn-${PV}"
# meta-gnome in layers is required using gnome:
PACKAGECONFIG[gnome] = "--with-gnome,--without-gnome,gtk+3 libnma libsecret,"
PACKAGECONFIG[gtk4] = "--with-gtk4,--without-gtk4,gtk4,"
EXTRA_OECONF = "--with-pppd-plugin-dir=${libdir}/pppd/${@get_ppp_version(d)}"
def get_ppp_version(d):
import re
pppd_plugin = d.expand('${STAGING_LIBDIR}/pppd')
if not os.path.isdir(pppd_plugin):
return None
bb.debug(1, "pppd plugin dir %s" % pppd_plugin)
r = re.compile(r"\d*\.\d*\.\d*")
for f in os.listdir(pppd_plugin):
if os.path.isdir(os.path.join(pppd_plugin, f)):
ma = r.match(f)
if ma:
bb.debug(1, "pppd version dir %s" % f)
return f
else:
bb.debug(1, "under pppd plugin dir %s" % f)
return None
# gdbus-codegen requires target directories to exist
do_configure:append() {
mkdir -p ${B}/properties
mkdir -p ${B}/src
}
USERADD_PACKAGES = "${PN}"
USERADD_PARAM:${PN} = "--system nm-fortisslvpn"
FILES:${PN} += " \
${libdir}/NetworkManager/*.so \
${libdir}/pppd/*/*.so \
${nonarch_libdir}/NetworkManager/VPN/nm-fortisslvpn-service.name \
"
FILES:${PN}-staticdev += " \
${libdir}/NetworkManager/*.a \
${libdir}/pppd/*/*.a \
"
RDEPENDS:${PN} = " \
networkmanager \
openfortivpn \
ppp \
"

View File

@@ -0,0 +1,47 @@
SUMMARY = "OpenConnect VPN client for NetworkManager"
SECTION = "net/misc"
LICENSE = "GPL-2.0-or-later"
LIC_FILES_CHKSUM = "file://COPYING;md5=186e8b54342da4f753a62b7748c947db"
DEPENDS = "glib-2.0-native intltool-native libxml2 networkmanager openconnect"
GNOMEBASEBUILDCLASS = "autotools"
inherit gnomebase useradd
SRC_URI = "${GNOME_MIRROR}/NetworkManager-openconnect/${@gnome_verdir("${PV}")}/NetworkManager-openconnect-${PV}.tar.xz"
SRC_URI[sha256sum] = "5dedaa785d82d8e239ddd082bfac5250c691e964464be1807b6827263633cdcc"
S = "${WORKDIR}/NetworkManager-openconnect-${PV}"
# meta-gnome in layers is required using gnome:
PACKAGECONFIG[gnome] = "--with-gnome,--without-gnome,gtk+3 gcr3 libnma libsecret,"
PACKAGECONFIG[gtk4] = "--with-gtk4,--without-gtk4,gtk4,"
do_configure:append() {
# network-manager-openconnect.metainfo.xml is created in source folder but
# compile expects it in build folder. As long as nobody comes up with a
# better solution just support build:
if [ -e ${S}/appdata/network-manager-openconnect.metainfo.xml ]; then
mkdir -p ${B}/appdata
cp -f ${S}/appdata/network-manager-openconnect.metainfo.xml ${B}/appdata/
fi
}
USERADD_PACKAGES = "${PN}"
USERADD_PARAM:${PN} = "--system nm-openconnect"
FILES:${PN} += " \
${libdir}/NetworkManager/*.so \
${nonarch_libdir}/NetworkManager/VPN/nm-openconnect-service.name \
"
FILES:${PN}-staticdev += " \
${libdir}/NetworkManager/*.a \
"
RDEPENDS:${PN} = " \
networkmanager \
openconnect \
"

View File

@@ -0,0 +1,30 @@
From e09ba80e342b3b24bb2a46e11dae1c30cc61c75c Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sun, 3 Sep 2023 08:48:42 -0700
Subject: [PATCH] linker-script: Do not export _IO_stdin_used
This is glibc specific toolhain issue, it should have been handled in
toolchain instead of exposing to applications. This was done to fix
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=835550
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
linker-script-binary.ver | 1 -
1 file changed, 1 deletion(-)
diff --git a/linker-script-binary.ver b/linker-script-binary.ver
index a2780c0..f030d35 100644
--- a/linker-script-binary.ver
+++ b/linker-script-binary.ver
@@ -1,6 +1,5 @@
{
global:
- _IO_stdin_used;
local:
*;
};
--
2.42.0

View File

@@ -0,0 +1,55 @@
SUMMARY = "NetworkManager-openvpn-plugin"
SECTION = "net/misc"
LICENSE = "GPL-2.0-or-later"
LIC_FILES_CHKSUM = "file://COPYING;md5=100d5a599bead70ddcd70dcd73f2e29c"
DEPENDS = "dbus dbus-glib networkmanager openvpn intltool-native glib-2.0-native"
GNOMEBASEBUILDCLASS = "autotools"
inherit gnomebase useradd gettext systemd
SRC_URI = "${GNOME_MIRROR}/NetworkManager-openvpn/${@gnome_verdir("${PV}")}/NetworkManager-openvpn-${PV}.tar.xz"
SRC_URI:append:libc-musl = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' file://0001-linker-scripts-Do-not-export-_IO_stdin_used.patch', '', d)}"
SRC_URI[sha256sum] = "62f0f2a8782221b923f212ac2a8ebbc1002efd6a90ee945dad4adfb56d076d21"
S = "${WORKDIR}/NetworkManager-openvpn-${PV}"
# meta-gnome in layers is required using gnome:
PACKAGECONFIG[gnome] = "--with-gnome,--without-gnome,gtk+3 libnma libsecret"
do_configure:append() {
# network-manager-openvpn.metainfo.xml is created in source folder but
# compile expects it in build folder. As long as nobody comes up with a
# better solution just support build:
if [ -e ${S}/appdata/network-manager-openvpn.metainfo.xml ]; then
mkdir -p ${B}/appdata
cp -f ${S}/appdata/network-manager-openvpn.metainfo.xml ${B}/appdata/
fi
}
do_install:append () {
rm -rf ${D}${libdir}/NetworkManager/*.la
}
# Create user and group nm-openvpn that are needed since version 1.0.6
USERADD_PACKAGES = "${PN}"
USERADD_PARAM:${PN} = "--system nm-openvpn"
FILES:${PN} += " \
${datadir}/dbus-1 \
${datadir}/metainfo \
${libdir}/NetworkManager/*.so \
${nonarch_libdir}/NetworkManager/VPN/nm-openvpn-service.name \
"
FILES:${PN}-staticdev += " \
${libdir}/NetworkManager/*.a \
"
RDEPENDS:${PN} = " \
networkmanager \
openvpn \
"

View File

@@ -0,0 +1,41 @@
From 3ee6967689b3da30cc4551885d8bcdd44a7a9b52 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Thu, 31 Aug 2023 21:16:55 -0700
Subject: [PATCH] linker-scripts: Do not export _IO_stdin_used
This is glibc specific and it is not needed with musl.
See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=835550
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
linker-script-binary.ver | 1 -
tools/create-exports-NetworkManager.sh | 1 -
2 files changed, 2 deletions(-)
diff --git a/linker-script-binary.ver b/linker-script-binary.ver
index a2780c0..f030d35 100644
--- a/linker-script-binary.ver
+++ b/linker-script-binary.ver
@@ -1,6 +1,5 @@
{
global:
- _IO_stdin_used;
local:
*;
};
diff --git a/tools/create-exports-NetworkManager.sh b/tools/create-exports-NetworkManager.sh
index ef4b381..60865ad 100755
--- a/tools/create-exports-NetworkManager.sh
+++ b/tools/create-exports-NetworkManager.sh
@@ -54,7 +54,6 @@ get_symbols_nm () {
get_symbols_explicit() {
cat <<EOF | _sort
-_IO_stdin_used
EOF
}
--
2.42.0

View File

@@ -0,0 +1,3 @@
[device]
wifi.iwd.autoconnect=yes
wifi.backend=iwd

View File

@@ -0,0 +1,110 @@
#! /bin/sh
### BEGIN INIT INFO
# Provides: network-manager
# Required-Start: $remote_fs dbus udev
# Required-Stop: $remote_fs dbus udev
# Should-Start: $syslog
# Should-Stop: $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: network connection manager
# Description: Daemon for automatically switching network
# connections to the best available connection.
### END INIT INFO
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DESC="network connection manager"
NAME="NetworkManager"
DAEMON=/usr/sbin/$NAME
PIDFILE=/run/$NAME/$NAME.pid
SCRIPTNAME=/etc/init.d/network-manager
. /etc/init.d/functions || exit 1
# Exit if the package is not installed
[ -x "$DAEMON" ] || exit 0
log_daemon_msg() {
echo -n $*
}
log_end_msg() {
if [ $1 -eq 0 ]; then
success
else
failure
fi
echo
}
log_progress_msg () {
if [ -z "${1:-}" ]; then
return 1
fi
echo -n " $@"
}
#
# Function that starts the daemon/service.
#
d_start() {
start-stop-daemon --start --quiet --pidfile $PIDFILE \
--exec $DAEMON -- $DAEMON_OPTS
}
#
# Function that stops the daemon/service.
#
d_stop() {
start-stop-daemon --stop --retry 5 --quiet --pidfile $PIDFILE \
--exec $DAEMON
}
d_reload() {
start-stop-daemon --stop --signal HUP --quiet --pidfile $PIDFILE \
--exec $DAEMON
}
case "$1" in
start)
log_daemon_msg "Starting $DESC" "$NAME"
d_start
case "$?" in
0) log_end_msg 0 ;;
1) log_progress_msg "already started"
log_end_msg 0 ;;
*) log_end_msg 1 ;;
esac
;;
stop)
log_daemon_msg "Stopping $DESC" "$NAME"
d_stop
case "$?" in
0) log_end_msg 0 ;;
1) log_progress_msg "already stopped"
log_end_msg 0 ;;
*) log_end_msg 1 ;;
esac
;;
reload|force-reload)
log_daemon_msg "Reloading $DESC" "$NAME"
d_reload
log_end_msg $?
;;
restart)
$0 stop
$0 start
;;
status)
status_of_proc -p $PIDFILE $DAEMON $NAME && exit 0 || exit $?
;;
*)
echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload|status}" >&2
exit 1
;;
esac
exit 0

View File

@@ -0,0 +1,323 @@
SUMMARY = "NetworkManager is a program for providing detection and \
configuration for systems to automatically connect to networks."
DESCRIPTION = "NetworkManager is a program for providing detection and \
configuration for systems to automatically connect to networks. \
NetworkManager's functionality can be useful for both wireless and wired \
networks. For wireless networks, NetworkManager prefers known wireless \
networks and has the ability to switch to the most reliable network. \
NetworkManager-aware applications can switch from online and offline mode. \
NetworkManager also prefers wired connections over wireless ones, has support \
for modem connections and certain types of VPN."
HOMEPAGE = "https://wiki.gnome.org/Projects/NetworkManager"
SECTION = "net/misc"
LICENSE = "GPL-2.0-or-later & LGPL-2.1-or-later"
LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
file://COPYING.LGPL;md5=4fbd65380cdd255951079008b364516c \
"
DEPENDS = " \
python3-pygobject-native \
coreutils-native \
intltool-native \
libxslt-native \
libnl \
udev \
util-linux \
libndp \
curl \
dbus \
"
DEPENDS:append:class-target = " bash-completion"
inherit gnomebase gettext update-rc.d systemd gobject-introspection gtk-doc update-alternatives upstream-version-is-even
SRC_URI = " \
${GNOME_MIRROR}/NetworkManager/${@gnome_verdir("${PV}")}/NetworkManager-${PV}.tar.xz \
file://${BPN}.initd \
file://enable-dhcpcd.conf \
file://enable-iwd.conf \
"
SRC_URI:append:libc-musl = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' file://0001-linker-scripts-Do-not-export-_IO_stdin_used.patch', '', d)}"
SRC_URI[sha256sum] = "722649e25362693b334371473802a729b0ec9ee283375096905f868808e74068"
S = "${WORKDIR}/NetworkManager-${PV}"
# ['auto', 'symlink', 'file', 'netconfig', 'resolvconf']
NETWORKMANAGER_DNS_RC_MANAGER_DEFAULT ??= "auto"
# ['dhcpcanon', 'dhclient', 'dhcpcd', 'internal', 'nettools']
NETWORKMANAGER_DHCP_DEFAULT ??= "internal"
# The default gets detected based on whether /usr/sbin/nft or /usr/sbin/iptables is installed, with nftables preferred.
# ['', 'iptables', 'nftables']
NETWORKMANAGER_FIREWALL_DEFAULT ??= "nftables"
EXTRA_OEMESON = "\
-Difcfg_rh=false \
-Dtests=yes \
-Dnmtui=true \
-Dudev_dir=${nonarch_base_libdir}/udev \
-Dlibpsl=false \
-Dqt=false \
-Dconfig_dns_rc_manager_default=${NETWORKMANAGER_DNS_RC_MANAGER_DEFAULT} \
-Dconfig_dhcp_default=${NETWORKMANAGER_DHCP_DEFAULT} \
-Ddhcpcanon=false \
-Diptables=${sbindir}/iptables \
-Dnft=${sbindir}/nft \
"
# stolen from https://github.com/void-linux/void-packages/blob/master/srcpkgs/NetworkManager/template
# avoids:
# | ../NetworkManager-1.16.0/libnm-core/nm-json.c:106:50: error: 'RTLD_DEEPBIND' undeclared (first use in this function); did you mean 'RTLD_DEFAULT'?
CFLAGS:append:libc-musl = " \
-DRTLD_DEEPBIND=0 \
"
do_configure:prepend() {
cp -f ${STAGING_LIBDIR}/girepository-1.0/GObject*typelib ${STAGING_LIBDIR_NATIVE}/girepository-1.0/
cp -f ${STAGING_LIBDIR}/girepository-1.0/Gio*typelib ${STAGING_LIBDIR_NATIVE}/girepository-1.0/
cp -f ${STAGING_LIBDIR}/girepository-1.0/GModule*typelib ${STAGING_LIBDIR_NATIVE}/girepository-1.0/
}
PACKAGECONFIG ??= "readline nss ifupdown dnsmasq nmcli vala \
${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', bb.utils.contains('DISTRO_FEATURES', 'x11', 'consolekit', '', d), d)} \
${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez5', '', d)} \
${@bb.utils.filter('DISTRO_FEATURES', 'wifi polkit ppp', d)} \
${@bb.utils.contains('DISTRO_FEATURES', 'selinux', 'selinux audit', '', d)} \
"
inherit ${@bb.utils.contains('PACKAGECONFIG', 'vala', 'vala', '', d)}
PACKAGECONFIG[systemd] = "\
-Dsystemdsystemunitdir=${systemd_unitdir}/system -Dsession_tracking=systemd,\
-Dsystemdsystemunitdir=no -Dsystemd_journal=false -Dsession_tracking=no\
"
PACKAGECONFIG[polkit] = "-Dpolkit=true,-Dpolkit=false,polkit"
PACKAGECONFIG[bluez5] = "-Dbluez5_dun=true,-Dbluez5_dun=false,bluez5"
# consolekit is not picked by shlibs, so add it to RDEPENDS too
PACKAGECONFIG[consolekit] = "-Dsession_tracking_consolekit=true,-Dsession_tracking_consolekit=false,consolekit,consolekit"
PACKAGECONFIG[modemmanager] = "-Dmodem_manager=true,-Dmodem_manager=false,modemmanager mobile-broadband-provider-info"
PACKAGECONFIG[ppp] = "-Dppp=true -Dpppd=${sbindir}/pppd,-Dppp=false,ppp"
PACKAGECONFIG[dnsmasq] = "-Ddnsmasq=${bindir}/dnsmasq"
PACKAGECONFIG[nss] = "-Dcrypto=nss,,nss"
PACKAGECONFIG[resolvconf] = "-Dresolvconf=${base_sbindir}/resolvconf,-Dresolvconf=no,,resolvconf"
PACKAGECONFIG[gnutls] = "-Dcrypto=gnutls,,gnutls"
PACKAGECONFIG[crypto-null] = "-Dcrypto=null"
PACKAGECONFIG[wifi] = "-Dwext=true -Dwifi=true,-Dwext=false -Dwifi=false"
PACKAGECONFIG[iwd] = "-Diwd=true,-Diwd=false"
PACKAGECONFIG[ifupdown] = "-Difupdown=true,-Difupdown=false"
PACKAGECONFIG[cloud-setup] = "-Dnm_cloud_setup=true,-Dnm_cloud_setup=false"
PACKAGECONFIG[nmcli] = "-Dnmcli=true,-Dnmcli=false"
PACKAGECONFIG[nmtui] = "-Dnmtui=true,-Dnmtui=false,libnewt"
PACKAGECONFIG[readline] = "-Dreadline=libreadline,,readline"
PACKAGECONFIG[libedit] = "-Dreadline=libedit,,libedit"
PACKAGECONFIG[ovs] = "-Dovs=true,-Dovs=false,jansson"
PACKAGECONFIG[audit] = "-Dlibaudit=yes,-Dlibaudit=no"
PACKAGECONFIG[selinux] = "-Dselinux=true,-Dselinux=false,libselinux"
PACKAGECONFIG[vala] = "-Dvapi=true,-Dvapi=false"
PACKAGECONFIG[dhcpcd] = "-Ddhcpcd=${base_sbindir}/dhcpcd,-Ddhcpcd=no,,dhcpcd"
PACKAGECONFIG[dhclient] = "-Ddhclient=yes,-Ddhclient=no,,dhcp"
PACKAGECONFIG[concheck] = "-Dconcheck=true,-Dconcheck=false"
PACKAGECONFIG[adsl] = ",,"
PACKAGECONFIG[wwan] = ",,"
# The following PACKAGECONFIG is used to determine whether NM is managing /etc/resolv.conf itself or not
PACKAGECONFIG[man-resolv-conf] = ",,"
PACKAGES =+ " \
libnm \
${PN}-adsl \
${PN}-bluetooth \
${PN}-cloud-setup \
${PN}-nmcli \
${PN}-nmcli-bash-completion \
${PN}-nmtui \
${PN}-wifi \
${PN}-wwan \
${PN}-ovs \
${PN}-ppp \
${PN}-daemon \
"
SYSTEMD_PACKAGES = "${PN}-daemon ${PN}-cloud-setup"
INITSCRIPT_PACKAGES = "${PN}-daemon"
NETWORKMANAGER_PLUGINDIR = "${libdir}/NetworkManager/${PV}"
NETWORKMANAGER_DISPATCHERDIR = "${nonarch_libdir}/NetworkManager/dispatcher.d"
SUMMARY:libnm = "Libraries for adding NetworkManager support to applications"
FILES:libnm = "\
${libdir}/libnm.so.* \
${libdir}/girepository-1.0/NM-1.0.typelib \
"
SUMMARY:${PN}-adsl = "ADSL device plugin for NetworkManager"
FILES:${PN}-adsl = "${NETWORKMANAGER_PLUGINDIR}/libnm-device-plugin-adsl.so"
RDEPENDS:${PN}-adsl += "${PN}-daemon"
SUMMARY:${PN}-bluetooth = "Bluetooth device plugin for NetworkManager"
FILES:${PN}-bluetooth = "${NETWORKMANAGER_PLUGINDIR}/libnm-device-plugin-bluetooth.so"
RDEPENDS:${PN}-bluetooth += "${PN}-daemon ${@bb.utils.contains('PACKAGECONFIG', 'bluez5', '${PN}-wwan bluez5', '', d)}"
SUMMARY:${PN}-cloud-setup = "Automatically configure NetworkManager in cloud"
FILES:${PN}-cloud-setup = " \
${libexecdir}/nm-cloud-setup \
${systemd_system_unitdir}/nm-cloud-setup.service \
${systemd_system_unitdir}/nm-cloud-setup.timer \
${libdir}/NetworkManager/dispatcher.d/90-nm-cloud-setup.sh \
${libdir}/NetworkManager/dispatcher.d/no-wait.d/90-nm-cloud-setup.sh \
"
RDEPENDS:${PN}-cloud-setup += "${PN}-daemon"
ALLOW_EMPTY:${PN}-cloud-setup = "1"
SYSTEMD_SERVICE:${PN}-cloud-setup = "${@bb.utils.contains('PACKAGECONFIG', 'cloud-setup', 'nm-cloud-setup.service nm-cloud-setup.timer', '', d)}"
SUMMARY:${PN}-nmcli = "NetworkManager command line client"
FILES:${PN}-nmcli = " \
${bindir}/nmcli \
"
RDEPENDS:${PN}-nmcli += "${PN}-daemon"
SUMMARY:${PN}-nmcli-bash-completion = "NetworkManager command line client bash completion"
FILES:${PN}-nmcli-bash-completion = "${datadir}/bash-completion/completions/nmcli"
RDEPENDS:${PN}-nmcli-bash-completion = "bash-completion"
SUMMARY:${PN}-nmtui = "NetworkManager curses-based UI"
FILES:${PN}-nmtui = " \
${bindir}/nmtui \
${bindir}/nmtui-edit \
${bindir}/nmtui-connect \
${bindir}/nmtui-hostname \
"
RDEPENDS:${PN}-nmtui += "${PN}-daemon"
SUMMARY:${PN}-wifi = "Wifi plugin for NetworkManager"
FILES:${PN}-wifi = "\
${NETWORKMANAGER_PLUGINDIR}/libnm-device-plugin-wifi.so \
${libdir}/NetworkManager/conf.d/enable-iwd.conf \
"
def get_wifi_deps(d):
packageconfig = (d.getVar('PACKAGECONFIG') or "").split()
if 'wifi' in packageconfig:
if 'iwd' in packageconfig:
return 'iwd'
else:
return 'wpa-supplicant'
else:
return ''
RDEPENDS:${PN}-wifi += "${PN}-daemon ${@get_wifi_deps(d)}"
SUMMARY:${PN}-wwan = "Mobile broadband device plugin for NetworkManager"
FILES:${PN}-wwan = "\
${NETWORKMANAGER_PLUGINDIR}/libnm-device-plugin-wwan.so \
${NETWORKMANAGER_PLUGINDIR}/libnm-wwan.so \
"
RDEPENDS:${PN}-wwan += "${PN}-daemon ${@bb.utils.contains('PACKAGECONFIG','modemmanager','modemmanager','',d)}"
SUMMARY:${PN}-ovs = "Open vSwitch device plugin for NetworkManager"
FILES:${PN}-ovs = "\
${NETWORKMANAGER_PLUGINDIR}/libnm-device-plugin-ovs.so \
${systemd_system_unitdir}/NetworkManager.service.d/NetworkManager-ovs.conf \
"
RDEPENDS:${PN}-ovs += "${PN}-daemon"
SUMMARY:${PN}-ppp = "PPP plugin for NetworkManager"
FILES:${PN}-ppp = "\
${NETWORKMANAGER_PLUGINDIR}/libnm-ppp-plugin.so \
${libdir}/pppd/*/nm-pppd-plugin.so \
"
RDEPENDS:${PN}-ppp += "${PN}-daemon ${@bb.utils.contains('PACKAGECONFIG','ppp','ppp','',d)}"
FILES:${PN}-dev += " \
${libdir}/pppd/*/*.la \
${libdir}/NetworkManager/*.la \
${NETWORKMANAGER_PLUGINDIR}/*.la \
${datadir}/dbus-1/interfaces/*.xml \
"
SUMMARY:${PN}-daemon += "The NetworkManager daemon"
FILES:${PN}-daemon += " \
${bindir}/nm-online \
${datadir}/dbus-1 \
${datadir}/polkit-1 \
${libdir}/NetworkManager \
${libexecdir} \
${localstatedir}/lib/NetworkManager \
${NETWORKMANAGER_DISPATCHERDIR} \
${nonarch_base_libdir}/udev/* \
${nonarch_libdir}/firewalld \
${nonarch_libdir}/NetworkManager/conf.d \
${nonarch_libdir}/NetworkManager/dispatcher.d/no-wait.d \
${nonarch_libdir}/NetworkManager/dispatcher.d/pre-down.d \
${nonarch_libdir}/NetworkManager/dispatcher.d/pre-up.d \
${nonarch_libdir}/NetworkManager/system-connections \
${nonarch_libdir}/NetworkManager/VPN \
${sbindir}/NetworkManager \
${sysconfdir}/init.d/network-manager \
${sysconfdir}/NetworkManager \
${sysconfdir}/resolv-conf.NetworkManager \
${sysconfdir}/sysconfig/network-scripts \
${systemd_system_unitdir} \
"
RDEPENDS:${PN}-daemon += "\
${@bb.utils.contains('PACKAGECONFIG', 'ifupdown', 'bash', '', d)} \
"
RRECOMMENDS:${PN}-daemon += "\
${NETWORKMANAGER_FIREWALL_DEFAULT} \
${@bb.utils.filter('PACKAGECONFIG', 'dnsmasq', d)} \
"
INITSCRIPT_NAME:${PN}-daemon = "network-manager"
SYSTEMD_SERVICE:${PN}-daemon = "\
NetworkManager.service \
NetworkManager-dispatcher.service \
"
RCONFLICTS:${PN}-daemon += "connman"
ALTERNATIVE_PRIORITY = "100"
ALTERNATIVE:${PN}-daemon = "${@bb.utils.contains('PACKAGECONFIG','man-resolv-conf','resolv-conf','',d)}"
ALTERNATIVE_TARGET[resolv-conf] = "${@bb.utils.contains('PACKAGECONFIG','man-resolv-conf','${sysconfdir}/resolv-conf.NetworkManager','',d)}"
ALTERNATIVE_LINK_NAME[resolv-conf] = "${@bb.utils.contains('PACKAGECONFIG','man-resolv-conf','${sysconfdir}/resolv.conf','',d)}"
# The networkmanager package is an empty meta package which weakly depends on all the compiled features.
# Install this package to get all plugins and related dependencies installed. Alternatively just install
# plugins and related dependencies e.g. by installing networkmanager-wifi or networkmanager-wwan
# packages to the firmware.
ALLOW_EMPTY:${PN} = "1"
RRECOMMENDS:${PN} += "\
${@bb.utils.contains('PACKAGECONFIG','adsl','${PN}-adsl','',d)} \
${@bb.utils.contains('PACKAGECONFIG','bluez5','${PN}-bluetooth','',d)} \
${@bb.utils.contains('PACKAGECONFIG','cloud-setup','${PN}-cloud-setup','',d)} \
${@bb.utils.contains('PACKAGECONFIG','nmcli','${PN}-nmcli','',d)} \
${@bb.utils.contains('PACKAGECONFIG','nmtui','${PN}-nmtui','',d)} \
${@bb.utils.contains('PACKAGECONFIG','wifi','${PN}-wifi','',d)} \
${@bb.utils.contains('PACKAGECONFIG','wwan','${PN}-wwan','',d)} \
${@bb.utils.contains('PACKAGECONFIG','ovs','${PN}-ovs','',d)} \
${@bb.utils.contains('PACKAGECONFIG','ppp','${PN}-ppp','',d)} \
"
do_install:append() {
install -Dm 0755 ${WORKDIR}/${BPN}.initd ${D}${sysconfdir}/init.d/network-manager
rm -rf ${D}/run ${D}${localstatedir}/run
if ${@bb.utils.contains('PACKAGECONFIG','man-resolv-conf','true','false',d)}; then
# For read-only filesystem, do not create links during bootup
ln -sf ../run/NetworkManager/resolv.conf ${D}${sysconfdir}/resolv-conf.NetworkManager
# systemd v210 and newer do not need this rule file
rm ${D}/${nonarch_base_libdir}/udev/rules.d/84-nm-drivers.rules
fi
# Enable iwd if compiled
if ${@bb.utils.contains('PACKAGECONFIG','iwd','true','false',d)}; then
install -Dm 0644 ${WORKDIR}/enable-iwd.conf ${D}${nonarch_libdir}/NetworkManager/conf.d/enable-iwd.conf
fi
# Enable dhcpd if compiled
if ${@bb.utils.contains('PACKAGECONFIG','dhcpcd','true','false',d)}; then
install -Dm 0644 ${WORKDIR}/enable-dhcpcd.conf ${D}${nonarch_libdir}/NetworkManager/conf.d/enable-dhcpcd.conf
fi
}

View File

@@ -0,0 +1,43 @@
From e4ea64134cfe3763332c16dcac52dd894b935880 Mon Sep 17 00:00:00 2001
From: Daniel Lenski <dlenski@gmail.com>
Date: Tue, 22 Aug 2023 12:02:19 -0700
Subject: [PATCH] Shim for renaming of GNUTLS_NO_EXTENSIONS in GnuTLS v3.8.1
The constant `GNUTLS_NO_EXTENSIONS` was renamed in
https://gitlab.com/gnutls/gnutls/-/commit/a7c4a04e (released in v3.8.1), and
then a backwards-compatibility shim was belatedly added in
https://gitlab.com/gnutls/gnutls/-/commit/abfa8634, which has not yet been
released.
We need to re-add the constant ourselves in order to build correctly with
GnuTLS v3.8.1. This should fix
https://gitlab.com/openconnect/openconnect/-/issues/650.
Upstream-Status: Backport [https://git.infradead.org/users/dwmw2/openconnect.git/commit/7512698217c4104aade7a2df669a20de68f3bb8c]
Signed-off-by: Daniel Lenski <dlenski@gmail.com>
---
gnutls-dtls.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/gnutls-dtls.c b/gnutls-dtls.c
index 3fd78e95..50a4bb4e 100644
--- a/gnutls-dtls.c
+++ b/gnutls-dtls.c
@@ -39,6 +39,14 @@
# define GNUTLS_CIPHER_CHACHA20_POLY1305 23
#endif
+#if GNUTLS_VERSION_NUMBER >= 0x030801 && !defined(GNUTLS_NO_EXTENSIONS)
+/* XX: GNUTLS_NO_EXTENSIONS was renamed in GnuTLS v3.8.1. A
+ * backwards-compatibility shim was added in a subsequent commit, but
+ * not yet released.
+ */
+# define GNUTLS_NO_EXTENSIONS GNUTLS_NO_DEFAULT_EXTENSIONS
+#endif
+
/* sets the DTLS MTU and returns the actual tunnel MTU */
unsigned dtls_set_mtu(struct openconnect_info *vpninfo, unsigned mtu)
{
--
2.42.0

View File

@@ -0,0 +1,33 @@
SUMMARY = "Open client for Cisco AnyConnect VPN"
LICENSE = "LGPL-2.1-only"
LIC_FILES_CHKSUM = "file://COPYING.LGPL;md5=4fbd65380cdd255951079008b364516c"
SRC_URI = " \
git://git.infradead.org/users/dwmw2/openconnect.git;branch=master \
file://0001-Shim-for-renaming-of-GNUTLS_NO_EXTENSIONS-in-GnuTLS-.patch \
"
SRCREV = "59f2e59eb3e436364ef82e630e5a2f88f32acd58"
DEPENDS = "vpnc libxml2 krb5 gettext-native"
RDEPENDS:${PN} = "bash python3-core vpnc-script"
PACKAGECONFIG ??= "gnutls lz4 libproxy"
# config defaults
PACKAGECONFIG[gnutls] = "--with-gnutls,--without-gnutls,gnutls,"
PACKAGECONFIG[lz4] = "--with-lz4,--without-lz4,lz4,"
PACKAGECONFIG[libproxy] = "--with-libproxy,--without-libproxy,libproxy,"
# not config defaults
PACKAGECONFIG[pcsc-lite] = "--with-libpcsclite,--without-libpcsclite,pcsc-lite,"
S = "${WORKDIR}/git"
inherit autotools pkgconfig bash-completion
EXTRA_OECONF += "--with-vpnc-script=${sysconfdir}/vpnc/vpnc-script \
--disable-static"
do_install:append() {
rm ${D}/usr/libexec/openconnect/hipreport-android.sh
}

View File

@@ -0,0 +1,26 @@
SUMMARY = "Client for PPP+SSL VPN tunnel services"
LICENSE = "GPL-3.0-or-later"
LIC_FILES_CHKSUM = "file://LICENSE;md5=3d575262a651a6f1a17210ce41bf907d"
SRC_URI = "git://github.com/adrienverge/openfortivpn.git;protocol=https;branch=master"
SRCREV = "82e4401162fc65efad8267f4cb3287c6ab6fc088"
DEPENDS = "openssl"
PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
PACKAGECONFIG[resolvconf] = "--with-resolvconf=${base_sbindir}/resolvconf --enable-resolvconf,--with-resolvconf=DISABLED,,"
PACKAGECONFIG[systemd] = "--with-systemdsystemunitdir=${systemd_system_unitdir},--without-systemdsystemunitdir,,"
S = "${WORKDIR}/git"
inherit autotools pkgconfig systemd
EXTRA_OECONF = " \
--with-pppd=${sbindir}/pppd \
--disable-proc \
"
SYSTEMD_SERVICE:${PN} = "openfortivpn@.service"
RDEPENDS:${PN} = "ppp"

View File

@@ -0,0 +1,35 @@
From aa706d714294b83db696de2beca9a722a512796f Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Tue, 19 Apr 2022 14:04:40 -0700
Subject: [PATCH] cmake: Disable nonnull-compare warning on gcc
GCC finds a legit warning which clang does not on code like this
class Message;
void SendResponse(Message & aMessage)
{
if ((&aMessage) != nullptr) { return; }
}
Perhaps it should be fixed upstream but for now disable treating this
warning as error when using gcc
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
CMakeLists.txt | 4 ++++
1 file changed, 4 insertions(+)
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -59,6 +59,10 @@ endif()
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_EXE_LINKER_FLAGS "-rdynamic ${CMAKE_EXE_LINKER_FLAGS}")
+if (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
+ add_compile_options(-Wno-error=nonnull-compare)
+endif()
+
if (OTBR_COVERAGE AND CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
message(STATUS "Coverage: ON")
target_compile_options(otbr-config INTERFACE -g -O0 --coverage)

View File

@@ -0,0 +1,35 @@
From ed60d4605b81c43b9ba9504a37835109c247c6f8 Mon Sep 17 00:00:00 2001
From: Stefan Schmidt <stefan.schmidt@huawei.com>
Date: Fri, 1 Apr 2022 21:46:03 +0200
Subject: [PATCH] otbr-agent.service.in: remove pre exec hook for mdns service
It uses the service command which is not available in all cases under
Yocto/OE. The upstream project uses this mainly with Ubuntu and Raspian
as testbeds.
In our case we simply ensure that avahi-daemon is installed on the
system inside the recipe.
Upstream-Status: Inappropriate [OE specific]
Signed-off-by: Stefan Schmidt <stefan.schmidt@huawei.com>
---
src/agent/otbr-agent.service.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/agent/otbr-agent.service.in b/src/agent/otbr-agent.service.in
index 8314121347..4c97869def 100644
--- a/src/agent/otbr-agent.service.in
+++ b/src/agent/otbr-agent.service.in
@@ -6,7 +6,7 @@ After=dbus.socket
[Service]
EnvironmentFile=-@CMAKE_INSTALL_FULL_SYSCONFDIR@/default/otbr-agent
-@EXEC_START_PRE@ExecStart=@CMAKE_INSTALL_FULL_SBINDIR@/otbr-agent $OTBR_AGENT_OPTS
+ExecStart=@CMAKE_INSTALL_FULL_SBINDIR@/otbr-agent $OTBR_AGENT_OPTS
KillMode=mixed
Restart=on-failure
RestartSec=5
--
2.35.1

View File

@@ -0,0 +1,35 @@
Do not hardcode C std to C99 or C++ std to C++11 if not set
OE compilers are using newer than these standards and absl needs C++14 minimum
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -46,16 +46,6 @@ set_property(CACHE OTBR_MDNS PROPERTY ST
include("${PROJECT_SOURCE_DIR}/etc/cmake/options.cmake")
-if(NOT CMAKE_C_STANDARD)
- set(CMAKE_C_STANDARD 99)
- set(CMAKE_C_STANDARD_REQUIRED ON)
-endif()
-
-if(NOT CMAKE_CXX_STANDARD)
- set(CMAKE_CXX_STANDARD 11)
- set(CMAKE_CXX_STANDARD_REQUIRED ON)
-endif()
-
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_EXE_LINKER_FLAGS "-rdynamic ${CMAKE_EXE_LINKER_FLAGS}")
@@ -63,6 +53,10 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
add_compile_options(-Wno-error=nonnull-compare)
endif()
+if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 18.1)
+ add_compile_options(-Wno-error=vla-cxx-extension)
+endif()
+
if (OTBR_COVERAGE AND CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
message(STATUS "Coverage: ON")
target_compile_options(otbr-config INTERFACE -g -O0 --coverage)

View File

@@ -0,0 +1,26 @@
Musl fixes, which should be applied upstream too
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
--- a/src/dbus/common/types.hpp
+++ b/src/dbus/common/types.hpp
@@ -715,7 +715,7 @@ struct TrelInfo
};
bool mEnabled; ///< Whether TREL is enabled.
- u_int16_t mNumTrelPeers; ///< The number of TREL peers.
+ uint16_t mNumTrelPeers; ///< The number of TREL peers.
TrelPacketCounters mTrelCounters; ///< The TREL counters.
};
--- a/third_party/openthread/repo/src/posix/platform/CMakeLists.txt
+++ b/third_party/openthread/repo/src/posix/platform/CMakeLists.txt
@@ -172,7 +172,7 @@ target_link_libraries(openthread-posix
)
option(OT_TARGET_OPENWRT "enable openthread posix for OpenWRT" OFF)
-if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux" AND NOT OT_TARGET_OPENWRT)
+if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux" AND NOT OT_TARGET_OPENWRT AND NOT OT_TARGET_MUSL)
target_compile_definitions(ot-posix-config
INTERFACE "OPENTHREAD_POSIX_CONFIG_NAT64_AIL_PREFIX_ENABLE=1"
)

View File

@@ -0,0 +1,65 @@
# SPDX-FileCopyrightText: Huawei Inc.
#
# SPDX-License-Identifier: Apache-2.0
SUMMARY = "OpenThread Border Router"
SECTION = "net"
LICENSE = "BSD-3-Clause & MIT"
LIC_FILES_CHKSUM = "file://LICENSE;md5=87109e44b2fda96a8991f27684a7349c \
file://third_party/Simple-web-server/repo/LICENSE;md5=091ac9fd29d87ad1ae5bf765d95278b0 \
file://third_party/cJSON/repo/LICENSE;md5=218947f77e8cb8e2fa02918dc41c50d0 \
file://third_party/http-parser/repo/LICENSE-MIT;md5=9bfa835d048c194ab30487af8d7b3778 \
file://third_party/openthread/repo/LICENSE;md5=543b6fe90ec5901a683320a36390c65f \
"
DEPENDS = "autoconf-archive dbus readline avahi jsoncpp boost libnetfilter-queue protobuf protobuf-native"
SRCREV = "a35cc682305bb2201c314472adf06a4960536750"
PV = "0.3.0+git"
SRC_URI = "gitsm://github.com/openthread/ot-br-posix.git;protocol=https;branch=main \
file://0001-otbr-agent.service.in-remove-pre-exec-hook-for-mdns-.patch \
file://0001-cmake-Disable-nonnull-compare-warning-on-gcc.patch \
file://default-cxx-std.patch \
file://musl-fixes.patch \
"
S = "${WORKDIR}/git"
SYSTEMD_SERVICE:${PN} = "otbr-agent.service"
inherit pkgconfig cmake systemd
# openthread/repo/src/cli/cli.cpp:1786:18: fatal error: variable 'i' set but not used [-Wunused-but-set-variable]
# for (uint8_t i = 0;; i++)
CXXFLAGS:append:libc-musl:toolchain-clang = " -Wno-error=sign-compare -Wno-error=unused-but-set-variable"
EXTRA_OECMAKE = "-DBUILD_TESTING=OFF \
-DOTBR_DBUS=ON \
-DOTBR_REST=ON \
-DOTBR_WEB=OFF \
-DCMAKE_LIBRARY_PATH=${libdir} \
-DOTBR_MDNS=avahi \
-DOTBR_BACKBONE_ROUTER=ON \
-DOTBR_BORDER_ROUTING=ON \
-DOTBR_SRP_ADVERTISING_PROXY=ON \
-DOTBR_BORDER_AGENT=ON \
-DOT_SPINEL_RESET_CONNECTION=ON \
-DOT_TREL=ON \
-DOT_MLR=ON \
-DOT_SRP_SERVER=ON \
-DOT_ECDSA=ON \
-DOT_SERVICE=ON \
-DOTBR_DUA_ROUTING=ON \
-DOT_DUA=ON \
-DOT_BORDER_ROUTING_NAT64=ON \
-DOTBR_DNSSD_DISCOVERY_PROXY=ON \
-DOTBR_INFRA_IF_NAME=eth0 \
-DOTBR_NO_AUTO_ATTACH=1 \
-DOT_REFERENCE_DEVICE=ON \
-DOT_DHCP6_CLIENT=ON \
-DOT_DHCP6_SERVER=ON \
"
EXTRA_OECMAKE:append:libc-musl = " -DOT_TARGET_MUSL=ON"
RDEPENDS:${PN} = "iproute2 ipset avahi-daemon"
RCONFLICTS:${PN} = "ot-daemon"
FILES:${PN} += "${systemd_unitdir}/*"
FILES:${PN} += "${datadir}/*"

Some files were not shown because too many files have changed in this diff Show More