From 0235595a989f137dd6a6937d23992791aedf59b3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Gr=C3=A9gory=20Oestreicher?= Date: Sun, 25 Jun 2017 00:09:50 +0200 Subject: [PATCH] Fix lookups in strict mode and filter on the record type --- modules/ldapbackend/native.cc | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/modules/ldapbackend/native.cc b/modules/ldapbackend/native.cc index fd14890913..980cfbce92 100644 --- a/modules/ldapbackend/native.cc +++ b/modules/ldapbackend/native.cc @@ -210,13 +210,14 @@ void LdapBackend::lookup_strict( const QType &qtype, const DNSName &qname, DNSPa else // IPv4 and IPv6 lookups { filter = "associatedDomain=" + qesc; - if( qtype.getCode() != QType::ANY ) - { - attr = qtype.getName() + "Record"; - filter = "&(" + filter + ")(" + attr + "=*)"; - attronly[0] = attr.c_str(); - attributes = attronly; - } + } + + if( qtype.getCode() != QType::ANY ) + { + attr = qtype.getName() + "Record"; + filter = "&(" + filter + ")(" + attr + "=*)"; + attronly[0] = attr.c_str(); + attributes = attronly; } filter = strbind( ":target:", filter, getArg( "filter-lookup" ) ); -- 2.47.2