Re: Help on CDB file format

"John Mazza" <[email protected]> Fri, 09 May 2008 14:04:15 -0400
Newsgroups gmane.comp.djb.cdb
Message-ID <[email protected]>
--_=_=_=IMA.BOUNDARY.HTML_2732872=_=_=_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Those=20"artifacts"=20appear=20to=20be=20the=20actual=20value=20that=20the=
=20program=20using
the=20CDB=20files=20is=20storing,=20not=20necessarily=20part=20of=20the=20=
CDB=20format
itself.=20=20Basically,=20they=20appear=20to=20be=20a=20"layer=20up"=20in=20=
a=20heirarchy.

It=20may=20be=20necessary=20to=20review=20the=20source=20of=20the=20progra=
ms=20generating=20the
CDB=20files=20to=20see=20why=20those=20things=20are=20there.=20=20It=20cou=
ld=20be=20that=20they=20use
them=20as=20flags=20for=20their=20internal=20processing,=20or=20may=20be=20=
just=20generated
by=20a=20non-compliant=20implementation=20of=20the=20standard.=20=20




On=20Fri,=2009=20May=202008=2016:52:46=20+0100,=20Hugo=20Monteiro=20wrote:=


>Hello=20all,
>
>I'm=20in=20the=20process=20of=20writing=20a=20small=20program=20that,=20h=
opefully,=20will
>allow=20to=20do=20recipient=20checking=20and=20lookup=20email=20addresses=
=20on=20multiple
>distinct=20backends=20for=20qmail=20based=20installations.=20Happens=20th=
at=20for=20legacy=20
>and=20performance=20reasons,=20i=20would=20like=20to=20include=20CDB=20in=
=20the=20supported=20
>backends.=20The=20program,=20or=20the=20part=20of=20the=20relative=20code=
,=20is=20already=20able=20
>to=20read=20and=20search=20the=20matching=20values=20for=20the=20queried=20=
key,=20but=20i've=20
>come=20across=20a=20situation=20that=20i=20was=20hoping=20someone=20could=
=20clarify.
>
>=20From=20the=20documentation=20i've=20seen,=20the=20representation=20of=20=
the=20data=20isn't
>more=20than=20a=20record=20like=20"+keylen,datalen:key->value",=20where=20=
there's=20the
>possibility=20of=20the=20same=20key=20to=20point=20to=20different=20value=
s.=20So=20i=20started
>testing=20with=20a=20self=20made=20cdb=20file=20like=20the=20described=20=
above=20and=20the=20code
>behaved=20properly.=20Hurray!
>
>Then=20i=20tried=20with=20an=20aliases.cdb=20file=20and=20a=20cdb=20file=20=
generated=20with
>qmail-newu=20and=20i=20didn't=20get=20anything.=20Taking=20a=20closer=20l=
ook=20to=20the=20dumps
>of=20those=20cdbs,=20i=20saw=20that=20the=20data=20was=20represented=20di=
fferently=20from=20the
>cdb=20i=20made,=20and=20even=20from=20each=20other.
>
>aliases.cdb=20keeps=20data=20in=20the=20format=20"+keylen,datalen::key@->=
&data",
>where=20the=20":"=20and=20"@"=20are=20part=20of=20the=20key,=20and=20the=20=
"&"=20part=20of=20the=20data.
>
>then,=20cdb=20generated=20with=20qmail-newu=20has=20the=20format
>"+keylen,datalen:!key->data",=20where=20the=20"!"=20is=20part=20of=20the=20=
key.
>
>Of=20course=20i=20could=20write=20code=20to=20handle=20those=20"artifacts=
",=20but=20i'm=20not
>confortable=20doing=20so=20without=20understanding=20them.=20I'd=20like=20=
to=20know=20if
>there=20is=20any=20reason=20for=20them,=20what=20that=20reason=20is=20and=
=20if=20in=20terms=20of
>recipient=20checking/lookup=20it=20would=20be=20a=20bad=20thing=20if=20th=
e=20code=20would=20just
>circumvent=20them.=20I=20would=20like=20to=20know=20also=20if=20there=20a=
re=20more=20"artifacts"
>that=20i=20should=20be=20aware=20of.
>
>
>Thank=20you=20all=20for=20your=20time=20and=20input.
>
>Hugo=20Monteiro.
>
>--=20
>ci.fct.unl.pt:~#=20cat=20.signature
>
>Hugo=20Monteiro
>Email=09=20:[email protected]
>Telefone=20:=20+351=20212948300=20Ext.15307
>
>Centro=20de=20Inform=A0tica
>Faculdade=20de=20Ci=88ncias=20e=20Tecnologia=20da
>=09=09=20=20=20Universidade=20Nova=20de=20Lisboa
>Quinta=20da=20Torre=20=20=202829-516=20Caparica=20=20=20Portugal
>Telefone:=20+351=20212948596=20=20=20Fax:=20+351=20212948548
>[email protected]
>
>ci.fct.unl.pt:~#=20_
>
>


