Compare commits
No commits in common. "a7b85e125fd7279575c14fe3ed662272ba33c14d" and "54abb9c1216bc7076f78007c3f7fdeed319ee00e" have entirely different histories.
a7b85e125f
...
54abb9c121
31
backport-kronosnet-fix-format-truncation.patch
Normal file
31
backport-kronosnet-fix-format-truncation.patch
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
diff -urN a/libknet/host.c b/libknet/host.c
|
||||||
|
|
||||||
|
--- a/libknet/host.c 2021-08-04 10:17:01.912099056 +0800
|
||||||
|
+++ b/libknet/host.c 2021-08-04 10:17:55.708739020 +0800
|
||||||
|
@@ -77,7 +77,7 @@
|
||||||
|
/*
|
||||||
|
* set default host->name to host_id for logging
|
||||||
|
*/
|
||||||
|
- snprintf(host->name, KNET_MAX_HOST_LEN - 1, "%u", host_id);
|
||||||
|
+ snprintf(host->name, KNET_MAX_HOST_LEN, "%u", host_id);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* initialize links internal data
|
||||||
|
@@ -226,7 +226,7 @@
|
||||||
|
}
|
||||||
|
|
||||||
|
for (host = knet_h->host_head; host != NULL; host = host->next) {
|
||||||
|
- if (!strncmp(host->name, name, KNET_MAX_HOST_LEN - 1)) {
|
||||||
|
+ if (!strncmp(host->name, name, KNET_MAX_HOST_LEN)) {
|
||||||
|
err = -1;
|
||||||
|
savederrno = EEXIST;
|
||||||
|
log_err(knet_h, KNET_SUB_HOST, "Duplicated name found on host_id %u",
|
||||||
|
@@ -235,7 +235,7 @@
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
- snprintf(knet_h->host_index[host_id]->name, KNET_MAX_HOST_LEN - 1, "%s", name);
|
||||||
|
+ snprintf(knet_h->host_index[host_id]->name, KNET_MAX_HOST_LEN, "%s", name);
|
||||||
|
|
||||||
|
exit_unlock:
|
||||||
|
pthread_rwlock_unlock(&knet_h->global_rwlock);
|
||||||
BIN
kronosnet-1.13.tar.xz
Normal file
BIN
kronosnet-1.13.tar.xz
Normal file
Binary file not shown.
Binary file not shown.
105
kronosnet.spec
105
kronosnet.spec
@ -7,28 +7,26 @@
|
|||||||
%bcond_without lzma
|
%bcond_without lzma
|
||||||
%bcond_without bzip2
|
%bcond_without bzip2
|
||||||
%bcond_without zstd
|
%bcond_without zstd
|
||||||
|
%bcond_with kronosnetd
|
||||||
%bcond_without libnozzle
|
%bcond_without libnozzle
|
||||||
%bcond_with runautogen
|
%bcond_with runautogen
|
||||||
%bcond_with rpmdebuginfo
|
%bcond_with rpmdebuginfo
|
||||||
%bcond_with overriderpmdebuginfo
|
%bcond_with overriderpmdebuginfo
|
||||||
%bcond_without buildman
|
%bcond_without buildman
|
||||||
%bcond_with installtests
|
%bcond_with installtests
|
||||||
|
|
||||||
%if %{with overriderpmdebuginfo}
|
%if %{with overriderpmdebuginfo}
|
||||||
%undefine _enable_debug_packages
|
%undefine _enable_debug_packages
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
Name: kronosnet
|
Name: kronosnet
|
||||||
Summary: Multipoint-to-Multipoint VPN daemon
|
Summary: Multipoint-to-Multipoint VPN daemon
|
||||||
Version: 1.28
|
Version: 1.13
|
||||||
Release: 2
|
Release: 3
|
||||||
License: GPLv2+ and LGPLv2+
|
License: GPLv2+ and LGPLv2+
|
||||||
URL: https://kronosnet.org
|
URL: https://kronosnet.org
|
||||||
Source0: https://kronosnet.org/releases/%{name}-%{version}.tar.xz
|
Source0: https://kronosnet.org/releases/%{name}-%{version}.tar.xz
|
||||||
Patch0: libknet-tests-fix-potential-overflow-with-sprintf.patch
|
BuildRequires: gcc
|
||||||
BuildRequires: gcc chrpath make libqb-devel
|
|
||||||
%if %{with buildman}
|
%if %{with buildman}
|
||||||
BuildRequires: libxml2-devel doxygen doxygen2man
|
BuildRequires: libqb-devel libxml2-devel doxygen
|
||||||
%endif
|
%endif
|
||||||
%if %{with sctp}
|
%if %{with sctp}
|
||||||
BuildRequires: lksctp-tools-devel
|
BuildRequires: lksctp-tools-devel
|
||||||
@ -57,6 +55,9 @@ BuildRequires: bzip2-devel
|
|||||||
%if %{with zstd}
|
%if %{with zstd}
|
||||||
BuildRequires: libzstd-devel
|
BuildRequires: libzstd-devel
|
||||||
%endif
|
%endif
|
||||||
|
%if %{with kronosnetd}
|
||||||
|
BuildRequires: pam-devel
|
||||||
|
%endif
|
||||||
%if %{with libnozzle}
|
%if %{with libnozzle}
|
||||||
BuildRequires: libnl3-devel
|
BuildRequires: libnl3-devel
|
||||||
%endif
|
%endif
|
||||||
@ -64,8 +65,10 @@ BuildRequires: libnl3-devel
|
|||||||
BuildRequires: autoconf automake libtool
|
BuildRequires: autoconf automake libtool
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
|
Patch0001: backport-kronosnet-fix-format-truncation.patch
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%autosetup -n %{name}-%{version} -p1
|
%autosetup -n kronosnet-%{version} -p1
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%if %{with runautogen}
|
%if %{with runautogen}
|
||||||
@ -127,6 +130,11 @@ BuildRequires: autoconf automake libtool
|
|||||||
%else
|
%else
|
||||||
--disable-compress-zstd \
|
--disable-compress-zstd \
|
||||||
%endif
|
%endif
|
||||||
|
%if %{with kronosnetd}
|
||||||
|
--enable-kronosnetd \
|
||||||
|
%else
|
||||||
|
--disable-kronosnetd \
|
||||||
|
%endif
|
||||||
%if %{with libnozzle}
|
%if %{with libnozzle}
|
||||||
--enable-libnozzle \
|
--enable-libnozzle \
|
||||||
%else
|
%else
|
||||||
@ -143,21 +151,48 @@ find %{buildroot} -name "*.a" -exec rm {} \;
|
|||||||
find %{buildroot} -name "*.la" -exec rm {} \;
|
find %{buildroot} -name "*.la" -exec rm {} \;
|
||||||
rm -rf %{buildroot}/etc/init.d
|
rm -rf %{buildroot}/etc/init.d
|
||||||
rm -rf %{buildroot}/usr/share/doc/kronosnet
|
rm -rf %{buildroot}/usr/share/doc/kronosnet
|
||||||
|
|
||||||
file `find %{buildroot}/%{_libdir} -type f` | grep -w ELF | awk -F: '{print $1}' | xargs chrpath -d
|
|
||||||
|
|
||||||
mkdir -p %{buildroot}/etc/ld.so.conf.d
|
|
||||||
echo "%{_libdir}/%{name}" > %{buildroot}/etc/ld.so.conf.d/%{name}-%{_arch}.conf
|
|
||||||
|
|
||||||
pushd %{buildroot}%{_prefix}/lib64/kronosnet
|
|
||||||
ls *.so | awk '{print $1}' | for line in `xargs`;do
|
|
||||||
%{__ln_s} %{_prefix}/lib64/kronosnet/$line %{buildroot}%{_prefix}/lib64/kronosnet/lib$line
|
|
||||||
done
|
|
||||||
popd
|
|
||||||
|
|
||||||
%description
|
%description
|
||||||
The kronosnet source
|
The kronosnet source
|
||||||
|
%if %{with kronosnetd}
|
||||||
|
|
||||||
|
%package -n kronosnetd
|
||||||
|
Summary: Multipoint-to-Multipoint VPN daemon
|
||||||
|
License: GPLv2+
|
||||||
|
Requires(post): systemd-sysv
|
||||||
|
Requires(post): systemd-units
|
||||||
|
Requires(preun): systemd-units
|
||||||
|
Requires(postun): systemd-units
|
||||||
|
Requires(post): shadow-utils
|
||||||
|
Requires(preun): shadow-utils
|
||||||
|
Requires: pam, /etc/pam.d/passwd
|
||||||
|
%description -n kronosnetd
|
||||||
|
The kronosnet daemon is a bridge between kronosnet switching engine
|
||||||
|
and kernel network tap devices, to create and administer a
|
||||||
|
distributed LAN over multipoint-to-multipoint VPNs.
|
||||||
|
The daemon does a poor attempt to provide a configure UI similar
|
||||||
|
to other known network devices/tools (Cisco, quagga).
|
||||||
|
Beside looking horrific, it allows runtime changes and
|
||||||
|
reconfiguration of the kronosnet(s) without daemon reload
|
||||||
|
or service disruption.
|
||||||
|
|
||||||
|
%post -n kronosnetd
|
||||||
|
%systemd_post kronosnetd.service
|
||||||
|
getent group kronosnetadm >/dev/null || groupadd --force --system kronosnetadm
|
||||||
|
|
||||||
|
%preun -n kronosnetd
|
||||||
|
%systemd_preun kronosnetd.service
|
||||||
|
|
||||||
|
%files -n kronosnetd
|
||||||
|
%license COPYING.* COPYRIGHT
|
||||||
|
%dir %{_sysconfdir}/kronosnet
|
||||||
|
%dir %{_sysconfdir}/kronosnet/*
|
||||||
|
%config(noreplace) %{_sysconfdir}/sysconfig/kronosnetd
|
||||||
|
%config(noreplace) %{_sysconfdir}/pam.d/kronosnetd
|
||||||
|
%config(noreplace) %{_sysconfdir}/logrotate.d/kronosnetd
|
||||||
|
%{_unitdir}/kronosnetd.service
|
||||||
|
%{_sbindir}/*
|
||||||
|
%{_mandir}/man8/*
|
||||||
|
%endif
|
||||||
%if %{with libnozzle}
|
%if %{with libnozzle}
|
||||||
|
|
||||||
%package -n libnozzle1
|
%package -n libnozzle1
|
||||||
@ -171,11 +206,12 @@ License: LGPLv2+
|
|||||||
%files -n libnozzle1
|
%files -n libnozzle1
|
||||||
%license COPYING.* COPYRIGHT
|
%license COPYING.* COPYRIGHT
|
||||||
%{_libdir}/libnozzle.so.*
|
%{_libdir}/libnozzle.so.*
|
||||||
%config(noreplace) /etc/ld.so.conf.d/*
|
|
||||||
%if 0%{?ldconfig_scriptlets}
|
%if 0%{?ldconfig_scriptlets}
|
||||||
%ldconfig_scriptlets -n libnozzle1
|
%ldconfig_scriptlets -n libnozzle1
|
||||||
%else
|
%else
|
||||||
|
|
||||||
%post -n libnozzle1 -p /sbin/ldconfig
|
%post -n libnozzle1 -p /sbin/ldconfig
|
||||||
|
|
||||||
%postun -n libnozzle1 -p /sbin/ldconfig
|
%postun -n libnozzle1 -p /sbin/ldconfig
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
@ -213,7 +249,9 @@ License: LGPLv2+
|
|||||||
%if 0%{?ldconfig_scriptlets}
|
%if 0%{?ldconfig_scriptlets}
|
||||||
%ldconfig_scriptlets -n libknet1
|
%ldconfig_scriptlets -n libknet1
|
||||||
%else
|
%else
|
||||||
|
|
||||||
%post -n libknet1 -p /sbin/ldconfig
|
%post -n libknet1 -p /sbin/ldconfig
|
||||||
|
|
||||||
%postun -n libknet1 -p /sbin/ldconfig
|
%postun -n libknet1 -p /sbin/ldconfig
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
@ -245,7 +283,6 @@ Requires: libknet1%{_isa} = %{version}-%{release}
|
|||||||
|
|
||||||
%files -n libknet1-crypto-nss-plugin
|
%files -n libknet1-crypto-nss-plugin
|
||||||
%{_libdir}/kronosnet/crypto_nss.so
|
%{_libdir}/kronosnet/crypto_nss.so
|
||||||
%{_prefix}/lib64/kronosnet/libcrypto_nss.so
|
|
||||||
%endif
|
%endif
|
||||||
%if %{with openssl}
|
%if %{with openssl}
|
||||||
|
|
||||||
@ -258,7 +295,6 @@ Requires: libknet1%{_isa} = %{version}-%{release}
|
|||||||
|
|
||||||
%files -n libknet1-crypto-openssl-plugin
|
%files -n libknet1-crypto-openssl-plugin
|
||||||
%{_libdir}/kronosnet/crypto_openssl.so
|
%{_libdir}/kronosnet/crypto_openssl.so
|
||||||
%{_prefix}/lib64/kronosnet/libcrypto_openssl.so
|
|
||||||
%endif
|
%endif
|
||||||
%if %{with zlib}
|
%if %{with zlib}
|
||||||
|
|
||||||
@ -271,7 +307,6 @@ Requires: libknet1%{_isa} = %{version}-%{release}
|
|||||||
|
|
||||||
%files -n libknet1-compress-zlib-plugin
|
%files -n libknet1-compress-zlib-plugin
|
||||||
%{_libdir}/kronosnet/compress_zlib.so
|
%{_libdir}/kronosnet/compress_zlib.so
|
||||||
%{_libdir}/kronosnet/libcompress_zlib.so
|
|
||||||
%endif
|
%endif
|
||||||
%if %{with lz4}
|
%if %{with lz4}
|
||||||
|
|
||||||
@ -285,8 +320,6 @@ Requires: libknet1%{_isa} = %{version}-%{release}
|
|||||||
%files -n libknet1-compress-lz4-plugin
|
%files -n libknet1-compress-lz4-plugin
|
||||||
%{_libdir}/kronosnet/compress_lz4.so
|
%{_libdir}/kronosnet/compress_lz4.so
|
||||||
%{_libdir}/kronosnet/compress_lz4hc.so
|
%{_libdir}/kronosnet/compress_lz4hc.so
|
||||||
%{_libdir}/kronosnet/libcompress_lz4.so
|
|
||||||
%{_libdir}/kronosnet/libcompress_lz4hc.so
|
|
||||||
%endif
|
%endif
|
||||||
%if %{with lzo2}
|
%if %{with lzo2}
|
||||||
|
|
||||||
@ -299,7 +332,6 @@ Requires: libknet1%{_isa} = %{version}-%{release}
|
|||||||
|
|
||||||
%files -n libknet1-compress-lzo2-plugin
|
%files -n libknet1-compress-lzo2-plugin
|
||||||
%{_libdir}/kronosnet/compress_lzo2.so
|
%{_libdir}/kronosnet/compress_lzo2.so
|
||||||
%{_libdir}/kronosnet/libcompress_lzo2.so
|
|
||||||
%endif
|
%endif
|
||||||
%if %{with lzma}
|
%if %{with lzma}
|
||||||
|
|
||||||
@ -312,7 +344,6 @@ Requires: libknet1%{_isa} = %{version}-%{release}
|
|||||||
|
|
||||||
%files -n libknet1-compress-lzma-plugin
|
%files -n libknet1-compress-lzma-plugin
|
||||||
%{_libdir}/kronosnet/compress_lzma.so
|
%{_libdir}/kronosnet/compress_lzma.so
|
||||||
%{_libdir}/kronosnet/libcompress_lzma.so
|
|
||||||
%endif
|
%endif
|
||||||
%if %{with bzip2}
|
%if %{with bzip2}
|
||||||
|
|
||||||
@ -325,7 +356,6 @@ Requires: libknet1%{_isa} = %{version}-%{release}
|
|||||||
|
|
||||||
%files -n libknet1-compress-bzip2-plugin
|
%files -n libknet1-compress-bzip2-plugin
|
||||||
%{_libdir}/kronosnet/compress_bzip2.so
|
%{_libdir}/kronosnet/compress_bzip2.so
|
||||||
%{_libdir}/kronosnet/libcompress_bzip2.so
|
|
||||||
%endif
|
%endif
|
||||||
%if %{with zstd}
|
%if %{with zstd}
|
||||||
|
|
||||||
@ -338,7 +368,6 @@ Requires: libknet1%{_isa} = %{version}-%{release}
|
|||||||
|
|
||||||
%files -n libknet1-compress-zstd-plugin
|
%files -n libknet1-compress-zstd-plugin
|
||||||
%{_libdir}/kronosnet/compress_zstd.so
|
%{_libdir}/kronosnet/compress_zstd.so
|
||||||
%{_libdir}/kronosnet/libcompress_zstd.so
|
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%package -n libknet1-crypto-plugins-all
|
%package -n libknet1-crypto-plugins-all
|
||||||
@ -402,27 +431,11 @@ Requires: libknet1%{_isa} = %{version}-%{release}
|
|||||||
%files -n kronosnet-tests
|
%files -n kronosnet-tests
|
||||||
%{_libdir}/kronosnet/tests/*
|
%{_libdir}/kronosnet/tests/*
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%if %{with rpmdebuginfo}
|
%if %{with rpmdebuginfo}
|
||||||
%debug_package
|
%debug_package
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
* Tue Mar 05 2024 zouzhimin <zouzhimin@kylinos.cn> - 1.28-2
|
|
||||||
- fix potential overflow with sprintf
|
|
||||||
|
|
||||||
* Thu Oct 26 2023 xu_ping <707078654@qq.com> - 1.28-1
|
|
||||||
- Update package to version 1.28
|
|
||||||
|
|
||||||
* Thu Jun 01 2023 zouzhimin <zouzhimin@kylinos.cn> - 1.24-1
|
|
||||||
- Update package to version 1.24
|
|
||||||
|
|
||||||
* Thu Feb 02 2023 jiangxinyu <jiangxinyu@kylinos.cn> - 1.22-1
|
|
||||||
- Update package to version 1.22
|
|
||||||
|
|
||||||
* Tue Nov 15 2022 Ge Wang <wangge20@h-partners.com> - 1.13-4
|
|
||||||
- fix epoll event size to scope with extra event on send to link
|
|
||||||
|
|
||||||
* Wed Aug 04 2021 Liu Yinsi <liuyinsi@163.com> - 1.13-3
|
* Wed Aug 04 2021 Liu Yinsi <liuyinsi@163.com> - 1.13-3
|
||||||
- fix format-truncation to support gcc 10
|
- fix format-truncation to support gcc 10
|
||||||
|
|
||||||
|
|||||||
@ -1,29 +0,0 @@
|
|||||||
From c8ef1946266f8ab4f4cdfb9675aad780087420c4 Mon Sep 17 00:00:00 2001
|
|
||||||
From: cglosner <cglosner@gmail.com>
|
|
||||||
Date: Sun, 26 Nov 2023 11:17:17 -0500
|
|
||||||
Subject: [PATCH] libknet/tests: fix potential overflow with sprintf
|
|
||||||
|
|
||||||
---
|
|
||||||
libknet/tests/knet_bench.c | 4 ++--
|
|
||||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/libknet/tests/knet_bench.c b/libknet/tests/knet_bench.c
|
|
||||||
index d9b9deea..674febb3 100644
|
|
||||||
--- a/libknet/tests/knet_bench.c
|
|
||||||
+++ b/libknet/tests/knet_bench.c
|
|
||||||
@@ -129,10 +129,10 @@ static void parse_nodes(char *nodesinfo[MAX_NODES], int onidx, int port, struct
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
char *temp = NULL;
|
|
||||||
- char port_str[10];
|
|
||||||
+ char port_str[11];
|
|
||||||
|
|
||||||
memset(port_str, 0, sizeof(port_str));
|
|
||||||
- sprintf(port_str, "%d", port);
|
|
||||||
+ snprintf(port_str, sizeof(port_str), "%d", port);
|
|
||||||
|
|
||||||
for (i = 0; i < onidx; i++) {
|
|
||||||
nodes[i].nodeid = atoi(strtok(nodesinfo[i], ","));
|
|
||||||
--
|
|
||||||
2.25.1
|
|
||||||
|
|
||||||
Loading…
x
Reference in New Issue
Block a user