Skip to content

Commit ecb3536

Browse files
lib/net/ldap.rb: Fix ntlm authentication. Change of library name.
1 parent d4a7355 commit ecb3536

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

lib/net/ldap.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ class LdapError < StandardError; end
256256
DerefAliases_Find = 2
257257
DerefAliases_Always = 3
258258
DerefAliasesArray = [ DerefAliases_Never, DerefAliases_Search, DerefAliases_Find, DerefAliases_Always ]
259-
259+
260260
primitive = { 2 => :null } # UnbindRequest body
261261
constructed = {
262262
0 => :array, # BindRequest
@@ -1125,7 +1125,7 @@ def search_subschema_entry
11251125
def paged_searches_supported?
11261126
# active directory returns that it supports paged results. However
11271127
# it returns binary data in the rfc2696_cookie which throws an
1128-
# encoding exception breaking searching.
1128+
# encoding exception breaking searching.
11291129
return false if @force_no_page
11301130
@server_caps ||= search_root_dse
11311131
@server_caps[:supportedcontrol].include?(Net::LDAP::LDAPControls::PAGED_RESULTS)
@@ -1332,20 +1332,20 @@ def bind_sasl(auth)
13321332
# Microsoft Active Directory.
13331333
#++
13341334
def bind_gss_spnego(auth)
1335-
require 'ntlm'
1335+
require 'net/ntlm'
13361336

13371337
user, psw = [auth[:username] || auth[:dn], auth[:password]]
13381338
raise Net::LDAP::LdapError, "Invalid binding information" unless (user && psw)
13391339

13401340
nego = proc { |challenge|
1341-
t2_msg = NTLM::Message.parse(challenge)
1341+
t2_msg = Net::NTLM::Message.parse(challenge)
13421342
t3_msg = t2_msg.response({ :user => user, :password => psw },
13431343
{ :ntlmv2 => true })
13441344
t3_msg.serialize
13451345
}
13461346

13471347
bind_sasl(:method => :sasl, :mechanism => "GSS-SPNEGO",
1348-
:initial_credential => NTLM::Message::Type1.new.serialize,
1348+
:initial_credential => Net::NTLM::Message::Type1.new.serialize,
13491349
:challenge_response => nego)
13501350
end
13511351
private :bind_gss_spnego
@@ -1409,7 +1409,7 @@ def search(args = {})
14091409
deref = args[:deref] || Net::LDAP::DerefAliases_Never
14101410
raise Net::LDAP::LdapError.new( "invalid alias dereferencing value" ) unless Net::LDAP::DerefAliasesArray.include?(deref)
14111411

1412-
1412+
14131413
# An interesting value for the size limit would be close to A/D's
14141414
# built-in page limit of 1000 records, but openLDAP newer than version
14151415
# 2.2.0 chokes on anything bigger than 126. You get a silent error that

0 commit comments

Comments
 (0)