diff --git a/scheme/ldap.scm b/scheme/ldap.scm index 76a929c..3550295 100644 --- a/scheme/ldap.scm +++ b/scheme/ldap.scm @@ -28,6 +28,7 @@ (add-finalizer! session ldap-session-finalizer) (set-ldap-session-bound?! session #f) (set-ldap-session-options! session options) + (set-ldap-session-messages! session '()) session)))) ;;; SIMPLE_BIND_S @@ -105,9 +106,9 @@ (apply values (if (not timeout-seconds) (ldap-search-internal - session base scope filter attr-list attributes-only?) + session base scope-id filter attr-list attributes-only?) (ldap-search-with-timeout-internal - session base scope filter attr-list attributes-only? + session base scope-id filter attr-list attributes-only? timeout-seconds (or timeout-microseconds 0))))) (lambda (ret-code message) (let ((ret-obj @@ -116,7 +117,7 @@ (begin (ldap-session-messages-adjoin! session message) (add-finalizer! message ldap-message-finalizer) - message) + (make-ldap-entry message)) (raise-ldap-condition ret-obj session)))))))) ;;; GET/SET session options @@ -156,8 +157,9 @@ "scsh_ldap_error_string") (define (ldap-get-error-return-object session) - (ldap-session-option session - (ldap-session-option-value error-number))) + (convert-ldap-return-code + (ldap-session-option + session (ldap-session-option-value error-number)))) ;;; FIRST/NEXT_MESSAGE, COUNT_MESSAGES @@ -232,7 +234,7 @@ (call-with-values (lambda () (apply values - (ldap-first-attribute-internal session entry))) + (ldap-first-attribute-internal session (ldap-entry-message entry)))) (lambda (attribute-name ber-element) (if attribute-name (begin @@ -241,7 +243,7 @@ (raise-ldap-condition (ldap-get-error-return-object session) session))))) (define (ldap-next-attribute session entry ber-element) - (or (ldap-next-attribute-internal session entry ber-element) + (or (ldap-next-attribute-internal session (ldap-entry-message entry) ber-element) (let ((ret-obj (ldap-get-error-return-object session))) (if (ldap-success? ret-obj) #f