BIND 10 #1626: Error: Unable to parse response from Auth: Expecting , delimiter: line 1 column 87 (char 87)

BIND 10 Development do-not-reply at isc.org
Tue Jan 24 17:31:59 UTC 2012


#1626: Error: Unable to parse response from Auth: Expecting , delimiter: line 1
column 87 (char 87)
----------------------------------------+----------------------------------
                   Reporter:  jreed     |                 Owner:
                       Type:  defect    |                Status:  new
                   Priority:  major     |             Milestone:  New Tasks
                  Component:  b10-auth  |            Resolution:
                   Keywords:            |             Sensitive:  0
            Defect Severity:  Medium    |           Sub-Project:  DNS
Feature Depending on Ticket:            |  Estimated Difficulty:  0
        Add Hours to Ticket:  0         |           Total Hours:  0
                  Internal?:  0         |
----------------------------------------+----------------------------------

Comment (by jelte):

 Yes, tt's responding with malformed data (nested quotes):

 { "result": [ 1, "Server configuration failed: Error response when
 requesting socket: "Error creating socket on bind"" ] }

 I suspect the best fix would be to go all the way down to the
 StringElement object and do in-place escaping when creating a
 StringElement:

 {{{
 diff --git a/src/lib/cc/data.cc b/src/lib/cc/data.cc
 index 77f948a..bdb4cb4 100644
 --- a/src/lib/cc/data.cc
 +++ b/src/lib/cc/data.cc
 @@ -25,6 +25,7 @@
  #include <sstream>

  #include <boost/algorithm/string.hpp> // for iequals
 +#include <boost/algorithm/string/replace.hpp>

  #include <cmath>

 @@ -195,6 +196,10 @@ bool operator!=(const Element& a, const Element& b) {
  //
  // factory functions
  //
 +StringElement::StringElement(const std::string& v) : Element(string),
 s(v) {
 +    boost::algorithm::replace_all(s, "\"", "\\\"");
 +}
 +
  ElementPtr
  Element::create() {
      return (ElementPtr(new NullElement()));
 diff --git a/src/lib/cc/data.h b/src/lib/cc/data.h
 index 5c731e6..a8b4356 100644
 --- a/src/lib/cc/data.h
 +++ b/src/lib/cc/data.h
 @@ -424,7 +424,7 @@ class StringElement : public Element {
      std::string s;

  public:
 -    StringElement(std::string v) : Element(string), s(v) {};
 +    StringElement(const std::string& v);
      std::string stringValue() const { return (s); }
      using Element::getValue;
      bool getValue(std::string& t) { t = s; return (true); }
 }}}

 Should at least fix this issue, there may be a more efficient way to
 implement it (and we should probably escape at least the single quote as
 well). And perhaps it should be done when converting to JSON, not really
 sure atm. I'm also not sure whether the python side needs something
 similar too.

 Of course you'd still get an error, but at least it would be the real one
 (i.e. error creating socket).

-- 
Ticket URL: <http://bind10.isc.org/ticket/1626#comment:3>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development


More information about the bind10-tickets mailing list