@@ -523,15 +523,17 @@ def self.open(args)
523
523
# response codes instead of a simple numeric code.
524
524
#++
525
525
def get_operation_result
526
+ result = @result
527
+ result = result . result if result . is_a? ( Net ::LDAP ::PDU )
526
528
os = OpenStruct . new
527
- if @ result. is_a? ( Hash )
529
+ if result . is_a? ( Hash )
528
530
# We might get a hash of LDAP response codes instead of a simple
529
531
# numeric code.
530
- os . code = ( @ result[ :resultCode ] || "" ) . to_i
531
- os . error_message = @ result[ :errorMessage ]
532
- os . matched_dn = @ result[ :matchedDN ]
533
- elsif @ result
534
- os . code = @ result
532
+ os . code = ( result [ :resultCode ] || "" ) . to_i
533
+ os . error_message = result [ :errorMessage ]
534
+ os . matched_dn = result [ :matchedDN ]
535
+ elsif result
536
+ os . code = result
535
537
else
536
538
os . code = 0
537
539
end
@@ -653,7 +655,7 @@ def search(args = {})
653
655
if return_result_set
654
656
( !@result . nil? && @result . result_code == 0 ) ? result_set : nil
655
657
else
656
- @result
658
+ @result . success?
657
659
end
658
660
end
659
661
@@ -727,7 +729,7 @@ def bind(auth = @auth)
727
729
end
728
730
end
729
731
730
- @result
732
+ @result . success?
731
733
end
732
734
733
735
# #bind_as is for testing authentication credentials.
@@ -829,7 +831,7 @@ def add(args)
829
831
conn . close if conn
830
832
end
831
833
end
832
- @result
834
+ @result . success?
833
835
end
834
836
835
837
# Modifies the attribute values of a particular entry on the LDAP
@@ -928,7 +930,7 @@ def modify(args)
928
930
end
929
931
end
930
932
931
- @result
933
+ @result . success?
932
934
end
933
935
934
936
# Add a value to an attribute. Takes the full DN of the entry to modify,
@@ -999,7 +1001,7 @@ def rename(args)
999
1001
conn . close if conn
1000
1002
end
1001
1003
end
1002
- @result
1004
+ @result . success?
1003
1005
end
1004
1006
alias_method :modify_rdn , :rename
1005
1007
@@ -1027,7 +1029,7 @@ def delete(args)
1027
1029
conn . close
1028
1030
end
1029
1031
end
1030
- @result
1032
+ @result . success?
1031
1033
end
1032
1034
1033
1035
# Delete an entry from the LDAP directory along with all subordinate entries.
0 commit comments