summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNalin Dahyabhai <nalin@dahyabhai.net>2013-09-06 17:32:20 -0400
committerNalin Dahyabhai <nalin@dahyabhai.net>2013-09-06 17:32:20 -0400
commit4404e63e31850e28d8ea6559040f7b67da73c488 (patch)
tree054d46e6b9cfca94c560f081ecc7fe38e4934b56
parent16afa92610f479cec8f5bf40b212fed50fd0796c (diff)
downloadkrb5-4404e63e31850e28d8ea6559040f7b67da73c488.tar.gz
krb5-4404e63e31850e28d8ea6559040f7b67da73c488.tar.xz
krb5-4404e63e31850e28d8ea6559040f7b67da73c488.zip
Conditional triggerun to set default_ccache_namekrb5-1.11.3-10.fc21
- on releases where we expect krb5.conf to be configured with a default_ccache_name, add it whenever we upgrade from an older version of the package that wouldn't have included it in its default configuration file (#991148)
-rw-r--r--krb5.spec36
1 files changed, 36 insertions, 0 deletions
diff --git a/krb5.spec b/krb5.spec
index 835f558..353e72f 100644
--- a/krb5.spec
+++ b/krb5.spec
@@ -203,6 +203,7 @@ Group: System Environment/Libraries
# Some of the older libsmbclient builds here incorrectly called
# krb5_locate_kdc(), which was mistakenly exported in 1.9.
Conflicts: libsmbclient < 3.5.10-124
+Requires(triggerun): awk, coreutils, grep
%endif
%description libs
@@ -630,6 +631,37 @@ done
%post libs -p /sbin/ldconfig
+%if 0%{?configure_default_ccache_name}
+# Roughly the version where this logic was introduced.
+%triggerun libs -- krb5-libs < 1.11.3-10
+# Try to add a default_ccache_name to /etc/krb5.conf.
+if ! grep -q default_ccache_name /etc/krb5.conf ; then
+ DEFCCNAME="%{configured_default_ccache_name}"; export DEFCCNAME
+ tmpfile=`mktemp /etc/krb5.conf.XXXXXX`
+ if test -z "$tmpfile" ; then
+ # Give up.
+ exit 0
+ fi
+ awk '
+ /^\[.*\]$/ {
+ if (libdefaults) {
+ print " default_ccache_name =", ENVIRON["DEFCCNAME"]
+ print ""
+ }
+ libdefaults=0;
+ }
+ /^\[libdefaults\]$/ { libdefaults=1; }
+ { print }' /etc/krb5.conf > "$tmpfile"
+ if test -s "$tmpfile" ; then
+ if touch -r /etc/krb5.conf "$tmpfile" ; then
+ cat "$tmpfile" > /etc/krb5.conf
+ touch -r "$tmpfile" /etc/krb5.conf
+ fi
+ fi
+ rm -f "$tmpfile"
+fi
+%endif
+
%postun libs -p /sbin/ldconfig
%post server-ldap -p /sbin/ldconfig
@@ -941,6 +973,10 @@ exit 0
- restore build-time default DEFCCNAME on Fedora 21 and later and EL, and
instead set default_ccache_name in the default krb5.conf's [libdefaults]
section (#991148)
+- on releases where we expect krb5.conf to be configured with a
+ default_ccache_name, add it whenever we upgrade from an older version of
+ the package that wouldn't have included it in its default configuration
+ file (#991148)
* Fri Aug 23 2013 Nalin Dahyabhai <nalin@redhat.com> 1.11.3-9
- take another stab at accounting for UnversionedDocdirs for the -libs