SHA256
1
0
forked from pool/sssd

Replace u-a with package conflicts

The plugin for cifs.idmap is moved to its own package and conflicts with
the winbind plugin provided by cifs-utils.

Fixes bsc#1235789, bsc#1216739

Signed-off-by: Samuel Cabrero <scabrero@suse.de>
This commit is contained in:
Samuel Cabrero 2025-01-20 15:38:54 +01:00
parent e9bed7037d
commit e6e6fdcbb8
2 changed files with 31 additions and 22 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Tue Jan 21 16:33:00 UTC 2025 - Samuel Cabrero <scabrero@suse.de>
- Migrate away from update-alternatives, replaced by package
conflicts; (bsc#1235789); (bsc#1216739);
-------------------------------------------------------------------
Tue Dec 10 20:17:10 UTC 2024 - Jan Engelhardt <jengelh@inai.de>

View File

@ -1,7 +1,7 @@
#
# spec file for package sssd
#
# Copyright (c) 2024 SUSE LLC
# Copyright (c) 2025 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -131,15 +131,11 @@ Obsoletes: sssd-common < %version-%release
%endif
# Both SSSD and cifs-utils provide an idmap plugin for cifs.ko
# %%_sysconfdir/cifs-utils/idmap-plugin should be a symlink to one of the 2 idmap plugins
# * cifs-utils one is the default (priority 20)
# * installing SSSD should NOT switch to SSSD plugin (priority 10)
# %%_sysconfdir/cifs-utils/idmap-plugin should be a symlink to one of the 2 idmap plugins,
# cifs-utils or sssd. The plugins are individually packaged and conflicts with each other
# (https://bugzilla.suse.com/show_bug.cgi?id=1235789).
%define cifs_idmap_plugin %_sysconfdir/cifs-utils/idmap-plugin
%define cifs_idmap_lib %_libdir/cifs-utils/cifs_idmap_sss.so
%define cifs_idmap_name cifs-idmap-plugin
%define cifs_idmap_priority 10
Requires(post): update-alternatives
Requires(postun): update-alternatives
%description
A set of daemons to manage access to remote directories and
@ -253,6 +249,17 @@ Group: System/Libraries
The idmap_sss module provides a way for Winbind to call SSSD to map
UIDs/GIDs and SIDs.
%package cifs-idmap-plugin
Summary: The sssd idmap plugin for cifs.idmap
Group: System/Libraries
Provides: cifs-idmap-plugin
Conflicts: cifs-idmap-plugin
%description cifs-idmap-plugin
The cifs.idmap(8) userspace helper relies on a plugin to handle the ID mapping.
This package contains the sssd ID mapping plugin.
%package -n libsss_certmap0
Summary: FreeIPA ID mapping library
License: LGPL-3.0-or-later
@ -473,8 +480,9 @@ find "$b" -type f -name "*.la" -print -delete
%find_lang %name --all-name
# dummy target for cifs-idmap-plugin
mkdir -pv "$b/%_sysconfdir/alternatives" "$b/%_sysconfdir/cifs-utils"
ln -sfv "%_sysconfdir/alternatives/%cifs_idmap_name" "$b/%cifs_idmap_plugin"
mkdir -p %{buildroot}%{_sysconfdir}/cifs-utils
ln -s -f %{cifs_idmap_lib} %{buildroot}%{cifs_idmap_plugin}
%python3_fix_shebang
%if 0%{?suse_version} > 1600
%python3_fix_shebang_path %buildroot/%_libexecdir/%name/sss_analyze
@ -530,9 +538,6 @@ fi
%tmpfiles_create %name.conf
%set_permissions %_libexecdir/%name/selinux_child %_libexecdir/%name/sssd_pam
# install SSSD cifs-idmap plugin as an alternative
update-alternatives --install %cifs_idmap_plugin %cifs_idmap_name %cifs_idmap_lib %cifs_idmap_priority
%preun
%service_del_preun sssd.service sssd-autofs.service sssd-autofs.socket sssd-nss.service sssd-nss.socket sssd-pac.service sssd-pac.socket sssd-pam.service sssd-pam.socket sssd-ssh.service sssd-ssh.socket sssd-sudo.service sssd-sudo.socket
@ -544,9 +549,6 @@ fi
# del_postun includes a try-restart
%service_del_postun sssd.service sssd-autofs.service sssd-autofs.socket sssd-nss.service sssd-nss.socket sssd-pac.service sssd-pac.socket sssd-pam.service sssd-pam.socket sssd-ssh.service sssd-ssh.socket sssd-sudo.service sssd-sudo.socket
if [ ! -f "%cifs_idmap_lib" ]; then
update-alternatives --remove %cifs_idmap_name %cifs_idmap_lib
fi
%ldconfig_scriptlets -n libsss_certmap0
%ldconfig_scriptlets -n libipa_hbac0
@ -781,12 +783,7 @@ fi
%_mandir/man8/sssd_krb5_localauth_plugin.8*
%_mandir/??/man8/sssd_krb5_localauth_plugin.8*
%_mandir/man8/sssd_krb5_locator_plugin.8*
# cifs idmap plugin
%dir %_sysconfdir/cifs-utils
%cifs_idmap_plugin
%dir %_libdir/cifs-utils
%cifs_idmap_lib
%ghost %_sysconfdir/alternatives/%cifs_idmap_name
%files ad
%dir %_libdir/%name/
@ -892,6 +889,12 @@ fi
%_libdir/samba/idmap/
%_mandir/man8/idmap_sss.8*
%files cifs-idmap-plugin
%dir %_sysconfdir/cifs-utils
%cifs_idmap_plugin
%dir %_libdir/cifs-utils
%cifs_idmap_lib
%files -n libipa_hbac0
%_libdir/libipa_hbac.so.0*