From dfdb50be29ea46e470f31803f63866bfed3e09e1 Mon Sep 17 00:00:00 2001 From: Michal Sekletar Date: Tue, 10 Mar 2026 16:54:20 +0100 Subject: [PATCH] Create avahi and avahi-autoipd users/groups via systemd-sysusers This is necessary for proper function in RHEL Image Mode. Resolves: RHEL-110179 --- avahi-autoipd.sysusers.conf | 1 + avahi.spec | 37 +++++++++++++++---------------------- avahi.sysusers.conf | 2 ++ 3 files changed, 18 insertions(+), 22 deletions(-) create mode 100644 avahi-autoipd.sysusers.conf create mode 100644 avahi.sysusers.conf diff --git a/avahi-autoipd.sysusers.conf b/avahi-autoipd.sysusers.conf new file mode 100644 index 0000000..c606171 --- /dev/null +++ b/avahi-autoipd.sysusers.conf @@ -0,0 +1 @@ +u avahi-autoipd 170 'Avahi IPv4LL Stack' /var/lib/avahi-autoipd - diff --git a/avahi.spec b/avahi.spec index c34af85..c763cda 100644 --- a/avahi.spec +++ b/avahi.spec @@ -60,7 +60,7 @@ Name: avahi Version: 0.9%{?rc:~%{rc}} -Release: 2%{?dist} +Release: 3%{?dist} Summary: Local network service discovery License: LGPL-2.1-or-later AND LGPL-2.0-or-later AND BSD-2-Clause-Views AND MIT URL: http://avahi.org @@ -69,7 +69,6 @@ Requires: expat Requires: libdaemon >= 0.11 # For /usr/bin/dbus-send Requires(post): dbus -Requires(pre): shadow-utils Requires(pre): coreutils Requires: %{name}-libs%{?_isa} = %{version}-%{release} BuildRequires: automake @@ -131,12 +130,16 @@ BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: gettext-devel BuildRequires: systemd-devel +BuildRequires: systemd-rpm-macros +%{?sysusers_requires_compat} %if 0%{?rc:1} Source0: https://github.com/avahi/avahi/archive/refs/tags/v%{version_no_tilde}.tar.gz %else Source0: https://github.com/avahi/avahi/releases/download/v%{version_no_tilde}/%{name}-%{version_no_tilde}.tar.gz %endif +Source1: avahi.sysusers.conf +Source2: avahi-autoipd.sysusers.conf ## upstream patches Patch0001: 0001-core-wide-area-fix-for-CVE-2024-52615.patch @@ -405,8 +408,8 @@ libraries. %package autoipd Summary: Link-local IPv4 address automatic configuration daemon (IPv4LL) -Requires(pre): shadow-utils Requires: %{name}-libs%{?_isa} = %{version}-%{release} +%{?sysusers_requires_compat} %description autoipd avahi-autoipd implements IPv4LL, "Dynamic Configuration of IPv4 @@ -563,6 +566,8 @@ rm -fv %{buildroot}%{_sysconfdir}/rc.d/init.d/avahi-dnsconfd %find_lang %{name} +install -m0644 -D %{SOURCE1} %{buildroot}%{_sysusersdir}/avahi.conf +install -m0644 -D %{SOURCE2} %{buildroot}%{_sysusersdir}/avahi-autoipd.conf %check %if %{with check} @@ -577,17 +582,8 @@ rm -fv %{buildroot}%{_sysconfdir}/rc.d/init.d/avahi-dnsconfd desktop-file-validate %{buildroot}%{_datadir}/applications/avahi-discover.desktop %endif - %pre -getent group avahi >/dev/null || groupadd -f -g 70 -r avahi -if ! getent passwd avahi > /dev/null ; then - if ! getent passwd 70 > /dev/null ; then - useradd -r -l -u 70 -g avahi -d %{_localstatedir}/run/avahi-daemon -s /sbin/nologin -c "Avahi mDNS/DNS-SD Stack" avahi - else - useradd -r -l -g avahi -d %{_localstatedir}/run/avahi-daemon -s /sbin/nologin -c "Avahi mDNS/DNS-SD Stack" avahi - fi -fi -exit 0 +%sysusers_create_compat %{SOURCE1} %post %{?ldconfig} @@ -605,15 +601,7 @@ fi %systemd_postun_with_restart avahi-daemon.socket avahi-daemon.service %pre autoipd -getent group avahi-autoipd >/dev/null || groupadd -f -g 170 -r avahi-autoipd -if ! getent passwd avahi-autoipd > /dev/null ; then - if ! getent passwd 170 > /dev/null; then - useradd -r -u 170 -l -g avahi-autoipd -d %{_localstatedir}/lib/avahi-autoipd -s /sbin/nologin -c "Avahi IPv4LL Stack" avahi-autoipd - else - useradd -r -l -g avahi-autoipd -d %{_localstatedir}/lib/avahi-autoipd -s /sbin/nologin -c "Avahi IPv4LL Stack" avahi-autoipd - fi -fi -exit 0 +%sysusers_create_compat %{SOURCE2} %post dnsconfd %systemd_post avahi-dnsconfd.service @@ -662,12 +650,14 @@ exit 0 %{_datadir}/dbus-1/interfaces/*.xml %{_datadir}/dbus-1/system-services/org.freedesktop.Avahi.service %{_libdir}/libavahi-core.so.* +%{_sysusersdir}/avahi.conf %files autoipd %{_sbindir}/avahi-autoipd %config(noreplace) %{_sysconfdir}/avahi/avahi-autoipd.action %attr(1770,avahi-autoipd,avahi-autoipd) %dir %{_localstatedir}/lib/avahi-autoipd/ %{_mandir}/man8/avahi-autoipd.* +%{_sysusersdir}/avahi-autoipd.conf %files dnsconfd %config(noreplace) %{_sysconfdir}/avahi/avahi-dnsconfd.action @@ -863,6 +853,9 @@ exit 0 %changelog +* Tue Mar 10 2026 Michal Sekletar - 0.9~rc2-3 +- Add sysusers.d config files to create avahi and avahi-autoipd users/groups (RHEL-110179) + * Wed Jul 09 2025 Michal Sekletar - 0.9~rc2-2 - Fix for CVE-2024-52615 (RHEL-67715) diff --git a/avahi.sysusers.conf b/avahi.sysusers.conf new file mode 100644 index 0000000..c79617e --- /dev/null +++ b/avahi.sysusers.conf @@ -0,0 +1,2 @@ +u avahi 70 'Avahi mDNS/DNS-SD Stack' /var/run/avahi-daemon - +