From c5201d23da5496507b300693364d4d17d72ce204 Mon Sep 17 00:00:00 2001 From: Elio Maldonado Date: Wed, 29 Sep 2010 11:46:10 -0700 Subject: [PATCH] Improve the fixes for bugs 636787, 636792, 636801 Replace posttrans sysinit scriptlet with a triggerpostun one (#636787) Fix and cleanup the setup-nsssysinit.sh script (#636792, #636801) --- nss.spec | 16 ++++++++++------ setup-nsssysinit.sh | 19 ++++++++++++------- 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/nss.spec b/nss.spec index bb19a31..01a5d06 100644 --- a/nss.spec +++ b/nss.spec @@ -6,7 +6,7 @@ Summary: Network Security Services Name: nss Version: 3.12.8 -Release: 2%{?dist} +Release: 3%{?dist} License: MPLv1.1 or GPLv2+ or LGPLv2+ URL: http://www.mozilla.org/projects/security/pki/nss/ Group: System Environment/Libraries @@ -372,11 +372,11 @@ rm -rf $RPM_BUILD_ROOT/%{_includedir}/nss3/nsslowhash.h %postun -p /sbin/ldconfig -# Prevent disabling of nss-sysinit on nss package upgrade caused -# by faulty preun sysinit scriplet from a previous version nss.spec. -# It will be eventually removed. -%posttrans sysinit -[ -e /etc/pki/nssdb/pkcs11.txt ] && /usr/bin/setup-nsssysinit.sh on +# Reverse unwanted disabling of sysinit by faulty preun sysinit scriplet +# from previous versions of nss.spec +%triggerpostun -n nss-sysinit -- nss-sysinit < 3.12.8-3 +/usr/bin/setup-nsssysinit.sh on + %files %defattr(-,root,root) @@ -490,6 +490,10 @@ rm -rf $RPM_BUILD_ROOT/%{_includedir}/nss3/nsslowhash.h %{_libdir}/libnssckfw.a %changelog +* Wed Sep 29 2010 Elio Maldonado - 3.12.8-3 +- Replace posttrans sysinit scriptlet with a triggerpostun one (#636787) +- Fix and cleanup the setup-nsssysinit.sh script (#636792, #636801) + * Mon Sep 27 2010 Elio Maldonado - 3.12.8-2 - Add posttrans scriptlet (#636787) diff --git a/setup-nsssysinit.sh b/setup-nsssysinit.sh index 02042ff..8e1f5f7 100755 --- a/setup-nsssysinit.sh +++ b/setup-nsssysinit.sh @@ -18,7 +18,7 @@ EOF } # validate -if test $# -eq 0; then +if [ $# -eq 0 ]; then usage 1 1>&2 fi @@ -30,13 +30,18 @@ if [ ! -f $p11conf ]; then exit 1 fi -on="1" +# check if nsssysinit is currently enabled or disabled +sysinit_enabled() +{ + grep -q '^library=libnsssysinit' ${p11conf} +} + +umask 022 case "$1" in on | ON ) - if [ `grep '^library=libnsssysinit' ${p11conf}` ]; then + if sysinit_enabled; then exit 0 fi - umask 022 cat ${p11conf} | \ sed -e 's/^library=$/library=libnsssysinit.so/' \ -e '/^NSS/s/\(Flags=internal\)\(,[^m]\)/\1,moduleDBOnly\2/' > \ @@ -44,10 +49,9 @@ case "$1" in mv ${p11conf}.on ${p11conf} ;; off | OFF ) - if [ ! `grep "^library=libnsssysinit" ${p11conf}` ]; then + if ! sysinit_enabled; then exit 0 fi - umask 022 cat ${p11conf} | \ sed -e 's/^library=libnsssysinit.so/library=/' \ -e '/^NSS/s/Flags=internal,moduleDBOnly/Flags=internal/' > \ @@ -55,7 +59,8 @@ case "$1" in mv ${p11conf}.off ${p11conf} ;; status ) - grep -q '^library=libnsssysinit' ${p11conf} && echo 'ON' || echo OFF + echo -n 'NSS sysinit is ' + sysinit_enabled && echo 'enabled' || echo 'disabled' ;; * ) usage 1 1>&2