From: bert hubert Date: Mon, 28 Sep 2015 08:21:04 +0000 (+0200) Subject: further dnsname fixups for dnsdist and opendbx X-Git-Tag: dnsdist-1.0.0-alpha1~248^2~28^2~20 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1f9100a7022131282528d2e7e441a0aebb9a0a67;p=pdns further dnsname fixups for dnsdist and opendbx --- diff --git a/modules/opendbxbackend/odbxbackend.cc b/modules/opendbxbackend/odbxbackend.cc index a3ffaa7b7..0d5808790 100644 --- a/modules/opendbxbackend/odbxbackend.cc +++ b/modules/opendbxbackend/odbxbackend.cc @@ -148,7 +148,7 @@ bool OdbxBackend::getDomainInfo( const string& domain, DomainInfo& di ) if( ( tmp = odbx_field_value( m_result, 1 ) ) != NULL ) { - di.zone = string( tmp, odbx_field_length( m_result, 1 ) ); + di.zone = DNSName(string( tmp, odbx_field_length( m_result, 1 ) )); } if( ( tmp = odbx_field_value( m_result, 0 ) ) != NULL ) @@ -365,7 +365,7 @@ bool OdbxBackend::get( DNSResourceRecord& rr ) if( m_qname.empty() && ( tmp = odbx_field_value( m_result, 1 ) ) != NULL ) { - rr.qname = DNSName( tmp, odbx_field_length( m_result, 1 ) ); + rr.qname = DNSName( string(tmp, odbx_field_length( m_result, 1 ) )); } if( ( tmp = odbx_field_value( m_result, 2 ) ) != NULL ) diff --git a/modules/opendbxbackend/odbxprivate.cc b/modules/opendbxbackend/odbxprivate.cc index 52143fadc..40961400a 100644 --- a/modules/opendbxbackend/odbxprivate.cc +++ b/modules/opendbxbackend/odbxprivate.cc @@ -215,7 +215,7 @@ bool OdbxBackend::getDomainList( const string& stmt, vector* list, b if( ( tmp = odbx_field_value( m_result, 1 ) ) != NULL ) { - di.zone = DNSName( tmp, odbx_field_length( m_result, 1 ) ); + di.zone = DNSName( string(tmp, odbx_field_length( m_result, 1 )) ); } if( ( tmp = odbx_field_value( m_result, 0 ) ) != NULL ) diff --git a/pdns/dnsdist-lua.cc b/pdns/dnsdist-lua.cc index be5d8496c..dd22c7404 100644 --- a/pdns/dnsdist-lua.cc +++ b/pdns/dnsdist-lua.cc @@ -284,7 +284,7 @@ vector> setupLua(bool client, const std::string& confi g_lua.writeFunction("addDomainBlock", [](const std::string& domain) { SuffixMatchNode smn; - smn.add(domain); + smn.add(DNSName(domain)); g_rulactions.modify([smn](decltype(g_rulactions)::value_type& rulactions) { rulactions.push_back({ std::make_shared(smn), diff --git a/pdns/dnsdist.cc b/pdns/dnsdist.cc index b1d58531d..5ef526fd2 100644 --- a/pdns/dnsdist.cc +++ b/pdns/dnsdist.cc @@ -555,7 +555,7 @@ bool upCheck(const ComboAddress& remote) try { vector packet; - DNSPacketWriter dpw(packet, "a.root-servers.net.", QType::A); + DNSPacketWriter dpw(packet, DNSName("a.root-servers.net."), QType::A); dpw.getHeader()->rd=true; Socket sock(remote.sin4.sin_family, SOCK_DGRAM);