From: Peter van Dijk Date: Thu, 7 Jan 2016 16:28:07 +0000 (+0100) Subject: get root dots X-Git-Tag: auth-4.0.0-alpha2~62^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6013a9878f621b6b87bf45c5b1076499da1e19f0;p=pdns get root dots --- diff --git a/modules/ldapbackend/ldapbackend.cc b/modules/ldapbackend/ldapbackend.cc index 8e01a5ff1..0493aea76 100644 --- a/modules/ldapbackend/ldapbackend.cc +++ b/modules/ldapbackend/ldapbackend.cc @@ -93,7 +93,7 @@ bool LdapBackend::list( const DNSName& target, int domain_id, bool include_disab try { m_qname = target; - m_axfrqlen = target.toStringNoDot().length(); + m_axfrqlen = target.toStringRootDot().length(); m_adomain = m_adomains.end(); // skip loops in get() first time return (this->*m_list_fcnt)( target, domain_id ); @@ -127,7 +127,7 @@ inline bool LdapBackend::list_simple( const DNSName& target, int domain_id ) dn = getArg( "basedn" ); - qesc = toLower( m_pldap->escape( target.toString() ) ); + qesc = toLower( m_pldap->escape( target.toStringRootDot() ) ); // search for SOARecord of target filter = strbind( ":target:", "&(associatedDomain=" + qesc + ")(sOARecord=*)", getArg( "filter-axfr" ) ); @@ -174,7 +174,7 @@ void LdapBackend::lookup( const QType &qtype, const DNSName &qname, DNSPacket *d m_qname = qname; m_adomain = m_adomains.end(); // skip loops in get() first time - if( m_qlog ) { L.log( "Query: '" + qname.toString() + "|" + qtype.getName() + "'", Logger::Error ); } + if( m_qlog ) { L.log( "Query: '" + qname.toStringRootDot() + "|" + qtype.getName() + "'", Logger::Error ); } (this->*m_lookup_fcnt)( qtype, qname, dnspkt, zoneid ); } catch( LDAPTimeout < ) @@ -203,7 +203,7 @@ void LdapBackend::lookup_simple( const QType &qtype, const DNSName &qname, DNSPa const char* attronly[] = { NULL, "dNSTTL", "modifyTimestamp", NULL }; - qesc = toLower( m_pldap->escape( qname.toString() ) ); + qesc = toLower( m_pldap->escape( qname.toStringRootDot() ) ); filter = "associatedDomain=" + qesc; if( qtype.getCode() != QType::ANY ) @@ -231,7 +231,7 @@ void LdapBackend::lookup_strict( const QType &qtype, const DNSName &qname, DNSPa const char* attronly[] = { NULL, "dNSTTL", "modifyTimestamp", NULL }; - qesc = toLower( m_pldap->escape( qname.toString() ) ); + qesc = toLower( m_pldap->escape( qname.toStringRootDot() ) ); stringtok( parts, qesc, "." ); len = qesc.length(); @@ -275,7 +275,7 @@ void LdapBackend::lookup_tree( const QType &qtype, const DNSName &qname, DNSPack vector parts; - qesc = toLower( m_pldap->escape( qname.toString() ) ); + qesc = toLower( m_pldap->escape( qname.toStringRootDot() ) ); filter = "associatedDomain=" + qesc; if( qtype.getCode() != QType::ANY ) @@ -352,7 +352,7 @@ inline bool LdapBackend::prepare_simple() if( m_result.count( "associatedDomain" ) ) { for(auto i = m_result["associatedDomain"].begin(); i != m_result["associatedDomain"].end(); i++ ) { - if( i->size() >= m_axfrqlen && i->substr( i->size() - m_axfrqlen, m_axfrqlen ) == m_qname.toString() /* ugh */ ) { + if( i->size() >= m_axfrqlen && i->substr( i->size() - m_axfrqlen, m_axfrqlen ) == m_qname.toStringRootDot() /* ugh */ ) { m_adomains.push_back( DNSName(*i) ); } } @@ -381,7 +381,7 @@ inline bool LdapBackend::prepare_strict() if( m_result.count( "associatedDomain" ) ) { for(auto i = m_result["associatedDomain"].begin(); i != m_result["associatedDomain"].end(); i++ ) { - if( i->size() >= m_axfrqlen && i->substr( i->size() - m_axfrqlen, m_axfrqlen ) == m_qname.toString() /* ugh */ ) { + if( i->size() >= m_axfrqlen && i->substr( i->size() - m_axfrqlen, m_axfrqlen ) == m_qname.toStringRootDot() /* ugh */ ) { m_adomains.push_back( DNSName(*i) ); } }