From 83a868f5f04a09b32ab4908e29b44aa1464bdf45 Mon Sep 17 00:00:00 2001 From: paul Date: Thu, 29 Dec 2005 22:33:07 +0000 Subject: [PATCH] * Fixed bug in the LDAP domain backend, do not try to check if an address is already defined if there is no record for that address. * Fixed bug in the YAML account backend. A user may not exist, then its password is not findable and thus can not be crypted! git-svn-id: svn+ssh://svn.luon.net/svn/ildus/trunk@16 65a33f86-aa00-0410-91be-cd1bf5efb309 --- lib/ildus/server/account_backends/yaml.rb | 1 + lib/ildus/server/domain_backends/ldap.rb | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/ildus/server/account_backends/yaml.rb b/lib/ildus/server/account_backends/yaml.rb index 5bf3b91..8f24945 100644 --- a/lib/ildus/server/account_backends/yaml.rb +++ b/lib/ildus/server/account_backends/yaml.rb @@ -22,6 +22,7 @@ module Ildus::Server::AccountBackend case config['crypt'].to_sym when :unix regged_pass = @db[user] + return false if regged_pass.nil? self.auth = (pass.crypt(regged_pass) == regged_pass) else raise "unsupported crypt type: #{config['crypt']}" diff --git a/lib/ildus/server/domain_backends/ldap.rb b/lib/ildus/server/domain_backends/ldap.rb index 5f61e48..5332137 100644 --- a/lib/ildus/server/domain_backends/ldap.rb +++ b/lib/ildus/server/domain_backends/ldap.rb @@ -67,10 +67,12 @@ module Ildus::Server::DomainBackend raise Handler::HostNotFoundError if entry.nil? if addr.ipv4? - return false if entry['aRecord'][0] == addr.to_s + record = entry['aRecord'] + return false if record and record[0] == addr.to_s @ldap.modify(entry['dn'][0], {"aRecord" => [addr.to_s]}) elsif addr.ipv6? - return false if entry['aAAARecord'][0] == addr.to_s + record = entry['aAAARecord'] + return false if record and record[0] == addr.to_s @ldap.modify(entry['dn'][0], {"aAAARecord" => [addr.to_s]}) else return false