From: Grégory Oestreicher Date: Tue, 9 Jan 2018 16:03:54 +0000 (+0100) Subject: LDAP: fix getDomainInfo() to set this as di.backend (#6048) X-Git-Tag: dnsdist-1.3.0~157 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0ea33db0fdc2e81620c97fe765b0e15cef2723d5;p=pdns LDAP: fix getDomainInfo() to set this as di.backend (#6048) * LDAP: fix getDomainInfo() to set this as di.backend --- diff --git a/modules/ldapbackend/ldapbackend.cc b/modules/ldapbackend/ldapbackend.cc index 7ae451bc8..2998387a3 100644 --- a/modules/ldapbackend/ldapbackend.cc +++ b/modules/ldapbackend/ldapbackend.cc @@ -586,8 +586,6 @@ void LdapBackend::getUpdatedMasters( vector* domains ) if ( !getDomainInfo( DNSName( result["associatedDomain"][0] ), di ) ) continue; - di.backend = this; - if( di.notified_serial < di.serial ) domains->push_back( di ); } @@ -681,7 +679,6 @@ bool LdapBackend::getDomainInfo( const DNSName& domain, DomainInfo& di ) { string filter; SOAData sd; - int msgid=0; PowerLDAP::sentry_t result; const char* attronly[] = { "sOARecord", @@ -698,7 +695,7 @@ bool LdapBackend::getDomainInfo( const DNSName& domain, DomainInfo& di ) // search for SOARecord of domain filter = "(&(associatedDomain=" + toLower( m_pldap->escape( domain.toStringRootDot() ) ) + ")(SOARecord=*))"; m_msgid = m_pldap->search( getArg( "basedn" ), LDAP_SCOPE_SUBTREE, filter, attronly ); - m_pldap->getSearchEntry( msgid, result ); + m_pldap->getSearchEntry( m_msgid, result ); } catch( LDAPTimeout < ) { @@ -762,6 +759,7 @@ bool LdapBackend::getDomainInfo( const DNSName& domain, DomainInfo& di ) di.kind = DomainInfo::Native; } + di.backend = this; return true; }