Class: Net::LDAP::PDU

Inherits:
Object
  • Object
show all
Defined in:
lib/rex/proto/ldap.rb

Instance Method Summary collapse

Instance Method Details

#parse_extended_response(sequence) ⇒ Object

Monkeypatch upstream library to support the extended Whoami request. Delete this after github.com/ruby-ldap/ruby-net-ldap/pull/425 is landed. This is not the only occurrence of a patch for this functionality.



490
491
492
493
494
495
496
497
498
# File 'lib/rex/proto/ldap.rb', line 490

def parse_extended_response(sequence)
  sequence.length.between?(3, 5) or raise Net::LDAP::PDU::Error, "Invalid LDAP result length."
  @ldap_result = {
    :resultCode => sequence[0],
    :matchedDN => sequence[1],
    :errorMessage => sequence[2],
  }
  @extended_response = sequence.last
end