2.2alpha3 with TDB support

Simo Sorce idra at samba.org
Tue Apr 10 02:48:29 GMT 2001

On Tue, Apr 10, 2001 at 11:24:46AM +1000, Edmund Lam wrote:
> Hi,
>    I'm currently testing Samba-2.2.0-alpha3 with TDB support. However,
> with "security=user", I cannot add users to the smbpasswd database
> using the command ``smbpassd -a -D10 alice alice'' as root.
>    Without TDB support, Samba seems to work fine. This problem occurs
> on both Digital Unix 4.0g and Linux 2.2. Anyway, the output of
> smbpasswd when tdb support is builtin.

The tdb development has been carried on in HEAD branch as a major rewrite of the passdb backends.
I think it may be completely broken in 2.2

> ===
> [root samba]# ./smbpasswd -a -D 10 alice alice
> getpwnam(alice) called
> Unable to open TDB passwd!Unable to open TDB passwd!endtdbpwent: closed password file.
> Failed to add entry for user alice.
> Failed to modify password entry for user alice
> ===
>    I have not done anything (after ``make install'') to generate a
> basic smbpasswd file. In addition, smbd and nmbd are NOT running. If I
> have skipped a crucial step, then could someone tell me please. The exact 
> same steps without TDB support works. I can provide my smb.conf file if
> requested.

You do not need to create one, the TDB should be created if not found.
>    Finally, I have a few questions about TDB in general.
> 1) Are there any docs regarding TDB which I can read other than source?

No, at the moment there is no document I'm aware of.

> 2) With TDB, the smbpasswd encrypted password file keeps the same
> filename, but the format changes from a text-file to a binary tdb file.
> Is this correct?
In head it has changed into passdb.tdb and currently there's also a riddb.tdb support file to speedup rid lookups.

> 3) The smbpasswd scripts (eg addtosmbpass, convert_smbpasswd,
> mksmbpasswd.sh) are useless for Samba with TDB support -- right?

In samba HEAD there's a tool called pdbedit that currently may read a smbpasswd classic style text file and add accounts to the tdb, so in theory you may simply extend this tools making them produce a classic smbpasswd style file and then importing it in tdb through pdbedit.

> 4) Samba with TDB should scale better as the number of users increase
> as everytime Samba forks, it doesn't have to read the whole TDB file
> (say 5MB). Instead, it can jump directly to the user record.
> 5) What is the state of the TDB code in general? Is it "known to be
> broken", "should work perfectly" or somewhere in between?
TDB stands for Trivial Data Base and is used internally for many things.
The TDB code itself is pretty stable, while tdb based passdb backend has not been tested in deep (it works well for me).

>    On a different (minor) topic, I've noticed the following warning 
> messages when compiling samba-2.2.0-alpha3 under Linux 2.2 with
> glibc-2.2.
> ===
> the use of `mktemp' is dangerous, better use `mkstemp'
> ===
Yes, this has been reported before, while generally mktemp is not a really safe function, it is used correctly in samba and is to be considered safe.
> Thanks
> Eddie <epl at unimelb.edu.au>
> PS Yes, I am aware it's development code and that it may not work. I'm
> also willing to do a bit of work, if only I knew what to do. However, I
> read the message from Jeremy that Samba was being readied for release.

If you want to test TDB passdb better switch to HEAD development branch:


More information about the samba-technical mailing list