[erlang-questions] eldap hangs

Technion technion@REDACTED
Fri Jun 29 14:48:05 CEST 2018


Hi Dmitry,


Thanks a heap, you are correct.


The process does disappear after the incorrect password.


10>  process_info(H).
undefined




________________________________
From: erlang-questions-bounces@REDACTED <erlang-questions-bounces@REDACTED> on behalf of Dmitry Klionsky <dm.klionsky@REDACTED>
Sent: Friday, 29 June 2018 10:14 PM
To: erlang-questions@REDACTED
Subject: Re: [erlang-questions] eldap hangs


The wrong password call raised an exception and the process behind H (<0.131.0> is dead.

And I think this is the reason of hang.


You can start your session with


> catch_exception(true).


This is catch exceptions and your H will survive the crash and should work.



On 06/29/2018 03:07 PM, Technion wrote:

Hi,


I seem to have a replicable hang in the eldap module. Allow me to start with a working example. If it matters, the LDAP server is a Samba4 AD server. Before anyone asks, these are throw away passwords.


Erlang/OTP 21 [erts-10.0] [source] [64-bit] [smp:1:1] [ds:1:1:10] [async-threads:1] [hipe]

Eshell V10.0  (abort with ^G)
1> ===> The rebar3 shell is a development tool; to deploy applications in production, consider using releases (http://www.rebar3.org/docs/releases)
===> Booted p3
===> Booted sasl

1> {ok, H} = eldap:open(["127.0.0.1"], [{port, 1636}, {ssl, true}, {timeout, 500}]).
{ok,<0.131.0>}
2> ok = eldap:simple_bind(H, "Kevin@REDACTED"<mailto:Kevin@REDACTED>, "Kevin111").
ok

So we definitely have of using this. Now let's see what happens in a new session if we first get the username wrong, then try it correctly:

1> {ok, H} = eldap:open(["127.0.0.1"], [{port, 1636}, {ssl, true}, {timeout, 500}]).
{ok,<0.131.0>}
2>  ok = eldap:simple_bind(H, "Kevin", "Kevin111").
** exception error: no match of right hand side value {error,invalidCredentials}
3> ok = eldap:simple_bind(H, "Kevin@REDACTED"<mailto:Kevin@REDACTED>, "Kevin111").
<indefinite hang>

Given I'm trying to build an interface where users can enter their own username, well it creates an easily hung session. The docs describe a timeout on open/2 but it obviously doesn't apply to everything. Given I"m not seeing any output at all I have no real idea where to debug this.


Any assistance appreciated.




_______________________________________________
erlang-questions mailing list
erlang-questions@REDACTED<mailto:erlang-questions@REDACTED>
http://erlang.org/mailman/listinfo/erlang-questions



--
BR,
Dmitry

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20180629/1728137b/attachment.htm>


More information about the erlang-questions mailing list