diff --git a/download b/download new file mode 100644 index 0000000000000000000000000000000000000000..0106e4d4e7ad25e4c7789a979177fe5703d3ca76 --- /dev/null +++ b/download @@ -0,0 +1 @@ +5e84f9df1f1ef517260c68ccfe496d25 radvd-2.19.tar.xz diff --git a/radvd-2.17.tar.xz b/radvd-2.17.tar.xz deleted file mode 100644 index 9084153095788daa6db3ae19433313c1e2c226cd..0000000000000000000000000000000000000000 Binary files a/radvd-2.17.tar.xz and /dev/null differ diff --git a/radvd-crash_if_config_removed.patch b/radvd-crash_if_config_removed.patch deleted file mode 100644 index 1c75ccc8ad21f98ea73f699542de1f0df4633b76..0000000000000000000000000000000000000000 --- a/radvd-crash_if_config_removed.patch +++ /dev/null @@ -1,65 +0,0 @@ -From 57295ef0e85640adcc3b85f08b12f09d54aad2d2 Mon Sep 17 00:00:00 2001 -From: Tomi Salminen -Date: Tue, 16 Apr 2019 13:55:39 +0300 -Subject: [PATCH] Crash on SIGHUP when config file removed. - -Reading config zeroed the returnable configuration only when the -config file was opened successfully. If not, the previously read -in configuration was returned, which was already freed. - -Moved configuration zeroing to start of readin_config and added -unit test to test zero return. ---- - gram.y | 2 +- - test/util.c | 15 +++++++++++++++ - 2 files changed, 16 insertions(+), 1 deletion(-) - -diff --git a/gram.y b/gram.y -index 20af2f3..4115390 100644 ---- a/gram.y -+++ b/gram.y -@@ -947,10 +947,10 @@ static void cleanup(void) - - struct Interface * readin_config(char const *path) - { -+ IfaceList = 0; - FILE * in = fopen(path, "r"); - if (in) { - filename = path; -- IfaceList = 0; - num_lines = 1; - iface = 0; - -diff --git a/test/util.c b/test/util.c -index b74b301..7124475 100644 ---- a/test/util.c -+++ b/test/util.c -@@ -259,6 +259,20 @@ START_TEST(test_rand_between) - } - END_TEST - -+START_TEST(test_cfg_removal_with_sighup) -+{ -+ struct Interface *tmpIface = NULL; -+ -+ tmpIface = readin_config("test/test1.conf"); -+ ck_assert(tmpIface); -+ -+ free_ifaces(tmpIface); -+ -+ tmpIface = readin_config("test/file_that_should_not_exists.conf"); -+ ck_assert(!tmpIface); -+} -+END_TEST -+ - Suite *util_suite(void) - { - TCase *tc_safe_buffer = tcase_create("safe_buffer"); -@@ -288,6 +302,7 @@ Suite *util_suite(void) - - TCase *tc_misc = tcase_create("misc"); - tcase_add_test(tc_misc, test_rand_between); -+ tcase_add_test(tc_misc, test_cfg_removal_with_sighup); - - Suite *s = suite_create("util"); - suite_add_tcase(s, tc_safe_buffer); diff --git a/radvd-double_free_dupiface.patch b/radvd-double_free_dupiface.patch deleted file mode 100644 index 16c59b8b3ca2ec7801c9e76cb9569877830a8c63..0000000000000000000000000000000000000000 --- a/radvd-double_free_dupiface.patch +++ /dev/null @@ -1,23 +0,0 @@ -From fb1529d0573d3d9744a0e9fea8dd0becfc91ad85 Mon Sep 17 00:00:00 2001 -From: Pavel Zhukov -Date: Thu, 24 Jan 2019 13:21:55 +0100 -Subject: [PATCH] Fix double-free scenario in case if duplicate interface was - specified (Fixes #100). - -Signed-off-by: Pavel Zhukov ---- - gram.y | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/gram.y b/gram.y -index 5db3bde..20af2f3 100644 ---- a/gram.y -+++ b/gram.y -@@ -958,6 +958,7 @@ struct Interface * readin_config(char const *path) - if (yyparse() != 0) { - free_ifaces(iface); - iface = 0; -+ IfaceList = 0; - } else { - dlog(LOG_DEBUG, 1, "config file, %s, syntax ok", path); - } diff --git a/radvd.service b/radvd.service deleted file mode 100644 index b6007c13bfc6d1e219f4a2f819c122d86483ab74..0000000000000000000000000000000000000000 --- a/radvd.service +++ /dev/null @@ -1,14 +0,0 @@ -[Unit] -Description=Router advertisement daemon for IPv6 -After=network-online.target -Wants=network-online.target - -[Service] -EnvironmentFile=/etc/sysconfig/radvd -ExecStart=/usr/sbin/radvd $OPTIONS -Type=forking -PIDFile=/var/run/radvd/radvd.pid -ExecReload=/bin/kill -HUP $MAINPID - -[Install] -WantedBy=multi-user.target diff --git a/radvd.spec b/radvd.spec index 728be76ddba92b3f2ca91dc60a26d03ef4590b1b..d9bae0b2376b2fad4f63f12a1bfa1237715cb154 100644 --- a/radvd.spec +++ b/radvd.spec @@ -1,15 +1,16 @@ %define anolis_release .0.1 Summary: A Router Advertisement daemon Name: radvd -Version: 2.17 -Release: 15%{anolis_release}%{?dist} +Version: 2.19 +Release: 5%{anolis_release}%{?dist} + # The code includes the advertising clause, so it's GPL-incompatible License: BSD with advertising -Group: System Environment/Daemons URL: http://www.litech.org/radvd/ Source0: %{url}dist/%{name}-%{version}.tar.xz -Source1: radvd.service +Source1: radvd.sysusers +BuildRequires: make BuildRequires: gcc BuildRequires: bison BuildRequires: flex @@ -17,13 +18,9 @@ BuildRequires: flex-static BuildRequires: pkgconfig BuildRequires: check-devel BuildRequires: systemd +BuildRequires: systemd-rpm-macros %{?systemd_requires} -Requires(pre): shadow-utils - -Patch0: radvd_add_ra_memleak.patch -Patch1: radvd_tmpfiles.patch -Patch2: radvd-double_free_dupiface.patch -Patch3: radvd-crash_if_config_removed.patch +%{?sysusers_requires_compat} %description radvd is the router advertisement daemon for IPv6. It listens to router @@ -45,7 +42,7 @@ Requires: %{name} = %{version}-%{release} Doc pages for %{name}. %prep -%autosetup -p1 +%autosetup -p1 for F in CHANGES; do iconv -f iso-8859-1 -t utf-8 < "$F" > "${F}.new" @@ -54,30 +51,31 @@ for F in CHANGES; do done %build -export CFLAGS="$RPM_OPT_FLAGS -fPIE" +export CFLAGS="$RPM_OPT_FLAGS -fPIE " export LDFLAGS='-pie -Wl,-z,relro,-z,now,-z,noexecstack,-z,nodlopen' %configure \ + --with-check \ --disable-silent-rules \ --with-pidfile=/run/radvd/radvd.pid -make %{?_smp_mflags} +%make_build %install -make DESTDIR=%{buildroot} install +%make_install mkdir -p %{buildroot}%{_sysconfdir}/sysconfig mkdir -p %{buildroot}/run/radvd mkdir -p %{buildroot}%{_unitdir} -install -m 644 redhat/radvd.conf.empty %{buildroot}%{_sysconfdir}/radvd.conf -install -m 644 redhat/radvd.sysconfig %{buildroot}%{_sysconfdir}/sysconfig/radvd +install -m 644 redhat/SysV/radvd.conf.empty %{buildroot}%{_sysconfdir}/radvd.conf +install -m 644 redhat/SysV/radvd.sysconfig %{buildroot}%{_sysconfdir}/sysconfig/radvd install -d -m 755 %{buildroot}%{_tmpfilesdir} -install -p -m 644 redhat/radvd-tmpfs.conf %{buildroot}%{_tmpfilesdir}/radvd.conf -install -m 644 %{SOURCE1} %{buildroot}%{_unitdir} +install -p -m 644 redhat/systemd/radvd-tmpfs.conf %{buildroot}%{_tmpfilesdir}/radvd.conf +install -m 644 redhat/systemd/radvd.service %{buildroot}%{_unitdir} +install -p -D -m 0644 %{SOURCE1} %{buildroot}%{_sysusersdir}/radvd.conf %check -# The tests don't work, see https://github.com/reubenhwk/radvd/issues/30 -#make check +make check %postun %systemd_postun_with_restart radvd.service @@ -88,18 +86,15 @@ install -m 644 %{SOURCE1} %{buildroot}%{_unitdir} %preun %systemd_preun radvd.service -# Static UID and GID defined by /usr/share/doc/setup-*/uidgid %pre -getent group radvd >/dev/null || groupadd -r -g 75 radvd -getent passwd radvd >/dev/null || \ - useradd -r -u 75 -g radvd -d / -s /sbin/nologin -c "radvd user" radvd -exit 0 +%sysusers_create_compat %{SOURCE1} %files %{_unitdir}/radvd.service %config(noreplace) %{_sysconfdir}/radvd.conf %config(noreplace) %{_sysconfdir}/sysconfig/radvd %{_tmpfilesdir}/radvd.conf +%{_sysusersdir}/radvd.conf %dir %attr(755,radvd,radvd) /run/radvd/ %doc radvd.conf.example %{_mandir}/*/* @@ -110,21 +105,66 @@ exit 0 %doc CHANGES COPYRIGHT INTRO.html README TODO %changelog -* Mon Jul 18 2022 Hangbo Fan - 2.17-15.0.1 +* Thu Nov 03 2022 Hangbo Fan - 2.19-5.0.1 - Add doc sub package -* Wed Apr 15 2020 Pavel Zhukov - 2.17-15 -- Fix double-free scenario (#1669177) +* Thu Nov 03 2022 Martin Osvald - 2.19-5 +- Use systemd-sysusers for radvd user and group (#2095457) + +* Tue Aug 10 2021 Mohan Boddu - 2.19-4 +- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags + Related: rhbz#1991688 + +* Fri Apr 16 2021 Mohan Boddu - 2.19-3 +- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937 + +* Wed Jan 27 2021 Fedora Release Engineering - 2.19-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Mon Oct 19 2020 Pavel Zhukov - 2.19-1 +- new version v2.19 + +* Wed Jul 29 2020 Fedora Release Engineering - 2.18-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Tue Jul 14 2020 Tom Stellard - 2.18-5 +- Use make macros +- https://fedoraproject.org/wiki/Changes/UseMakeBuildInstallMacro + +* Fri Apr 3 2020 Pavel Zhukov - 2.18-4 +- Update pidfile path (#1785862) + +* Thu Jan 30 2020 Fedora Release Engineering - 2.18-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Fri Jul 26 2019 Fedora Release Engineering - 2.18-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Wed Feb 20 2019 Pavel Zhukov - 2.17-19 +- change tmpfiles location (#1678147) + +* Sat Feb 02 2019 Fedora Release Engineering - 2.17-18 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Sun Jan 27 2019 Pavel Zhukov - 2.17-17 +- Fix double-free in InterfaceList + +* Tue Nov 27 2018 Pavel Zhukov - 2.17-16 +- Depends on network-online target (#1652459) + +* Sat Jul 14 2018 Fedora Release Engineering - 2.17-15 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild -* Fri Oct 25 2019 Pavel Zhukov - 2.17-14 -- Resolves: #1710787 - Change location of tmpfiles -- Use tmpfile config from tarball +* Wed Jun 13 2018 Pavel Zhukov - 2.17-14 +- Log to stderr in non-daemon mode +- Add nodaemon option into manpage +- Re-enable test again -* Tue Dec 4 2018 Pavel Zhukov - 2.17-12 -- Resolves: #1652459 - Wait for all devices to be initialized +* Mon Jun 04 2018 Pavel Zhukov - 2.17-12 +- Enable tests and fix them on big endian arches -* Tue Aug 28 2018 Pavel Zhukov - 2.17-11 -- Related: #1602675 - Fix memory leak in add_ra flow +* Thu Apr 12 2018 Pavel Zhukov - 2.17-11 +- Enable Werror=all * Mon Feb 19 2018 Pavel Zhukov - 2.17-10 - Add gcc BR diff --git a/radvd.sysusers b/radvd.sysusers new file mode 100644 index 0000000000000000000000000000000000000000..ed5cb69ecad7d1ac71dad8644083c48b91ae4893 --- /dev/null +++ b/radvd.sysusers @@ -0,0 +1,3 @@ +#Type Name ID GECOS Home directory Shell +g radvd 75 +u radvd 75 "radvd user" / /sbin/nologin diff --git a/radvd_add_ra_memleak.patch b/radvd_add_ra_memleak.patch deleted file mode 100644 index 5d4a8c4e5a7bafb4891e60f0d281624a2b7b73fe..0000000000000000000000000000000000000000 --- a/radvd_add_ra_memleak.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 5ad279f48c0f3d94573e3f3c887f86cd10476c2d Mon Sep 17 00:00:00 2001 -From: David Hallas -Date: Wed, 4 Apr 2018 06:36:12 +0200 -Subject: [PATCH] Fixes memory leak in add_ra_options_dnssl - -The add_ra_options_dnssl function failed to free memory before -returning. ---- - send.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/send.c b/send.c -index 0a4951a..4b83d57 100644 ---- a/send.c -+++ b/send.c -@@ -527,8 +527,8 @@ static struct safe_buffer_list *add_ra_options_dnssl(struct safe_buffer_list *sb - - dnssl = dnssl->next; - } -- return sbl; - safe_buffer_free(serialized_domains); -+ return sbl; - } - - /* diff --git a/radvd_tmpfiles.patch b/radvd_tmpfiles.patch deleted file mode 100644 index 0d1307adb1f156db08fda9062a6362bb970f6de8..0000000000000000000000000000000000000000 --- a/radvd_tmpfiles.patch +++ /dev/null @@ -1,18 +0,0 @@ -From 30198b37dd9d8cb3b15c90663145d06e2531d87f Mon Sep 17 00:00:00 2001 -From: Pavel Zhukov -Date: Tue, 26 Feb 2019 14:37:16 +0100 -Subject: [PATCH] packaging: Change location of tmpfiles to /run to avoid - warnings - -Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1678147 ---- - redhat/systemd/radvd-tmpfs.conf | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/redhat/systemd/radvd-tmpfs.conf b/redhat/systemd/radvd-tmpfs.conf -index 590652c..26f203d 100644 ---- a/redhat/radvd-tmpfs.conf -+++ b/redhat/radvd-tmpfs.conf -@@ -1 +1 @@ --d /var/run/radvd 0755 radvd radvd -+d /run/radvd 0755 radvd radvd