@@ -300,7 +300,7 @@ def encode_sort_controls(sort_definitions)
300300 control [ 2 ] = ( control [ 2 ] == true ) . to_ber
301301 control . to_ber_sequence
302302 end
303- sort_control = [
303+ [
304304 Net ::LDAP ::LDAPControls ::SORT_REQUEST . to_ber ,
305305 false . to_ber ,
306306 sort_control_values . to_ber_sequence . to_s . to_ber ,
@@ -467,6 +467,10 @@ def search(args = nil)
467467 end
468468 end
469469
470+ if result_pdu . nil?
471+ raise Net ::LDAP ::ResponseMissingOrInvalidError , "response missing"
472+ end
473+
470474 # count number of pages of results
471475 payload [ :page_count ] ||= 0
472476 payload [ :page_count ] += 1
@@ -606,7 +610,7 @@ def password_modify(args)
606610 pdu = queued_read ( message_id )
607611
608612 if !pdu || pdu . app_tag != Net ::LDAP ::PDU ::ExtendedResponse
609- raise Net ::LDAP ::ResponseMissingError , "response missing or invalid"
613+ raise Net ::LDAP ::ResponseMissingOrInvalidError , "response missing or invalid"
610614 end
611615
612616 pdu
@@ -706,7 +710,7 @@ def socket
706710 # Wrap around Socket.tcp to normalize with other Socket initializers
707711 class DefaultSocket
708712 def self . new ( host , port , socket_opts = { } )
709- Socket . tcp ( host , port , socket_opts )
713+ Socket . tcp ( host , port , ** socket_opts )
710714 end
711715 end
712716end # class Connection
0 commit comments