]> granicus.if.org Git - pdns/commitdiff
further dnsname fixups for dnsdist and opendbx
authorbert hubert <bert.hubert@powerdns.com>
Mon, 28 Sep 2015 08:21:04 +0000 (10:21 +0200)
committerbert hubert <bert.hubert@powerdns.com>
Mon, 28 Sep 2015 08:21:04 +0000 (10:21 +0200)
modules/opendbxbackend/odbxbackend.cc
modules/opendbxbackend/odbxprivate.cc
pdns/dnsdist-lua.cc
pdns/dnsdist.cc

index a3ffaa7b7d3fcfcc74eb82048775f4624349eafa..0d580879070eba72e5a91ba0a2b49c319e993a6a 100644 (file)
@@ -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 )
index 52143fadc00e7bcabcdf31c2dcf96bd455caf3ef..40961400ab638c6290bc051e77ed29bd7988fcb7 100644 (file)
@@ -215,7 +215,7 @@ bool OdbxBackend::getDomainList( const string& stmt, vector<DomainInfo>* 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 )
index be5d8496c3e41e5d14b95b1556c73cba85f135e1..dd22c7404a470e3896014febac4520384b47ec47 100644 (file)
@@ -284,7 +284,7 @@ vector<std::function<void(void)>> 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<SuffixMatchNodeRule>(smn), 
index b1d58531dd006c3557da681369f05c77b9da383a..5ef526fd24d09585f9422b1d99b7e7959fdff2e5 100644 (file)
@@ -555,7 +555,7 @@ bool upCheck(const ComboAddress& remote)
 try
 {
   vector<uint8_t> 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);