[Pdns-dev] pipebackend doesn't support FAIL response from coprocess

David Apgar apgar at yahoo-inc.com
Tue Dec 11 12:47:57 CET 2007


Hey All,

Been playing with the pipebackend, and I noticed that it doesn't appear
the the FAIL answer is actually implemented.
http://downloads.powerdns.com/documentation/html/backends-detail.html#PI
PEBACKEND

Hence, I don't have any way for my coprocess to send a DBException up
the stack, and have the server return a SERVFAIL.

I've attached a simple, 3 line patch that fixes this.  I don't think I'm
missing anything about the expected behavior of the pipebackend, but
please let me know if somehow I missed something (or if this isn't where
this fix would go in, or there is some other, better way that I can get
the pdns server to return a SERVFAIL via the pipebackend).

Thanks!
David Apgar
apgar at yahoo-inc.com


<patch inline, as well as attached>

Index: pipebackend.cc
===================================================================
--- pipebackend.cc	(revision 1113)
+++ pipebackend.cc	(working copy)
@@ -199,6 +199,9 @@
          L<<Logger::Error<<kBackendId<<" coprocess returned emtpy line
in query for "<<d_qname<<endl;
          throw AhuException("Format error communicating with
coprocess");
       }
+      else if(parts[0]=="FAIL") {
+         throw DBException("coprocess returned a FAIL");
+      }
       else if(parts[0]=="END") {
          return false;
       }

</patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.pipebackend.cc
Type: application/octet-stream
Size: 535 bytes
Desc: patch.pipebackend.cc
Url : http://mailman.powerdns.com/pipermail/pdns-dev/attachments/20071211/74b343bb/patch.pipebackend.obj


More information about the Pdns-dev mailing list