From: ian Date: Sun, 26 Sep 1999 18:22:44 +0000 (+0000) Subject: Correct error messages for qname CNAME foo, foo CNAME bar. X-Git-Tag: privaterel-1999-10-12-fanf-dustman~26 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;ds=sidebyside;h=05db5bce3d0a63ce41ecf70587fcbb64e6dc9b8f;p=adns.git Correct error messages for qname CNAME foo, foo CNAME bar. --- diff --git a/changelog b/changelog index 3178a63..9365d2a 100644 --- a/changelog +++ b/changelog @@ -20,6 +20,8 @@ adns (0.5) unstable; urgency=medium * Do not give -u 0 -g 0 options to install. * Do not scramble innards when a query on the output queue is cancelled. * Promise not to change fds in adns_beforepoll (if now is specified). + * Correct error messages for qname CNAME foo, foo CNAME bar. + * Improved textual error string for _s_prohibitedcname. -- diff --git a/regress/case-cnametocname.err b/regress/case-cnametocname.err new file mode 100644 index 0000000..e69de29 diff --git a/regress/case-cnametocname.out b/regress/case-cnametocname.out new file mode 100644 index 0000000..6d60fb2 --- /dev/null +++ b/regress/case-cnametocname.out @@ -0,0 +1,5 @@ +adns debug: using nameserver 172.18.45.6 +intel.ugcs.caltech.edu. flags 0 type 1 A(-) submitted +adns debug: allegedly canonical name ugintel.best.ugcs.caltech.edu is actually alias for drachma.ugcs.caltech.edu (QNAME=intel.ugcs.caltech.edu, QTYPE=A, NS=172.18.45.6) +intel.ugcs.caltech.edu. flags 0 type A(-): DNS alias found where canonical name wanted; nrrs=0; cname=ugintel.best.ugcs.caltech.edu; owner=$; ttl=497758 +rc=0 diff --git a/regress/case-cnametocname.sys b/regress/case-cnametocname.sys new file mode 100644 index 0000000..97f2156 --- /dev/null +++ b/regress/case-cnametocname.sys @@ -0,0 +1,39 @@ +default +:1 intel.ugcs.caltech.edu. + start 938369896.279735 + socket type=SOCK_DGRAM + socket=4 + +0.000179 + fcntl fd=4 cmd=F_GETFL + fcntl=~O_NONBLOCK&... + +0.000054 + fcntl fd=4 cmd=F_SETFL O_NONBLOCK|... + fcntl=OK + +0.000041 + sendto fd=4 addr=172.18.45.6:53 + 311f0100 00010000 00000000 05696e74 656c0475 67637307 63616c74 65636803 + 65647500 00010001. + sendto=40 + +0.001628 + select max=5 rfds=[4] wfds=[] efds=[] to=1.998372 + select=1 rfds=[4] wfds=[] efds=[] + +0.586476 + recvfrom fd=4 buflen=512 *addrlen=16 + recvfrom=OK addr=172.18.45.6:53 + 311f8180 00010003 00050005 05696e74 656c0475 67637307 63616c74 65636803 + 65647500 00010001 05696e74 656c0475 67637307 63616c74 65636803 65647500 + 00050001 0007985e 000f0775 67696e74 656c0462 657374c0 2ec04a00 05000100 + 00000a00 0a076472 6163686d 61c02ec0 65000100 01000798 83000483 d72bacc0 + 2e000200 01000935 be000b08 70757263 68617365 c02ec02e 00020001 000935be + 00070465 6e7679c0 2ec02e00 02000100 0935be00 09036f66 62036e65 7400c02e + 00020001 000935be 00090674 7962616c 74c033c0 2e000200 01000935 be000e08 + 6d657263 7574696f 026e69c0 33c08b00 01000100 0935be00 0483d72b a7c0a200 + 01000100 0935be00 0483d72b 87c0b500 01000100 001ef800 04c6b4b6 07c0ca00 + 01000100 0100d700 0483d78b 64c0df00 01000100 0100d700 0483d7fe 63. + +0.001423 + recvfrom fd=4 buflen=512 *addrlen=16 + recvfrom=EAGAIN + +0.000646 + close fd=4 + close=OK + +0.000242 diff --git a/src/reply.c b/src/reply.c index 61fee52..7db623b 100644 --- a/src/reply.c +++ b/src/reply.c @@ -167,9 +167,11 @@ void adns__procdgram(adns_state ads, const byte *dgram, int dglen, adns__query_fail(qu,adns_s_prohibitedcname); return; } else if (qu->cname_dgram) { /* Ignore second and subsequent CNAME(s) */ - adns__debug(ads,serv,qu,"ignoring duplicate CNAME (%s, as well as %s)", - adns__diag_domain(ads,serv,qu, &qu->vb, dgram,dglen,rdstart), - qu->answer->cname); + adns__debug(ads,serv,qu,"allegedly canonical name %s is actually alias for %s", + qu->answer->cname, + adns__diag_domain(ads,serv,qu, &qu->vb, dgram,dglen,rdstart)); + adns__query_fail(qu,adns_s_prohibitedcname); + return; } else if (wantedrrs) { /* Ignore CNAME(s) after RR(s). */ adns__debug(ads,serv,qu,"ignoring CNAME (to %s) coexisting with RR", adns__diag_domain(ads,serv,qu, &qu->vb, dgram,dglen,rdstart));