diff --git a/TODO b/TODO index 87f458e..468ab2e 100644 --- a/TODO +++ b/TODO @@ -2,7 +2,10 @@ * Put Protocol Errors in a separate module, document it better together with the protocol. +* Retrieve the system's hostname. +* Increase robustness for and error messages of erroneous commands. +* Support for multiple domains. = Known Issues -_Unknown as of yet_. +* ADDA/DELA commands still unimplemented. diff --git a/lib/ildus/server/domain_backends/ldap.rb b/lib/ildus/server/domain_backends/ldap.rb index db80dd1..75e76cf 100644 --- a/lib/ildus/server/domain_backends/ldap.rb +++ b/lib/ildus/server/domain_backends/ldap.rb @@ -44,13 +44,13 @@ module Ildus::Server::DomainBackend all_entries.each do |entry| assoc_dom, a_rr, aaaa_rr, cname_rr = ["associatedDomain", "aRecord", - "aAAArecord", "cNAMErecord"].map { |attr| entry[attr] } - host = assoc_dom.first.gsub(/\.#{config['domain']}$/, '') + "aAAARecord", "cNAMERecord"].map { |attr| entry[attr] } + host = assoc_dom.first.gsub(/\.#{config['name']}$/, '') entries[host].first.push(*a_rr) if a_rr entries[host].first.push(*aaaa_rr) if aaaa_rr if cname_rr - cname = cname_rr.first.gsub(/\.#{config['domain']}$/, '') + cname = cname_rr.first.gsub(/\.#{config['name']}$/, '') entries[cname].last << host end end # search @@ -62,7 +62,7 @@ module Ildus::Server::DomainBackend # correct IPv4 or IPv6 address format. def update_host(host, addr) entry = all_entries.find do |entry| - entry['associatedDomain'][0] == host + "." + config['domain'] + entry['associatedDomain'][0] == "#{host}.#{config['name']}" end raise Handler::HostNotFoundError if entry.nil? @@ -91,7 +91,7 @@ module Ildus::Server::DomainBackend # Returns the LDAP sOARecord for the configured domain. def soa_record @ldap.search2(config['base'], LDAP::LDAP_SCOPE_BASE, - "(&(associatedDomain=#{config['domain'].downcase})" \ + "(&(associatedDomain=#{config['name'].downcase})" \ " (sOARecord=*))").first end