[shadow-utils] do not replace /etc/login.defs on upgrade (temporary)
Peter Vrabec
pvrabec at fedoraproject.org
Mon Jul 25 13:07:35 UTC 2011
commit 8e39d10d316d9100ff3b1e9cde76b377feaf265e
Author: Peter Vrabec <pvrabec at redhat.com>
Date: Mon Jul 25 15:06:13 2011 +0200
do not replace /etc/login.defs on upgrade (temporary)
shadow-utils.spec | 24 +++++++++++++++++++++++-
1 files changed, 23 insertions(+), 1 deletions(-)
---
diff --git a/shadow-utils.spec b/shadow-utils.spec
index 1e86e10..d0a3c7f 100644
--- a/shadow-utils.spec
+++ b/shadow-utils.spec
@@ -1,7 +1,7 @@
Summary: Utilities for managing accounts and shadow password files
Name: shadow-utils
Version: 4.1.4.3
-Release: 6%{?dist}
+Release: 7%{?dist}
Epoch: 2
URL: http://pkg-shadow.alioth.debian.org/
Source0: http://pkg-shadow.alioth.debian.org/releases/shadow-%{version}.tar.bz2
@@ -29,6 +29,8 @@ BuildRequires: libacl-devel libattr-devel
Requires: libselinux >= 1.25.2-1
Requires: audit-libs >= 1.6.5
Requires: setup
+Requires(pre): coreutils
+Requires(post): coreutils
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
%description
@@ -157,6 +159,23 @@ for dir in $(ls -1d $RPM_BUILD_ROOT%{_mandir}/{??,??_??}) ; do
echo "%%lang($lang) $dir/man*/*" >> shadow.lang
done
+# Make sure old configuration files specifying UID_MIN=500 are not overwritten
+# on upgrades. Remove the scriptlets after upgrades from Fedora 15 are no
+# longer supported.
+%pre
+if [ "$1" -gt 1 ]; then
+ hash=$(md5sum %{_sysconfdir}/login.defs | cut -d ' ' -f 1)
+ if [ "$hash" = 111354806cbbee33a73fa4d538055510 ]; then
+ cp -a %{_sysconfdir}/login.defs{,.rpm-saved-in-pre}
+ fi
+fi
+
+%post
+if [ -e %{_sysconfdir}/login.defs.rpm-saved-in-pre ]; then
+ mv %{_sysconfdir}/login.defs{,.rpmnew}
+ mv %{_sysconfdir}/login.defs{.rpm-saved-in-pre,}
+fi
+
%clean
rm -rf $RPM_BUILD_ROOT
@@ -202,6 +221,9 @@ rm -rf $RPM_BUILD_ROOT
%{_mandir}/man8/vigr.8*
%changelog
+* Fri Jul 22 2011 Miloslav Trmač <mitr at redhat.com> - 2:4.1.4.3-7
+- Make sure /etc/login.defs is not changed on upgrades from Fedora 1[345].
+
* Wed Jun 29 2011 Peter Vrabec <pvrabec at redhat.com> - 2:4.1.4.3-6
- man page fixes (#696213 #674878)
More information about the scm-commits
mailing list