fix(web/panettone): unbind LDAP connections after auth
unbind & close the stream of newly created LDAP connections after auth, which might prevent some of the resource leaking we've got going on i did actually verify in sly that this still works. yay. Change-Id: I92c8ca20de642585ae4c24aa455d051ee6e44a87 Reviewed-on: https://cl.tvl.fyi/c/depot/+/5193 Tested-by: BuildkiteCI Reviewed-by: grfn <grfn@gws.fyi>
This commit is contained in:
parent
0d0b43ed88
commit
67a31e7252
1 changed files with 10 additions and 10 deletions
|
@ -104,12 +104,12 @@ request against the ldap server at *ldap*. Returns the user if authentication is
|
|||
successful, `nil' otherwise"
|
||||
(when-let ((user (if (typep user-or-username 'user) user-or-username
|
||||
(find-user user-or-username))))
|
||||
(let ((dn (dn user)))
|
||||
(let ((code-sym
|
||||
(nth-value 1 (ldap:bind
|
||||
(ldap:new-ldap :host (ldap:host *ldap*)
|
||||
(let* ((dn (dn user))
|
||||
(conn (ldap:new-ldap :host (ldap:host *ldap*)
|
||||
:port (ldap:port *ldap*)
|
||||
:user dn
|
||||
:pass password)))))
|
||||
:pass password))
|
||||
(code-sym (nth-value 1 (unwind-protect (ldap:bind conn)
|
||||
(ldap:unbind conn)))))
|
||||
(when (equalp code-sym 'trivial-ldap:success)
|
||||
user)))))
|
||||
user))))
|
||||
|
|
Loading…
Reference in a new issue