From f58a6368cb3f5c754583fd614562681c6194b827022ea849915b2928f8cb7900 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Thu, 10 Feb 2022 16:12:31 +0000 Subject: [PATCH] Accepting request 953024 from home:scabrero:branches:network:ldap - Remove caches only when performing a package downgrade. The sssd daemon takes care of upgrading the database format when necessary (bsc#1195552) OBS-URL: https://build.opensuse.org/request/show/953024 OBS-URL: https://build.opensuse.org/package/show/network:ldap/sssd?expand=0&rev=260 --- sssd.changes | 7 +++++++ sssd.spec | 12 +++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/sssd.changes b/sssd.changes index d7b6439..db85d7c 100644 --- a/sssd.changes +++ b/sssd.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Wed Feb 9 13:17:30 UTC 2022 - Samuel Cabrero + +- Remove caches only when performing a package downgrade. The sssd + daemon takes care of upgrading the database format when necessary + (bsc#1195552) + ------------------------------------------------------------------- Tue Jan 25 11:32:10 UTC 2022 - Jan Engelhardt diff --git a/sssd.spec b/sssd.spec index 12b9f21..e9baf4c 100644 --- a/sssd.spec +++ b/sssd.spec @@ -437,9 +437,6 @@ update-alternatives --install %cifs_idmap_plugin %cifs_idmap_name %cifs_idmap_li if [ "$1" = "0" -a -x "%_sbindir/pam-config" ]; then "%_sbindir/pam-config" -d --sss || : fi -# Clear caches, which may have an incompatible format afterwards -# (especially, downgrades) -rm -f /var/lib/sss/db/*.ldb # del_postun includes a try-restart %service_del_postun %services @@ -458,6 +455,15 @@ fi %post -n libsss_simpleifp0 -p /sbin/ldconfig %postun -n libsss_simpleifp0 -p /sbin/ldconfig +%triggerun -- %{name} < %{version}-%{release} +# sssd takes care of upgrading the database but it doesn't handle downgrades. +# Clear caches when downgrading the package, which may have an +# incompatible format afterwards preventing the daemon from startup. +if [ "$1" = "1" ] && [ "$2" = "2" ]; then + echo "Package downgrade detected, removing cache files which may have an incompatible format." + rm -f /var/lib/sss/db/*.ldb +fi + %pre dbus %service_add_pre sssd-ifp.service