John=20Mazza
CTO,=20MGC=20Works=20Inc.
(412)=20628-6214

********************************
=20=20=20=20=20=20=20=20CONFIDENTIAL
********************************
The=20information=20contained=20in=20this=20electronic=20mail=20may=20be
confidential,=20and=20is=20only=20intended=20for=20the=20use=20of=20the
individual(s)=20named=20above.=20=20If=20you=20are=20not=20the=20intended
recipient,=20you=20are=20hereby=20notified=20that=20any=20dissemination,
distribution,=20or=20copying=20of=20this=20communication=20is=20strictly
prohibited.=20

If=20you=20have=20received=20this=20communication=20in=20error,=20please=20=

notify=20us=20by=20telephone=20[412-782-4017]=20and=20immediately=20forwar=
d
this=20message=20and=20any=20attachments=20back=20to=20the=20sender.=20The=
n,
proceed=20to=20delete=20the=20material=20from=20any=20e-mail=20system.=20

Thank=20you.

********************************************************



--_=_=_=IMA.BOUNDARY.HTML_2732872=_=_=_
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<HTML>


<FONT=20FACE=3D"Courier=20New"=20DEFAULT=3D"FACE"><FONT=20SIZE=3D"2"=20POI=
NTSIZE=3D"10"=20DEFAULT=3D"SIZE">Those=20"artifacts"=20appear=20to=20be=20=
the=20actual=20value=20that=20the=20program=20using=20the=20CDB=20files=20=
is=20storing,=20not=20necessarily=20part=20of=20the=20CDB=20format=20itsel=
f.=20=20Basically,=20they=20appear=20to=20be=20a=20"layer=20up"=20in=20a=20=
heirarchy.<BR>

<BR>

It=20may=20be=20necessary=20to=20review=20the=20source=20of=20the=20progra=
ms=20generating=20the=20CDB=20files=20to=20see=20why=20those=20things=20ar=
e=20there.=20=20It=20could=20be=20that=20they=20use=20them=20as=20flags=20=
for=20their=20internal=20processing,=20or=20may=20be=20just=20generated=20=
by=20a=20non-compliant=20implementation=20of=20the=20standard.=20=20<BR>

<BR>

<BR>

<BR>

<BR>

On=20Fri,=2009=20May=202008=2016:52:46=20+0100,=20Hugo=20Monteiro=20wrote:=
<BR>

<BR>

&gt;Hello=20all,<BR>

&gt;<BR>

&gt;I'm=20in=20the=20process=20of=20writing=20a=20small=20program=20that,=20=
hopefully,=20will<BR>

&gt;allow=20to=20do=20recipient=20checking=20and=20lookup=20email=20addres=
ses=20on=20multiple<BR>

&gt;distinct=20backends=20for=20qmail=20based=20installations.=20Happens=20=
that=20for=20legacy=20<BR>

&gt;and=20performance=20reasons,=20i=20would=20like=20to=20include=20CDB=20=
in=20the=20supported=20<BR>

&gt;backends.=20The=20program,=20or=20the=20part=20of=20the=20relative=20c=
ode,=20is=20already=20able=20<BR>

&gt;to=20read=20and=20search=20the=20matching=20values=20for=20the=20queri=
ed=20key,=20but=20i've=20<BR>

&gt;come=20across=20a=20situation=20that=20i=20was=20hoping=20someone=20co=
uld=20clarify.<BR>

&gt;<BR>

&gt;=20From=20the=20documentation=20i've=20seen,=20the=20representation=20=
of=20the=20data=20isn't<BR>

&gt;more=20than=20a=20record=20like=20"+keylen,datalen:key-&gt;value",=20w=
here=20there's=20the<BR>

&gt;possibility=20of=20the=20same=20key=20to=20point=20to=20different=20va=
lues.=20So=20i=20started<BR>

&gt;testing=20with=20a=20self=20made=20cdb=20file=20like=20the=20described=
=20above=20and=20the=20code<BR>

&gt;behaved=20properly.=20Hurray!<BR>

&gt;<BR>

&gt;Then=20i=20tried=20with=20an=20aliases.cdb=20file=20and=20a=20cdb=20fi=
le=20generated=20with<BR>

&gt;qmail-newu=20and=20i=20didn't=20get=20anything.=20Taking=20a=20closer=20=
look=20to=20the=20dumps<BR>

&gt;of=20those=20cdbs,=20i=20saw=20that=20the=20data=20was=20represented=20=
differently=20from=20the<BR>

&gt;cdb=20i=20made,=20and=20even=20from=20each=20other.<BR>

&gt;<BR>

&gt;aliases.cdb=20keeps=20data=20in=20the=20format=20"+keylen,datalen::key=
@-&gt;&data",<BR>

&gt;where=20the=20":"=20and=20"@"=20are=20part=20of=20the=20key,=20and=20t=
he=20"&"=20part=20of=20the=20data.<BR>

&gt;<BR>

&gt;then,=20cdb=20generated=20with=20qmail-newu=20has=20the=20format<BR>

