#endif
#include "ldapbackend.hh"
-
-
unsigned int ldap_host_index = 0;
-
-
LdapBackend::LdapBackend( const string &suffix )
{
string hoststr;
try
{
m_msgid = 0;
- m_qname = "";
+ m_qname.clear();
m_pldap = NULL;
m_qlog = arg().mustDo( "query-logging" );
m_default_ttl = arg().asNum( "default-ttl" );
}
catch( LDAPTimeout < )
{
- L << Logger::Warning << m_myname << " Unable to get zone " + target + " from LDAP directory: " << lt.what() << endl;
+ L << Logger::Warning << m_myname << " Unable to get zone " << target << " from LDAP directory: " << lt.what() << endl;
throw( DBException( "LDAP server timeout" ) );
}
catch( LDAPException &le )
{
- L << Logger::Error << m_myname << " Unable to get zone " + target + " from LDAP directory: " << le.what() << endl;
+ L << Logger::Error << m_myname << " Unable to get zone " << target << " from LDAP directory: " << le.what() << endl;
throw( PDNSException( "LDAP server unreachable" ) ); // try to reconnect to another server
}
catch( std::exception &e )
vector<string>::iterator i;
for( 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 */ ) {
- m_adomains.push_back( *i );
+ m_adomains.push_back( DNSName(*i) );
}
}
m_result.erase( "associatedDomain" );
vector<string>::iterator i;
for( 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 */ ) {
- m_adomains.push_back( *i );
+ m_adomains.push_back( DNSName(*i) );
}
}
m_result.erase( "associatedDomain" );
di.id = 0;
di.serial = sd.serial;
- di.zone = domain;
+ di.zone = DNSName(domain);
di.last_check = 0;
di.backend = this;
di.kind = DomainInfo::Master;
do
{
di.id = 0;
- di.zone = "";
+ di.zone.clear();
di.masters.clear();
di.last_check = 0;
di.notified_serial = 0;
if( sd.nameserver.empty() )
{
- sd.nameserver = arg()["default-soa-name"];
+ sd.nameserver = DNSName(arg()["default-soa-name"]);
}
if( sd.hostmaster.empty() )
{
- sd.hostmaster = "hostmaster." + domain;
+ sd.hostmaster = DNSName("hostmaster") + DNSName(domain);
}
sd.db = this;
if( m_qname.empty() && ( tmp = odbx_field_value( m_result, 1 ) ) != NULL )
{
- rr.qname = string( tmp, odbx_field_length( m_result, 1 ) );
+ rr.qname = DNSName( tmp, odbx_field_length( m_result, 1 ) );
}
if( ( tmp = odbx_field_value( m_result, 2 ) ) != NULL )
if( ( tmp = odbx_field_value( m_result, 1 ) ) != NULL )
{
- di.zone = string( tmp, odbx_field_length( m_result, 1 ) );
+ di.zone = DNSName( tmp, odbx_field_length( m_result, 1 ) );
}
if( ( tmp = odbx_field_value( m_result, 0 ) ) != NULL )