25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-20 16:15:59 +01:00

Do not auto append IP suffix to usernames (#1008)

This commit is contained in:
Evgeniy Khramtsov 2016-03-22 13:25:34 +03:00
parent f8cf1aef91
commit 57f7b34b90

View File

@ -898,8 +898,7 @@ db_opts(Host) ->
<<"">>),
case Type of
mssql ->
Username = get_mssql_user(Server, User),
[odbc, <<"DSN=", Host/binary, ";UID=", Username/binary,
[odbc, <<"DSN=", Host/binary, ";UID=", User/binary,
";PWD=", Pass/binary>>];
_ ->
[Type, Server, Port, DB, User, Pass]
@ -959,21 +958,6 @@ init_mssql(Host) ->
Err
end.
get_mssql_user(Server, User) ->
HostName = case inet_parse:address(binary_to_list(Server)) of
{ok, _} ->
Server;
{error, _} ->
hd(str:tokens(Server, <<".">>))
end,
UserName = case str:chr(User, $@) of
0 ->
<<User/binary, $@, HostName/binary>>;
_ ->
User
end,
UserName.
tmp_dir() ->
filename:join(["/tmp", "ejabberd"]).