def search(options={}, &block)
super(options) do |base, scope, filter, attrs, limit, callback|
begin
i = 0
execute(:search, base, scope, filter, attrs) do |entry|
i += 1
attributes = {}
entry.attrs.each do |attr|
attributes[attr] = entry.vals(attr)
end
callback.call([entry.dn, attributes], block)
break if limit and limit <= i
end
rescue RuntimeError
if $!.message == "no result returned by search"
@logger.debug do
args = [filter, attrs.inspect]
_("No matches: filter: %s: attributes: %s") % args
end
else
raise
end
end
end
end