I forgot to add: this was only tested by gcc

On 05/30/2012 03:17 PM, Florian Obser wrote:
> Hi,
> 
> this cost me ~60 minutes yesterday evening because I was looking
> in the wrong place... 
> 
> Btw. I'm not sure if this is the most readable solution.
> 
> Thanks,
> Florian
> 
> Index: pdns/tcpreceiver.cc
> ===================================================================
> --- pdns/tcpreceiver.cc       (revision 2624)
> +++ pdns/tcpreceiver.cc       (working copy)
> @@ -522,9 +522,12 @@
>        L<<Logger::Error<<"TCP server is without backend connections in 
> doAXFR, launching"<<endl;
>        s_P=new PacketHandler;
>      }
> -
> -    if(!s_P->getBackend()->getSOA(target, sd) || !canDoAXFR(q)) {
> -      L<<Logger::Error<<"AXFR of domain '"<<target<<"' failed: not 
> authoritative"<<endl;
> +    bool cantDoAXFR=false;
> +    if(!s_P->getBackend()->getSOA(target, sd) || (cantDoAXFR=!canDoAXFR(q))) 
> {
> +      if(cantDoAXFR)
> +        L<<Logger::Error<<"AXFR of domain '"<<target<<"' prohibited by 
> server configuration"<<endl;
> +      else
> +        L<<Logger::Error<<"AXFR of domain '"<<target<<"' failed: not 
> authoritative"<<endl;
>        outpacket->setRcode(9); // 'NOTAUTH'
>        sendPacket(outpacket,outsock);
>        return 0;
> 
_______________________________________________
Pdns-dev mailing list
[email protected]
http://mailman.powerdns.com/mailman/listinfo/pdns-dev

Reply via email to