From 7e2219a10be897d88811553f890a37e8bcc8f340 Mon Sep 17 00:00:00 2001 From: Peter van Dijk Date: Fri, 30 Nov 2012 11:24:15 +0000 Subject: [PATCH] allow overriding base dn for AXFR subtree search, closing #536 git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@2934 d19b8d6e-7fed-0310-83ef-9ca221ded41b --- modules/ldapbackend/ldapbackend.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/ldapbackend/ldapbackend.cc b/modules/ldapbackend/ldapbackend.cc index 40da3998c..f83f8031d 100644 --- a/modules/ldapbackend/ldapbackend.cc +++ b/modules/ldapbackend/ldapbackend.cc @@ -134,7 +134,10 @@ inline bool LdapBackend::list_simple( const string& target, int domain_id ) if( m_result.count( "dn" ) && !m_result["dn"].empty() ) { - dn = m_result["dn"][0]; + if( !mustDo( "basedn-axfr-override" ) ) + { + dn = m_result["dn"][0]; + } m_result.erase( "dn" ); } @@ -531,6 +534,7 @@ public: declare( suffix, "host", "One or more LDAP server with ports or LDAP URIs (separated by spaces)","ldap://127.0.0.1:389/" ); declare( suffix, "starttls", "Use TLS to encrypt connection (unused for LDAP URIs)", "no" ); declare( suffix, "basedn", "Search root in ldap tree (must be set)","" ); + declare( suffix, "basedn-axfr-override", "Override base dn for AXFR subtree search", "no" ); declare( suffix, "binddn", "User dn for non anonymous binds","" ); declare( suffix, "secret", "User password for non anonymous binds", "" ); declare( suffix, "timeout", "Seconds before connecting to server fails", "5" ); -- 2.40.0