def ldap_members(cn, start=0)
      return [] if service.nil?
      # print "Getting members of #{cn} at index #{start}\n"
      entry = service.search(base: tree,
                             filter: Net::LDAP::Filter.equals('cn', cn),
                             attributes: ["member;range=#{start}-*"]).first
      return [] if entry.nil?

      field_name = entry.attribute_names[1] # Is this always ordered [dn, member]?
      return [] if field_name.nil? # Sometimes member is not present.

      range_end = field_name.to_s.match(/^member;range=\d+-([0-9*]+)$/)[1]
      # print "#{start}-#{range_end}\n"
      members = entry[field_name]#.collect { |mo| mo.split(',').first.split('=')[1] }
      members.concat ldap_members(cn, range_end.to_i+1) unless range_end == '*'
      return members
    end
def ldap_members(cn, start=0)
      return [] if service.nil?
      # print "Getting members of #{cn} at index #{start}\n"
      entry = service.search(base: tree,
                             filter: Net::LDAP::Filter.equals('cn', cn),
                             attributes: ["member;range=#{start}-*"]).first
      return [] if entry.nil?

      field_name = entry.attribute_names[1] # Is this always ordered [dn, member]?
      return [] if field_name.nil? # Sometimes member is not present.

      range_end = field_name.to_s.match(/^member;range=\d+-([0-9*]+)$/)[1]
      # print "#{start}-#{range_end}\n"
      members = entry[field_name]#.collect { |mo| mo.split(',').first.split('=')[1] }
      members.concat ldap_members(cn, range_end.to_i+1) unless range_end == '*'
      return members
    end
Gets the entire list of members for a CN.
 Handles range results.
 @param [String] cn of the entry to fetch.
 @param [Integer] start index of range result
 @return [Array] list of member CNs