Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

authenticator raised exception instead of error return when password is not provided #9762

Closed
zmstone opened this issue Jan 14, 2023 · 0 comments · Fixed by #9763
Closed
Labels

Comments

@zmstone
Copy link
Member

zmstone commented Jan 14, 2023

What happened?

when connect with mosquitto_pub -h localhost -p 1883 -t 't/a' -m 'hello' -q 1 -u aaa, the process crashes as:

e5.0.14-g1f7d1ed4(emqx@127.0.0.1)1> 2023-01-14T13:13:47.063893+01:00 [warning] authenticator: <<"password_based:built_in_database">>, clientid: MzA4NzQyODY1NDA2MTUzMzgzNjMwNjEyMDQ0NTkwNjEyNDI, exception: error, line: 667, mfa: emqx_authentication:do_authenticate/3, msg: authenticator_error, peername: 127.0.0.1:37176, reason: function_clause, stacktrace: [{emqx_passwd,hash,[{sha256,<<"b4bc1accc9b5d7ac416c3ab672a24848">>,suffix},undefined],[{file,"emqx_passwd.erl"},{line,80}]},{emqx_passwd,check_pass,3,[{file,"emqx_passwd.erl"},{line,76}]},{emqx_authn_mnesia,authenticate,2,[{file,"emqx_authn_mnesia.erl"},{line,180}]},{emqx_authentication,authenticate_with_provider,2,[{file,"emqx_authentication.erl"},{line,678}]},{emqx_authentication,do_authenticate,3,[{file,"emqx_authentication.erl"},{line,646}]},{emqx_authentication,authenticate,2,[{file,"emqx_authentication.erl"},{line,251}]},{emqx_hooks,safe_execute,2,[{file,"emqx_hooks.erl"},{line,200}]},{emqx_hooks,do_run_fold,3,[{file,"emqx_hooks.erl"},{line,180}]},{emqx_access_control,authenticate,1,[{file,"emqx_access_control.erl"},{line,144}]},{emqx_channel,do_authenticate,2,[{file,"emqx_channel.erl"},{line,1714}]},{emqx_channel,handle_in,2,[{file,"emqx_channel.erl"},{line,360}]},{emqx_connection,with_channel,3,[{file,"emqx_connection.erl"},{line,790}]},{emqx_connection,process_msg,2,[{file,"emqx_connection.erl"},{line,466}]},{emqx_connection,process_msg,2,[{file,"emqx_connection.erl"},{line,472}]},{emqx_connection,handle_recv,3,[{file,"emqx_connection.erl"},{line,428}]},{proc_lib,wake_up,3,[{file,"proc_lib.erl"},{line,236}]}], tag: AUTHN

What did you expect to happen?

return error to the client

How can we reproduce it (as minimally and precisely as possible)?

No response

Anything else we need to know?

No response

EMQX version

$ ./bin/emqx_ctl broker
# paste output here

OS version

# On Linux:
$ cat /etc/os-release
# paste output here
$ uname -a
# paste output here

# On Windows:
C:\> wmic os get Caption, Version, BuildNumber, OSArchitecture
# paste output here

Log files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant