Bug 1737888 - Libwbclient alternatives manual setting lost
Summary: Libwbclient alternatives manual setting lost
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: samba
Version: 7.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Andreas Schneider
QA Contact: dkarpele
URL:
Whiteboard:
Depends On:
Blocks: 1785134
TreeView+ depends on / blocked
 
Reported: 2019-08-06 10:52 UTC by Davide Principi
Modified: 2020-09-29 20:19 UTC (History)
6 users (show)

Fixed In Version: samba-4.10.13-1.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1785134 (view as bug list)
Environment:
Last Closed: 2020-09-29 20:19:06 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Github NethServer dev issues 5801 None closed Samba shares unaccessible after Samba updates 2020-04-20 19:38:59 UTC
Red Hat Product Errata RHSA-2020:3981 None None None 2020-09-29 20:19:46 UTC

Description Davide Principi 2019-08-06 10:52:45 UTC
Description of problem:

A samba package upgrade causes the manual setting of libwbclient alternatives to be lost. The winbind daemon loads the wrong sssd-libwbclient library and access to samba shares does not work any more (NT_STATUS_LOGON_FAILURE).

Version-Release number of selected component:

- samba-4.8.3-6.el7_6
- chkconfig-1.7.4-1.el7.x86_64 (provides alternatives command)


How reproducible:

Always reproducible on CentOS 7.6, with the following steps.

Steps to Reproduce:

1. install an old version of samba: 

    yum install samba-4.8.3-4.el7

2. install a libwbclient alternative: 

    yum install sssd-libwbclient

3. set libwbclient "manual": 

    alternatives --set libwbclient.so.0.14-64 /usr/lib64/samba/wbclient/libwbclient.so.0.14

4. install latest samba packages: 

    yum update samba-4.8.3-6.el7_6

Actual results:

[root@vm6 ~]# alternatives --list
libnssckbi.so.x86_64	auto	/usr/lib64/pkcs11/p11-kit-trust.so
ld	auto	/usr/bin/ld.bfd
mta	auto	/usr/sbin/sendmail.postfix
libwbclient.so.0.14-64	auto	/usr/lib64/sssd/modules/libwbclient.so.0.14.0


Expected results:

[root@vm6 ~]# alternatives --list
libnssckbi.so.x86_64	auto	/usr/lib64/pkcs11/p11-kit-trust.so
ld	auto	/usr/bin/ld.bfd
mta	auto	/usr/sbin/sendmail.postfix
libwbclient.so.0.14-64	manual	/usr/lib64/samba/wbclient/libwbclient.so.0.14



Additional info:

Originally reported here: https://community.nethserver.org/t/after-yum-upgrade-shares-no-more-accessible/13131

Comment 3 Stephen Quinney 2019-10-24 09:52:24 UTC
We are seeing exactly the same problem on large numbers of machines (~100s) so this is definitely a common problem. Running the /usr/sbin/update-alternatives command from the posttrans script for the libwbclient package manually fixes the alternatives symlinks.

Comment 4 Sumit Bose 2019-10-24 10:52:42 UTC
Hi,

it looks like 'alternatives --remove' is called unconditionally during %preun in the spec file. This means that during updates the alternatives configuration for Samba's libwbclient is first removed and then added again which will trigger the auto mechanism of the alternatives tool. I would suggest to wrap the alternatives call in '%preun' with 'if [ $1 -eq 0 ]; then ... fi' so that 'alternatives --remove' is only called if the package is really uninstalled (see e.g. https://docs.fedoraproject.org/en-US/packaging-guidelines/Scriptlets/ for the different values of $1). Please note that since always '%preun' from the old package is used this will not be fixed with the next update but only with the next but one update.

As a workaround, since it is not used, you can remove the sssd-libwbclient package. Then Samba's libwbclient will be the only alternative.

bye,
Sumit

Comment 9 errata-xmlrpc 2020-09-29 20:19:06 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: samba security, bug fix, and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2020:3981


Note You need to log in before you can comment on or make changes to this bug.