[rbldnsd] TXT troubles in 0.93

Michael Tokarev rbldnsd@corpit.ru
Thu, 22 May 2003 21:58:51 +0400


Brett Mueller wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Hi Michael,
> 
> I just upgraded from 0.83 to 0.93, and am having some troubles with
> rbldnsd not showing default TXT for entries in the data files.  I
[]
> My entries without specific TXT look like this (so we know which
> sysadmin entered it, and when):
> 
>   opt4email.com           # BEM:041003

Aha.  Comments that are in the middle of a line aren't handled correctly.
I know this.  I thought about removing "support" for such comments altogether,
but this very example shows they're useful, and this is a reason i didn't
remove that yet.

The "problem" is that if # character will be recognized as a comment
at any position, there should be a way to escape it, e.g. \#, so all
the other funny escapes (\\ in particular) should be supported.  But
recognizing hash characters inside a line as a comment will beak some
things - many DNSBLs have TXT records with both # and ; characters.

So i don't really know how to fix that properly.  Either way, current
behaviour is just wrong.  The following patch (apply manually due to
tab characters converted to spaces in email):

diff -u -2 -r1.27 rbldnsd_dnset.c
--- rbldnsd_dnset.c     18 May 2003 23:08:56 -0000      1.27
+++ rbldnsd_dnset.c     22 May 2003 17:56:52 -0000
@@ -88,5 +88,5 @@
    else {                       /* else parse rest */
      SKIPSPACE(s);
-    if (!*s)                   /* use default if none given */
+    if (!*s || *s == '#')      /* use default if none given */
        rr = ds->def_rr;
      else if (!(size = parse_a_txt(s, &rr, ds->def_rr))) {

will "fix" this problem, by recognizing comment at a start of
"value" of a record.  But i'm not sure either whenever this
is a right way to go or not.

/mjt