From d892da15d1f37515880b07b219e4fa3be70e3eef Mon Sep 17 00:00:00 2001 From: Timothée Ravier Date: Oct 15 2021 18:56:19 +0000 Subject: Use systemd sysusers config to create user and group See: https://docs.fedoraproject.org/en-US/packaging-guidelines/UsersAndGroups/ --- diff --git a/gdm.spec b/gdm.spec index 85748d7..d48b618 100644 --- a/gdm.spec +++ b/gdm.spec @@ -11,7 +11,7 @@ Name: gdm Epoch: 1 Version: 41.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: The GNOME Display Manager License: GPLv2+ @@ -22,6 +22,8 @@ Source1: org.gnome.login-screen.gschema.override # moved here from pulseaudio-gdm-hooks-11.1-16 Source5: default.pa-for-gdm +Source6: gdm.sysusers + # Downstream patches Patch80001: 0001-Honor-initial-setup-being-disabled-by-distro-install.patch Patch90001: 0001-data-add-system-dconf-databases-to-gdm-profile.patch @@ -140,6 +142,7 @@ mkdir -p %{buildroot}%{_sysconfdir}/gdm/PostSession %meson_install install -p -m644 -D %{SOURCE5} %{buildroot}%{_localstatedir}/lib/gdm/.config/pulse/default.pa +install -p -m644 -D %{SOURCE6} %{buildroot}%{_sysusersdir}/%{name}.conf rm -f %{buildroot}%{_sysconfdir}/pam.d/gdm @@ -163,11 +166,7 @@ mkdir -p %{buildroot}%{_sysconfdir}/dconf/db/gdm.d/locks %find_lang gdm --with-gnome %pre -/usr/sbin/useradd -M -u 42 -d /var/lib/gdm -s /sbin/nologin -r gdm > /dev/null 2>&1 -/usr/sbin/usermod -d /var/lib/gdm -s /sbin/nologin gdm >/dev/null 2>&1 -# ignore errors, as we can't disambiguate between gdm already existed -# and couldn't create account with the current adduser. -exit 0 +sysusers_create_compat %{SOURCE6} %post # if the user already has a config file, then migrate it to the new @@ -286,6 +285,7 @@ fi %{_unitdir}/gdm.service %dir %{_userunitdir}/gnome-session@gnome-login.target.d/ %{_userunitdir}/gnome-session@gnome-login.target.d/session.conf +%{_sysusersdir}/%{name}.conf %files devel %dir %{_includedir}/gdm @@ -300,6 +300,9 @@ fi %{_libdir}/pkgconfig/gdm-pam-extensions.pc %changelog +* Fri Oct 15 2021 Timothée Ravier - 1:41.0-2 +- Use systemd sysusers config to create user and group + * Tue Sep 21 2021 Kalev Lember - 1:41.0-1 - Update to 41.0 diff --git a/gdm.sysusers b/gdm.sysusers new file mode 100644 index 0000000..78a1630 --- /dev/null +++ b/gdm.sysusers @@ -0,0 +1 @@ +u gdm 42 "GNOME Display Manager" /var/lib/gdm