From 16afa92610f479cec8f5bf40b212fed50fd0796c Mon Sep 17 00:00:00 2001 From: Nalin Dahyabhai Date: Fri, 6 Sep 2013 15:25:59 -0400 Subject: [PATCH] Set the default ccname via config, not at build - restore build-time default DEFCCNAME on Fedora 21 and later and EL, and instead set it in the default krb5.conf's [libdefaults] section (#991148) --- krb5.spec | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/krb5.spec b/krb5.spec index 0196e09..835f558 100644 --- a/krb5.spec +++ b/krb5.spec @@ -28,6 +28,15 @@ %global gettext_domain mit-krb5 # Guess where the -libs subpackage's docs are going to go. %define libsdocdir %{?_pkgdocdir:%(echo %{_pkgdocdir} | sed -e s,krb5,krb5-libs,g)}%{!?_pkgdocdir:%{_docdir}/%{name}-libs-%{version}} +# Figure out where the default ccache lives and how we set it. +%if 0%{?fedora} > 18 && 0%{?fedora} < 21 +%global compile_default_ccache_name 1 +%global compiled_default_ccache_name DIR:/run/user/%%{uid}/krb5cc +%endif +%if 0%{?fedora} >= 21 || 0%{?rhel} > 6 +%global configure_default_ccache_name 1 +%global configured_default_ccache_name KEYRING:persistent:%%{uid} +%endif Summary: The Kerberos network authentication system Name: krb5 @@ -387,8 +396,8 @@ sed -i -e s,7778,`expr "$PORT" + 1`,g $cfg . %{_libdir}/tclConfig.sh pushd src # Keep the old default if the package is built against older releases. -%if 0%{?fedora} > 18 && 0%{?fedora} < 21 -DEFCCNAME=DIR:/run/user/%%{uid}/krb5cc; export DEFCCNAME +%if 0%{?compile_default_ccache_name} +DEFCCNAME=%{compiled_default_ccache_name}; export DEFCCNAME %endif # Work out the CFLAGS and CPPFLAGS which we intend to use. INCLUDES=-I%{_includedir}/et @@ -501,6 +510,17 @@ mkdir -p $RPM_BUILD_ROOT%{_var}/kerberos/krb5/user mkdir -p $RPM_BUILD_ROOT/etc install -pm 644 %{SOURCE6} $RPM_BUILD_ROOT/etc/krb5.conf +# If the default configuration needs to start specifying a default cache +# location, add it now, then fixup the timestamp so that it looks the same. +%if 0%{?configure_default_ccache_name} +DEFCCNAME="%{configured_default_ccache_name}"; export DEFCCNAME +awk '{print} + /^# default_realm/{print " default_ccache_name =", ENVIRON["DEFCCNAME"]}' \ + %{SOURCE6} > $RPM_BUILD_ROOT/etc/krb5.conf +touch -r %{SOURCE6} $RPM_BUILD_ROOT/etc/krb5.conf +grep default_ccache_name $RPM_BUILD_ROOT/etc/krb5.conf +%endif + # Server init scripts (krb5kdc,kadmind,kpropd) and their sysconfig files. %if %{WITH_SYSTEMD} mkdir -p $RPM_BUILD_ROOT%{_unitdir} @@ -918,7 +938,9 @@ exit 0 %changelog * Fri Sep 6 2013 Nalin Dahyabhai 1.11.3-10 - incorporate Simo's backport of his persistent-keyring changes (#991148) -- restore build-time default DEFCCNAME on Fedora 21 and later and EL (#991148) +- 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) * Fri Aug 23 2013 Nalin Dahyabhai 1.11.3-9 - take another stab at accounting for UnversionedDocdirs for the -libs