[Pkg-samba-maint] Bug#726472: share passwords not working after upgrade from samba3
Ivo De Decker
ivo.dedecker at ugent.be
Sat Oct 19 09:51:14 UTC 2013
Thanks for all the info. That really helps!
On Fri, Oct 18, 2013 at 08:41:10PM -0500, Steve M. Robbins wrote:
> total 344
> -rw------- 1 root root 61440 Feb 16 2012 passdb.tdb
> total 832
> -rw------- 1 root root 421888 Oct 15 23:14 passdb.tdb
I think this is the issue. On upgrade from 3.x to 4.x, passdb.tdb gets moved
from /var/lib/samba/ to /var/lib/samba/private/.
if dpkg --compare-versions "$2" lt-nl 2:4.0.6 \
&& [ -e /var/lib/samba/passdb.tdb ] \
&& ! [ -e /var/lib/samba/private/passdb.tdb ]
mv /var/lib/samba/passdb.tdb /var/lib/samba/private/passdb.tdb
If this would have happened, the old /var/lib/samba/passdb.tdb wouldn't be
there anymore. I guess there was a /var/lib/samba/private/passdb.tdb before
the upgrade, which resulted in both files staying where they are. As the newer
version looks to /var/lib/samba/private/passdb.tdb, the old info wasn't
available anymore. After that, /var/lib/samba/private/passdb.tdb got changed
when you recreated the users.
The same seems to have happened with secrets.tdb.
It's not immediately clear why /var/lib/samba/private/passdb.tdb existed, but
this issue reminds me of #454770. I guess you track unstable on this system?
Most probably, there has been a version some time ago which created
/var/lib/samba/private/passdb.tdb in error, leaving the file on the system.
I'll try to search some more to see if I can find a version that actually did
The best thing I can propose, is to fail on upgrade when both files exist, so
that the admin has to do the cleanup manually. There isn't really a good way
for a script to decide which file is the right one. At least the admin will
know that something is going wrong, instead of silently getting old (possibly
empty) user data.
> > - did you ever install samba4
> No, not that I recall. I suppose it's possible that I did install it
> at one time, discovered it didn't work, then reverted.
If you did, there would be traces left in the directories you showed.
> > - do you have backups from before the upgrade? Could you get the contents of
> > smb.conf and the directory listings mentioned above from before the upgrade?
> Yes, I have backups. I'll recover them and send in a separate email.
It seems the smb.conf didn't change.
Also, you weren't using smbpasswd. You old smbpasswd was converted to
passdb.tdb during an uprade years ago.
More information about the Pkg-samba-maint