[Samba] smbd and pdbedit segfault

Marc Casillo mcasillo at finite-tech.com
Mon Aug 27 12:12:21 GMT 2007


I'm using the Debian binary package for Samba which currently is 3.0.24.

The problem causes all manner of samba binaries to crash, the 'pdbedit' 
-L or 'pdbedit ktccarthy'
 is the easiest thing to 'check'. I used the debian package configure 
options for a
apples to RoundObjectWithAppleTaste(tm) comparison.

Your suggestion led me to the following test :

1. I pulled the --with options from the debian package file for the 
linux architecture. They are listed below.
2. Since I was unable to apply the patch files to the source code, I  
simply compiled them without it.
    This includes the 3.0.24 tree as well, as I wanted the afore 
mentioned apple taste test.
3. Due to #3, I manually moved the  passdb.tdb file to the /etc/samba 
directory  and ran the pdbedit -L
Results (I did 3.0.25c first, then worked backwards to see where it 'broke')

Version                                Result of pdbedit -L on 
/etc/samba/passdb.tdb
3.0.24                                  Segfaults
3.0.24seriespatched              Segfaults
3.0.25                                  Does not segfault!
3.0.25c                                Does not segfault!

And just to be sure the apple pie is the same :
diff -s /etc/samba/passdb.tdb /var/lib/samba/passdb.tdb
Files /etc/samba/passdb.tdb and /var/lib/samba/passdb.tdb are identical

I delved into what the new version of pdbedit from version 3.0.25could 
give me, and decided to try exporting
the old passwd.tdb to a smbpasswd format via :
./pdbedit -e smbpasswd:/etc/samba/passdb-smbexport

I then deleted the current /etc/samba/passdc.tdb file and imported via:
./pdbedit -i smbpasswd:/etc/samba/passdb-smbexport

Thats when I found the error ! An account with uid 1011 and egm-btharrod$
did not exist in the passwd file as such, instead it had uid 1011 as 
egm-brendon$

I edited the export file to match the passwd entry, deleted and 
re-imported the smbpasswd dump
and now, everything works as the 'bad' account had been cleaned up. The 
workstation had fits
about this, so I removed it and re-added it

I'm positive the inconsistencies came from deleting and re-creating the 
account with webmin-samba module,
but doing something that caused the files to get out of sync. 
(Incidentally, this was the last thing 'changed' before the
problems occurred, but since samba had never been SIGHUP'd, it never had 
the problem until we did a dist-upgrade and
rebooted the machine!)

Net result: The 3.0.25 version of pdbedit has a better fault tolerance 
and allowed me to export, clean up and import
the bad entries, thus allowing me to continue running the debian package 
3.0.24.

Thanks for the help Volker :) That little tip nudged me in the direction 
I needed.

Marc
----------------------


Configure switches :

./configure  --cache-file=./config.cache  --with-fhs  --enable-shared \
--enable-static --disable-pie --prefix=/usr --sysconfdir=/etc \
--libdir=/etc/samba --with-privatedir=/etc/samba \
--with-piddir=/var/run/samba --localstatedir=/var --with-rootsbindir=/sbin \
--with-pammodulesdir=/lib/security --with-pam --with-syslog --with-utmp \
--with-readline --with-pam_smbpass --with-libsmbclient --with-winbind \
--with-shared-modules=idmap_rid,idmap_ad --with-automount --with-ldap \
--with-python=python --with-smbmount --with-cifsmount --with-acl-support \
--with-quotas


Volker Lendecke wrote:
> On Sun, Aug 26, 2007 at 09:36:54PM -0800, Marc Casillo wrote:
>   
>> Whenever a particular user is referenced, either in in smbd or pdbedit, 
>> a segfault or security context stack overflow is generated.
>>     
>
> You did not specify the Samba version. But this rings a bell
> that it might have been a problem with 3.0.23. Can you
> reproduce this with 3.0.25c?
>
> Volker
>   


More information about the samba mailing list