]> granicus.if.org Git - pdns/commitdiff
Fix lookups in strict mode and filter on the record type
authorGrégory Oestreicher <greg@kamago.net>
Sat, 24 Jun 2017 22:09:50 +0000 (00:09 +0200)
committerGrégory Oestreicher <greg@kamago.net>
Tue, 10 Apr 2018 20:41:26 +0000 (22:41 +0200)
modules/ldapbackend/native.cc

index fd14890913ed25de2e26e8d2118e70f0c8857185..980cfbce92e96c541ab70be446477a838a4a224d 100644 (file)
@@ -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" ) );