* scheme/ldap.scm (ldap-init): make port optional argument,
accept list of hosts as argument. (ldap-simple-bind-as-nobody): new function
This commit is contained in:
parent
e142fab52a
commit
f3a509e5a7
|
@ -14,17 +14,21 @@
|
|||
(host port)
|
||||
"scsh_ldap_init")
|
||||
|
||||
(define (ldap-init host-name port . args)
|
||||
(define (ldap-init host-name-or-list . args)
|
||||
(let-optionals args
|
||||
((implicit-unbind-ok? #f)
|
||||
((port 0) ; use default port
|
||||
(implicit-unbind-ok? #f)
|
||||
(unbind-automatically? #t))
|
||||
(let ((session (ldap-init-internal host-name port))
|
||||
(options (make-session-options implicit-unbind-ok?
|
||||
unbind-automatically?)))
|
||||
(add-finalizer! ldap-session-finalizer session)
|
||||
(set-ldap-session-bound?! session #f)
|
||||
(set-ldap-session-options! session options)
|
||||
session)))
|
||||
(let ((hosts (if (list? host-name-or-list)
|
||||
(string-join host-name-or-list)
|
||||
host-name-or-list)))
|
||||
(let ((session (ldap-init-internal hosts port))
|
||||
(options (make-session-options implicit-unbind-ok?
|
||||
unbind-automatically?)))
|
||||
(add-finalizer! session ldap-session-finalizer)
|
||||
(set-ldap-session-bound?! session #f)
|
||||
(set-ldap-session-options! session options)
|
||||
session))))
|
||||
|
||||
;;; SIMPLE_BIND_S
|
||||
|
||||
|
@ -40,6 +44,9 @@
|
|||
(set-ldap-session-bound?! session #t)
|
||||
(raise-ldap-condition ret-obj session))))
|
||||
|
||||
(define (ldap-simple-bind-as-nobody session)
|
||||
(ldap-simple-bind session #f #f))
|
||||
|
||||
;;; SASL_BIND_S
|
||||
|
||||
(import-lambda-definition ldap-sasl-bind-internal
|
||||
|
|
Loading…
Reference in New Issue