OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
Subject: Re: CDB map for postfix
From: Michael Ju. Tokarev (mjttls.msk.ru)
Date: Tue Sep 12 2000 - 20:01:11 CDT


Wietse Venema wrote:
>
> Michael Tokarev:
[]
> > Problems are. It have no support in postmap -- and this is very
> > bad. But mkmap interface does not have close routine, while
> > working with cdb requires (well, the best solution is) that
> > new file will be created and renamed into place, that can be
> > made only in close() routine.
>
> postmap and postalias call the close() method of the underlying
> map. So, as long as dict_cdb_close() renames the result file
> everything should be OK, isn't it?

My bad again. I should (must) look more careful before final
conclusion. I ever not realized that it uses DICT interface!!!
I should sleep more frequently sometimes. It is just too bad.

Ok, mkmap is fine. But by replacing cdb's `dict' interface for
mkmap with new one, not related to original. One can't create
(store) and query cdb at the same time (well, it is hard to do
so, or at least requires big amount of memory). So the
duplication checking is hard here (without using some helpers,
maybe even an additional temporary dbm/hash can be used to allow
usage of large maps). Also, postmap can be used to "query"
something, so the same problem. But all this are doable more-or-less
clean way.

BTW, why two utilities -- postmap and postalias? Them are very
close to each other. postmap -m and postmap -a (just an example,
that options already used)? Or even auto-detect, like keys/values
with/without null terminator if not explicitly said?

[]
>
> Question - does the author permit distribution of modified versions
> of his code? I remember there were restrictions on what one could
> do with qmail, for example.

As stated in all cdb sources:

  /* Public domain */

I'm not a lawyer. But probably this makes sence. No licence of
any kind included. BTW, cdb still marked as "beta", and final
version can have another licence.

> If the cdb format is sufficiently documented one could build it
> from scratch (white room re-implementation) and avoid the issue.
>
> Another possibility is to borrow code from exim, with permission.
> They seem to ship with cdb table support.
>
> Wietse