Bug 41049 - Installation of samba-libs fails if old secrets.tdb or pass.tdb exist
Installation of samba-libs fails if old secrets.tdb or pass.tdb exist
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: Samba
UCS 3.2
Other Linux
: P2 normal (vote)
: UCS 3.2-8-errata
Assigned To: Arvid Requate
Felix Botner
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2016-04-13 13:46 CEST by Michael Grandjean
Modified: 2016-04-18 11:20 CEST (History)
2 users (show)

See Also:
What kind of report is it?: ---
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional): Troubleshooting
Max CVSS v3 score:


Attachments
samba-libs.preinst.patch (1.07 KB, patch)
2016-04-13 15:14 CEST, Arvid Requate
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Grandjean univentionstaff 2016-04-13 13:46:14 CEST
UCS 3.2-8, Samba/NT, Update from Errata 411 to 420

The installation of samba-libs (afaik new dependency) fails under certain circumstances:

> Unpacking samba-libs (from .../samba-libs_2%3a4.3.7-1.827.201604110946_amd64.deb) ...
> secrets.tdb exists in /var/lib/samba and /var/lib/samba/private, aborting samba-libs preinst
> rename one of them to allow the install/upgrade to continue                   
> http://bugs.debian.org/726472                                                 
> /var/lib/samba:                                                               
> total 2180                                                                    
> drwxr-xr-x  8 root root              4096 Apr 13 03:00 .                      
> drwxr-xr-x 51 root root              4096 Jun 10  2015 ..                     
> -rw-------  1 root root             16384 Oct 16 08:25 account_policy.tdb     
> drwsrwsr-x 10 root Printer-Admins    4096 Feb 10  2014 drivers                
> -rw-------  1 root root               696 Apr  2  2013 group_mapping.tdb      
> drwxr-xr-x  3 root root              4096 Apr  2  2013 netlogon               
> drwxr-xr-x 10 root root              4096 Apr  2  2013 printers               
> drwxr-xr-x  2 root root              4096 May 20  2015 private                
> -rw-------  1 root root           2084864 May 20  2015 registry.tdb           
> -rw-------  1 root root             45056 May  6  2015 secrets.tdb            
> -rw-------  1 root root             16384 Apr  2  2013 share_info.tdb         
> drwxrwx--T  2 root sambashare        4096 Apr  2  2013 usershares             
> -rw-------  1 root root             32768 Apr 13 12:02 winbindd_cache.tdb     
> drwxr-x---  2 root root              4096 Apr 13 03:00 winbindd_privileged    
> /var/lib/samba/private:                                                       
> total 444                                                                     
> drwxr-xr-x 2 root root     4096 May 20  2015 .                                
> drwxr-xr-x 8 root root     4096 Apr 13 03:00 ..                               
> -rw------- 1 root root    16384 Apr  2  2013 passdb.tdb                       
> -rw------- 1 root nagios 430080 Mar 26 01:01 secrets.tdb                      
> dpkg: error processing /var/cache/apt/archives/samba-libs_2%3a4.3.7-1.827.201604110946_amd64.deb (--unpack):
>  subprocess new pre-installation script returned error exit status 1          
> configured to not write apport reports                                        
>                                       Errors were encountered while processing:
>  /var/cache/apt/archives/samba-libs_2%3a4.3.7-1.827.201604110946_amd64.deb    
> E: Sub-process /usr/bin/dpkg returned an error code (1) 

This can happen at least for:
* /var/lib/samba/secrets.tdb
* /var/lib/samba/pass.tdb

Maybe this could be checked via preup.sh? Alternatively a SDB article with a workaround (renaming the file(s)) should be created.
Comment 1 Arvid Requate univentionstaff 2016-04-13 15:14:51 CEST
Created attachment 7592 [details]
samba-libs.preinst.patch

Patch proposal
Comment 2 Arvid Requate univentionstaff 2016-04-13 15:18:42 CEST
For the UCS 4.0 upgrade this was fixed via preup.sh (Bug #37534)
Comment 3 Arvid Requate univentionstaff 2016-04-14 14:08:38 CEST
samba ist mit Patch für samba-libs.preinst neu gebaut.

Advisory: samba.yaml
Comment 4 Felix Botner univentionstaff 2016-04-14 15:17:28 CEST
OK - samba version 
OK - patch
OK - *.tdb files are renamed during installation 

-> find /var/lib/samba/
/var/lib/samba/
/var/lib/samba/private
/var/lib/samba/private/secrets.tdb
/var/lib/samba/netlogon
/var/lib/samba/netlogon/scripts
/var/lib/samba/secrets.tdb.bak_160414

Entpacken von samba-libs (aus .../samba-libs_2%3a4.3.7-1.827.201604141315_amd64.deb) ...
-rw-r--r-- 1 root root 9 14. Apr 15:06 /var/lib/samba/private/secrets.tdb
-rw-r--r-- 1 root root 5 14. Apr 15:06 /var/lib/samba/secrets.tdb
secrets.tdb exists in /var/lib/samba and /var/lib/samba/private,
renaming /var/lib/samba/secrets.tdb to /var/lib/samba/secrets.tdb.bak_160414

OK - installation univention-samba4 (s4search, net rpc testjoin)

OK - samba.yaml
Comment 5 Philipp Hahn univentionstaff 2016-04-15 15:20:12 CEST
<http://errata.software-univention.de/ucs/3.2/421.html>
Comment 6 Philipp Hahn univentionstaff 2016-04-15 19:30:28 CEST
`apt-get install samba=2:4.3.7-1.827.201604141315` fails:
>Starting SMB/CIFS daemon: smbd
>/usr/sbin/smbd: error while loading shared libraries: libwinbind-client.so: cannot open shared object file: No such file or directory
> failed!

Samba was not installed previously, so this is a post-install on a new system.

# ldd /usr/sbin/smbd
        libwinbind-client.so => not found

/usr/sbin/smbd
  /usr/lib//samba/libsmbd-base.so.0
    /usr/lib//samba/libprinting-migrate.so.0
      /usr/lib/libsmbconf.so.0
        /usr/lib//samba/libcli-smb-common.so.0
          /usr/lib/libgensec.so.0
            /usr/lib/libwbclient.so.0
              libwinbind-client.so MISSING

# dpkg -S /usr/lib/libwbclient.so.0
libwbclient0: /usr/lib/libwbclient.so.0
# dpkg-query -W libwbclient0
libwbclient0    2:4.1.0-1.821.201512142147
Comment 7 Arvid Requate univentionstaff 2016-04-18 11:20:22 CEST
I turned Comment 6 into a proper bug report, see Bug 41066.