samba 4: a new configuration system?

Andrew Tridgell tridge at
Tue Jun 28 00:33:28 GMT 2005


 > Hate to be the anal one, but we should add locking, yes?:
 >     ldb_lock config.ldb
 > >   ldbsearch '(some=expression)' > a.ldif
 > > a.ldif > b.ldif
 > >   ldbdiff a.ldif b.ldif > changes.ldif
 > >   ldbmodify changes.ldif
 >     ldb_unlock config.ldb

locking is a tricky issue with ldb, as ldap has no locking calls (at
least as far as I know). We have put a ldb_lock() call in the ldb API,
but it is used only by the tdb backend for now.

That said, locking isn't quite as important as you might think for
this sort of editing, as ldbedit generates a 'diff' style of ldif. So
it doesn't just say "replace all those records with these ones", it
says "make the following changes to those records". This makes it a
bit more robust to 2 people editing at once. Not perfect by any means
(for example, if two people are editing the same attribute then it
will screw up), but better than a traditional file based editor.

 > A true Unix style hack.
 > EDITOR=cat
 > ldbedit -H config.ldb > config.ldif

nice hack value, but ldbsearch is a probably a better choice for this :-)

Cheers, Tridge

More information about the samba-technical mailing list