# File lib/active_ldap/adapter/ldap_ext.rb, line 60
    def search_with_limit(base, scope, filter, attributes, limit, &block)
      if @@have_search_ext
        search_ext(base, scope, filter, attributes,
                   false, nil, nil, 0, 0, limit || 0, &block)
      else
        i = 0
        search(base, scope, filter, attributes) do |entry|
          i += 1
          block.call(entry)
          break if limit and limit <= i
        end
      end
    end