From a4ea6b15c3e70b8679033fb8b5e4538410efe9aabf1f6221dcfd2adb9a4c5a76 Mon Sep 17 00:00:00 2001 From: Michael Vetter Date: Thu, 21 Jan 2021 08:48:53 +0000 Subject: [PATCH] Accepting request 865245 from home:kukuk:branches:Base:System - Split login.defs configuration file into own sub-package, which allows to install util-linux or pam on small embedded/edge systems or container without the need to pull in the full shadow suite. OBS-URL: https://build.opensuse.org/request/show/865245 OBS-URL: https://build.opensuse.org/package/show/Base:System/shadow?expand=0&rev=99 --- shadow.changes | 8 ++++++++ shadow.spec | 46 ++++++++++++++++++++++++++++++++-------------- 2 files changed, 40 insertions(+), 14 deletions(-) diff --git a/shadow.changes b/shadow.changes index 8034ed6..d1a4ee4 100644 --- a/shadow.changes +++ b/shadow.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Thu Jan 21 06:52:30 UTC 2021 - Thorsten Kukuk + +- Split login.defs configuration file into own sub-package, which + allows to install util-linux or pam on small embedded/edge + systems or container without the need to pull in the full shadow + suite. + ------------------------------------------------------------------- Wed Nov 11 14:38:13 UTC 2020 - Fabian Vogt diff --git a/shadow.spec b/shadow.spec index 42c7265..dca2c38 100644 --- a/shadow.spec +++ b/shadow.spec @@ -1,7 +1,7 @@ # # spec file for package shadow # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2021 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -82,6 +82,18 @@ Requires(pre): permissions Requires(pre): user(root) Provides: pwdutils = 3.2.20 Obsoletes: pwdutils <= 3.2.19 +Requires: login_defs >= %{version} +Provides: useradd_or_adduser_dep + +%description +This package includes the necessary programs for converting plain +password files to the shadow password format and to manage user and +group accounts. + +%package -n login_defs +Summary: login.defs configuration file +Group: System/Base +BuildArch: noarch # Virtual provides for supported variables in login.defs. # It prevents references to unknown variables. # Upgrade them only if shadow-util-linux.patch or @@ -89,12 +101,10 @@ Obsoletes: pwdutils <= 3.2.19 # Call shadow-login_defs-check.sh before! Provides: login_defs-support-for-pam = 1.3.1 Provides: login_defs-support-for-util-linux = 2.36 -Provides: useradd_or_adduser_dep -%description -This package includes the necessary programs for converting plain -password files to the shadow password format and to manage user and -group accounts. +%description -n login_defs +This package contains the default login.defs configuration file +as used by util-linux, pam and shadow. %prep %setup -q -a 1 @@ -218,10 +228,13 @@ fi %pre %service_add_pre shadow.service shadow.timer -for i in login.defs pam.d/chage pam.d/chfn pam.d/chpasswd pam.d/chsh pam.d/groupadd pam.d/groupdel pam.d/groupmod pam.d/newusers pam.d/passwd pam.d/useradd pam.d/userdel pam.d/usermod; do +for i in pam.d/chage pam.d/chfn pam.d/chpasswd pam.d/chsh pam.d/groupadd pam.d/groupdel pam.d/groupmod pam.d/newusers pam.d/passwd pam.d/useradd pam.d/userdel pam.d/usermod; do test -f /etc/${i}.rpmsave && mv -v /etc/${i}.rpmsave /etc/${i}.rpmsave.old ||: done +%pre -n login_defs +test -f /etc/login.defs.rpmsave && mv -v /etc/login.defs.rpmsave /etc/login.defs.rpmsave.old ||: + %post %set_permissions %{_bindir}/chage %set_permissions %{_bindir}/chfn @@ -254,18 +267,16 @@ done %posttrans # Migration to /usr/etc -for i in login.defs pam.d/chage pam.d/chfn pam.d/chpasswd pam.d/chsh pam.d/groupadd pam.d/groupdel pam.d/groupmod pam.d/newusers pam.d/passwd pam.d/useradd pam.d/userdel pam.d/usermod; do +for i in pam.d/chage pam.d/chfn pam.d/chpasswd pam.d/chsh pam.d/groupadd pam.d/groupdel pam.d/groupmod pam.d/newusers pam.d/passwd pam.d/useradd pam.d/userdel pam.d/usermod; do test -f /etc/${i}.rpmsave && mv -v /etc/${i}.rpmsave /etc/${i} ||: done +%posttrans -n login_defs +test -f /etc/login.defs.rpmsave && mv -v /etc/login.defs.rpmsave /etc/login.defs ||: + %files -f shadow.lang %license COPYING %doc NEWS doc/HOWTO README README.changes-pwdutils -%if %{defined no_config} -%attr(0644,root,root) %{_distconfdir}/login.defs -%else -%attr(0644,root,root) %config %{_sysconfdir}/login.defs -%endif %attr(0644,root,root) %config(noreplace) %{_sysconfdir}/default/useradd %verify(not md5 size mtime) %config(noreplace) %{_sysconfdir}/subuid %verify(not md5 size mtime) %config(noreplace) %{_sysconfdir}/subgid @@ -335,7 +346,6 @@ done %{_mandir}/man1/passwd.1%{?ext_man} %{_mandir}/man1/sg.1%{?ext_man} %{_mandir}/man3/shadow.3%{?ext_man} -%{_mandir}/man5/login.defs.5%{?ext_man} %{_mandir}/man5/shadow.5%{?ext_man} %{_mandir}/man8/chpasswd.8%{?ext_man} %{_mandir}/man8/groupadd.8%{?ext_man} @@ -359,4 +369,12 @@ done %{_unitdir}/* +%files -n login_defs +%if %{defined no_config} +%attr(0644,root,root) %{_distconfdir}/login.defs +%else +%attr(0644,root,root) %config %{_sysconfdir}/login.defs +%endif +%{_mandir}/man5/login.defs.5%{?ext_man} + %changelog