diff options
| -rw-r--r-- | src/rabbit_auth_mechanism_plain.erl | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/rabbit_auth_mechanism_plain.erl b/src/rabbit_auth_mechanism_plain.erl index 4171b99977..664a4ae90f 100644 --- a/src/rabbit_auth_mechanism_plain.erl +++ b/src/rabbit_auth_mechanism_plain.erl @@ -56,9 +56,10 @@ init(_Sock) -> []. handle_response(Response, _State) -> - case re:run(Response, "\\0([^\\0]*)", [{capture, all_but_first, binary}, - global]) of - {match, [[User],[Pass]]} -> + %% The '%%"' at the end of the next line is for Emacs + case re:run(Response, "^\\0([^\\0]*)\\0([^\\0]*)$",%%" + [{capture, all_but_first, binary}]) of + {match, [User, Pass]} -> rabbit_access_control:check_user_pass_login(User, Pass); _ -> {refused, io_lib:format("response ~p invalid", [Response])} |
