From 78000d73289ae7c873a6ed7141073f6ca8d04d72 Mon Sep 17 00:00:00 2001 From: Martin Osvald Date: Thu, 3 Nov 2022 13:36:09 +0100 Subject: [PATCH] Use systemd-sysusers for radvd user and group Resolves: #2095457 --- radvd.spec | 17 ++++++++++------- radvd.sysusers | 3 +++ 2 files changed, 13 insertions(+), 7 deletions(-) create mode 100644 radvd.sysusers diff --git a/radvd.spec b/radvd.spec index fb497e8..5fc73e8 100644 --- a/radvd.spec +++ b/radvd.spec @@ -1,12 +1,13 @@ Summary: A Router Advertisement daemon Name: radvd Version: 2.19 -Release: 4%{?dist} +Release: 5%{?dist} # The code includes the advertising clause, so it's GPL-incompatible License: BSD with advertising URL: http://www.litech.org/radvd/ Source0: %{url}dist/%{name}-%{version}.tar.xz +Source1: radvd.sysusers BuildRequires: make BuildRequires: gcc @@ -16,8 +17,9 @@ BuildRequires: flex-static BuildRequires: pkgconfig BuildRequires: check-devel BuildRequires: systemd +BuildRequires: systemd-rpm-macros %{?systemd_requires} -Requires(pre): shadow-utils +%{?sysusers_requires_compat} %description radvd is the router advertisement daemon for IPv6. It listens to router @@ -61,6 +63,7 @@ install -m 644 redhat/SysV/radvd.sysconfig %{buildroot}%{_sysconfdir}/sysconfig/ install -d -m 755 %{buildroot}%{_tmpfilesdir} 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 make check @@ -74,12 +77,8 @@ make check %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 %doc CHANGES COPYRIGHT INTRO.html README TODO @@ -87,6 +86,7 @@ exit 0 %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}/*/* @@ -94,6 +94,9 @@ exit 0 %{_sbindir}/radvdump %changelog +* 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 diff --git a/radvd.sysusers b/radvd.sysusers new file mode 100644 index 0000000..ed5cb69 --- /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