&gt;"+keylen,datalen:!key-&gt;data",=20where=20the=20"!"=20is=20part=20of=20=
the=20key.<BR>

&gt;<BR>

&gt;Of=20course=20i=20could=20write=20code=20to=20handle=20those=20"artifa=
cts",=20but=20i'm=20not<BR>

&gt;confortable=20doing=20so=20without=20understanding=20them.=20I'd=20lik=
e=20to=20know=20if<BR>

&gt;there=20is=20any=20reason=20for=20them,=20what=20that=20reason=20is=20=
and=20if=20in=20terms=20of<BR>

&gt;recipient=20checking/lookup=20it=20would=20be=20a=20bad=20thing=20if=20=
the=20code=20would=20just<BR>

&gt;circumvent=20them.=20I=20would=20like=20to=20know=20also=20if=20there=20=
are=20more=20"artifacts"<BR>

&gt;that=20i=20should=20be=20aware=20of.<BR>

&gt;<BR>

&gt;<BR>

&gt;Thank=20you=20all=20for=20your=20time=20and=20input.<BR>

&gt;<BR>

&gt;Hugo=20Monteiro.<BR>

&gt;<BR>

&gt;--=20<BR>

&gt;ci.fct.unl.pt:~#=20cat=20.signature<BR>

&gt;<BR>

&gt;Hugo=20Monteiro<BR>

&gt;Email=20=20=20=20=20:=20<FONT=20COLOR=3D0000ff><U>[email protected]=
l.pt<FONT=20COLOR=3D000000=20DEFAULT=3D"COLOR"></U><BR>

&gt;Telefone=20:=20+351=20212948300=20Ext.15307<BR>

&gt;<BR>

&gt;Centro=20de=20Inform=A0tica<BR>

&gt;Faculdade=20de=20Ci=88ncias=20e=20Tecnologia=20da<BR>

&gt;=20=20=20=20=20=20=20=20=20=20=20Universidade=20Nova=20de=20Lisboa<BR>=


&gt;Quinta=20da=20Torre=20=20=202829-516=20Caparica=20=20=20Portugal<BR>

&gt;Telefone:=20+351=20212948596=20=20=20Fax:=20+351=20212948548<BR>

&gt;<FONT=20COLOR=3D0000ff><U>www.ci.fct.unl.pt<FONT=20COLOR=3D000000=20DE=
FAULT=3D"COLOR"></U>=20=20=20=20=20=20=20=20=20=20<FONT=20COLOR=3D0000ff><=
U>[email protected]<FONT=20COLOR=3D000000=20DEFAULT=3D"COLOR"></U><BR>

&gt;<BR>

&gt;ci.fct.unl.pt:~#=20_<BR>

&gt;<BR>

&gt;<BR>

<BR>


</HTML>

<HTML>
<LEFT>
<FONT=20FACE=3D"Courier=20New"=20COLOR=3D"#000001"=20SIZE=3D"2"=20POINTSIZ=
E=3D"10"=20DEFAULT=3D"ALL">
<br>
John&nbsp;Mazza<br>
CTO,&nbsp;MGC&nbsp;Works&nbsp;Inc.<br>
(412)&nbsp;628-6214<br>
<br>
********************************<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CONFIDENTIAL<br>
********************************<br>
The&nbsp;information&nbsp;contained&nbsp;in&nbsp;this&nbsp;electronic&nbsp=
;mail&nbsp;may&nbsp;be<br>
confidential,&nbsp;and&nbsp;is&nbsp;only&nbsp;intended&nbsp;for&nbsp;the&n=
bsp;use&nbsp;of&nbsp;the<br>
individual(s)&nbsp;named&nbsp;above.&nbsp;&nbsp;If&nbsp;you&nbsp;are&nbsp;=
not&nbsp;the&nbsp;intended<br>
recipient,&nbsp;you&nbsp;are&nbsp;hereby&nbsp;notified&nbsp;that&nbsp;any&=
nbsp;dissemination,<br>
distribution,&nbsp;or&nbsp;copying&nbsp;of&nbsp;this&nbsp;communication&nb=
sp;is&nbsp;strictly<br>
prohibited.&nbsp;<br>
<br>
If&nbsp;you&nbsp;have&nbsp;received&nbsp;this&nbsp;communication&nbsp;in&n=
bsp;error,&nbsp;please&nbsp;<br>
notify&nbsp;us&nbsp;by&nbsp;telephone&nbsp;[412-782-4017]&nbsp;and&nbsp;im=
mediately&nbsp;forward<br>
this&nbsp;message&nbsp;and&nbsp;any&nbsp;attachments&nbsp;back&nbsp;to&nbs=
p;the&nbsp;sender.&nbsp;Then,<br>
proceed&nbsp;to&nbsp;delete&nbsp;the&nbsp;material&nbsp;from&nbsp;any&nbsp=
;e-mail&nbsp;system.&nbsp;<br>
<br>
Thank&nbsp;you.<br>
<br>
********************************************************<br>
<br>
</HTML>


--_=_=_=IMA.BOUNDARY.HTML_2732872=_=_=_--