25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-30 16:36:29 +01:00

Show HTTP auth username and IP address in logs, not the password (EJAB-1231)

This commit is contained in:
Badlop 2010-05-12 10:27:47 +02:00
parent 611a9c0136
commit e7d70933ac

View File

@ -188,8 +188,11 @@ process(["server", SHost | RPath] = Path, #request{auth = Auth, lang = Lang, hos
[{"WWW-Authenticate", "basic realm=\"ejabberd\""}], [{"WWW-Authenticate", "basic realm=\"ejabberd\""}],
ejabberd_web:make_xhtml([?XCT('h1', "Unauthorized")])}; ejabberd_web:make_xhtml([?XCT('h1', "Unauthorized")])};
{unauthorized, Error} -> {unauthorized, Error} ->
?WARNING_MSG("Access ~p failed with error: ~p", {BadUser, _BadPass} = Auth,
[Auth, Error]), {IPT, _Port} = Request#request.ip,
IPS = inet_parse:ntoa(IPT),
?WARNING_MSG("Access of ~p from ~p failed with error: ~p",
[BadUser, IPS, Error]),
{401, {401,
[{"WWW-Authenticate", [{"WWW-Authenticate",
"basic realm=\"auth error, retry login to ejabberd\""}], "basic realm=\"auth error, retry login to ejabberd\""}],
@ -211,8 +214,11 @@ process(RPath, #request{auth = Auth, lang = Lang, host = HostHTTP, method = Meth
[{"WWW-Authenticate", "basic realm=\"ejabberd\""}], [{"WWW-Authenticate", "basic realm=\"ejabberd\""}],
ejabberd_web:make_xhtml([?XCT('h1', "Unauthorized")])}; ejabberd_web:make_xhtml([?XCT('h1', "Unauthorized")])};
{unauthorized, Error} -> {unauthorized, Error} ->
?WARNING_MSG("Access ~p failed with error: ~p", {BadUser, _BadPass} = Auth,
[Auth, Error]), {IPT, _Port} = Request#request.ip,
IPS = inet_parse:ntoa(IPT),
?WARNING_MSG("Access of ~p from ~p failed with error: ~p",
[BadUser, IPS, Error]),
{401, {401,
[{"WWW-Authenticate", [{"WWW-Authenticate",
"basic realm=\"auth error, retry login to ejabberd\""}], "basic realm=\"auth error, retry login to ejabberd\""}],