@@ -519,15 +519,17 @@ def self.open(args)
519
519
# response codes instead of a simple numeric code.
520
520
#++
521
521
def get_operation_result
522
+ result = @result
523
+ result = result . result if result . is_a? ( Net ::LDAP ::PDU )
522
524
os = OpenStruct . new
523
- if @ result. is_a? ( Hash )
525
+ if result . is_a? ( Hash )
524
526
# We might get a hash of LDAP response codes instead of a simple
525
527
# numeric code.
526
- os . code = ( @ result[ :resultCode ] || "" ) . to_i
527
- os . error_message = @ result[ :errorMessage ]
528
- os . matched_dn = @ result[ :matchedDN ]
529
- elsif @ result
530
- os . code = @ result
528
+ os . code = ( result [ :resultCode ] || "" ) . to_i
529
+ os . error_message = result [ :errorMessage ]
530
+ os . matched_dn = result [ :matchedDN ]
531
+ elsif result
532
+ os . code = result
531
533
else
532
534
os . code = 0
533
535
end
@@ -649,7 +651,7 @@ def search(args = {})
649
651
if return_result_set
650
652
( !@result . nil? && @result . result_code == 0 ) ? result_set : nil
651
653
else
652
- @result
654
+ @result . success?
653
655
end
654
656
end
655
657
@@ -723,7 +725,7 @@ def bind(auth = @auth)
723
725
end
724
726
end
725
727
726
- @result
728
+ @result . success?
727
729
end
728
730
729
731
# #bind_as is for testing authentication credentials.
@@ -825,7 +827,7 @@ def add(args)
825
827
conn . close if conn
826
828
end
827
829
end
828
- @result
830
+ @result . success?
829
831
end
830
832
831
833
# Modifies the attribute values of a particular entry on the LDAP
@@ -924,7 +926,7 @@ def modify(args)
924
926
end
925
927
end
926
928
927
- @result
929
+ @result . success?
928
930
end
929
931
930
932
# Add a value to an attribute. Takes the full DN of the entry to modify,
@@ -995,7 +997,7 @@ def rename(args)
995
997
conn . close if conn
996
998
end
997
999
end
998
- @result
1000
+ @result . success?
999
1001
end
1000
1002
alias_method :modify_rdn , :rename
1001
1003
@@ -1023,7 +1025,7 @@ def delete(args)
1023
1025
conn . close
1024
1026
end
1025
1027
end
1026
- @result
1028
+ @result . success?
1027
1029
end
1028
1030
1029
1031
# Delete an entry from the LDAP directory along with all subordinate entries.
0 commit comments