Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
97 commits
Select commit Hold shift + click to select a range
983da9c
Relax digest-uri handling (thanks to Daniel Willmann)(EJAB-1529)
badlop Mar 16, 2012
3a51c80
Change log level from informational to error
Mar 19, 2012
6b38758
ODBC support for mod_muc
Mar 31, 2012
6ec5c7c
Use proper module name
Mar 31, 2012
585c5af
Add notes about mod_muc_odbc
Apr 2, 2012
866085c
Add ODBC exporting function for privacy table
Apr 2, 2012
b43444f
ODBC support for mod_announce
Apr 2, 2012
ca5f028
ODBC support for mod_vcard_xupdate
Apr 2, 2012
5fab000
ODBC support for mod_irc
Apr 3, 2012
41a0eae
ODBC support for mod_shared_roster
Apr 4, 2012
cea23b0
Get rid of duplicated code
Apr 6, 2012
1f1a98d
Properly handle HEAD request in mod_http_bind (this fixes EJAB-1538)
prefiks Apr 6, 2012
4637e2c
Avoid quadratic behavior in reading SSL data
alexeyshch Feb 20, 2012
af2e916
Don't ignore Length parameter in tls:recv
prefiks Apr 6, 2012
91964b1
Added missed tls:recv_data/2
alexeyshch Mar 23, 2012
09c75af
Make sure that res is initialized in all cases
prefiks Apr 6, 2012
5f82846
Parse correctly https request split into multiple packets
prefiks Apr 6, 2012
82468bf
Fix makefile rules for building dll-s in Makefile.win32 files
prefiks Apr 6, 2012
2c228e6
Don't use binary:match to extract lines from binaries
prefiks Apr 6, 2012
959e0ff
Remove obsoleted function call
Apr 9, 2012
5619d39
Add odbc modules to Makefile.win32
Apr 9, 2012
730dfe8
Add comments about Dialyzer warnings
badlop Apr 11, 2012
06f570f
return user affiliation for a specified node (thanks to Karim Gemayel…
Apr 11, 2012
e2d6bc9
Parse and encode https header names like native http parser does
prefiks Apr 11, 2012
86435ba
ODBC support for mod_blocking
Apr 12, 2012
169b83b
Handle the scenario of disabled mod_muc (EJAB-1553)
badlop Apr 14, 2012
4985968
Document how to provide a long announcement (EJAB-1553)
badlop Apr 14, 2012
017ce4e
Fix translation script to use ejabberd_regexp (EJAB-921)
badlop Apr 14, 2012
8bb58ba
Extract new strings
badlop Apr 14, 2012
58d49d2
Update Spanish translation
badlop Apr 14, 2012
5a09d67
Photos from LDAP not displayed in some clients, lacking TYPE (thanks …
badlop Apr 16, 2012
e616d26
Perform user part substitution in ldap_rfilter (EJAB-1555)
Apr 17, 2012
91f38cc
Extract new strings
badlop Apr 18, 2012
e034864
Update German translation (thanks to Nikolaus Polak)
badlop Apr 18, 2012
46c4f46
Update Esperanto translation (thanks to Andreas van Cranenburgh)
badlop Apr 18, 2012
f5df635
Update Dutch translation (thanks to Andreas van Cranenburgh)
badlop Apr 18, 2012
0b33732
Update Russian translation (thanks to Evgeniy Khramtsov)
badlop Apr 18, 2012
078f358
Update Turkish translation (thanks to Doruk Fisek)
badlop Apr 18, 2012
fafd605
Update Chinese translation (thanks to Shelley Shyan)
badlop Apr 18, 2012
310aa7a
Update Czech translation (thanks to Jan Pinkas)
badlop Apr 18, 2012
31c13cc
Remove useless mnesia call
Apr 20, 2012
eaa963a
Update Greek translation (thanks to James Iakovos Mandelis)
badlop Apr 18, 2012
4e0394c
Update Japanese translation (thanks to Mako N)
badlop Apr 18, 2012
3304ecd
Update Catalan translation (thanks to Jan Kusanagi)
badlop Apr 22, 2012
ba793af
Update Norwegian translation (thanks to Stian B. Barmen)
badlop Apr 22, 2012
52ff5de
Update Polish translation (thanks to Zbyszek Żółkiewski)
badlop Apr 22, 2012
2582a47
Update Portuguese-Brazil translation (thanks to Otávio Fernandes)
badlop Apr 22, 2012
752652e
Update German translation again (thanks to Nikolaus Polak)
badlop Apr 24, 2012
7dd1713
Fix English strings (thanks to Andreas van Cranenburgh)
badlop Apr 24, 2012
522eb0f
Update PO files manually according to the English fix
badlop Apr 24, 2012
7623ebd
mod_irc: Make use of MUC password
imax9000 Apr 24, 2012
5ed8959
Update Italian translation (thanks to Luca Brivio)
badlop Apr 24, 2012
6e2003c
Recompile translation files
badlop Apr 26, 2012
8688030
Add ejabberd 2.1.11 release notes
badlop Apr 26, 2012
453e249
Update ejabberd version number to 2.1.11
badlop Apr 26, 2012
437f68a
Merge SQL and Mnesia code into one module (EJAB-1560)
Apr 27, 2012
8b13226
Do not trigger item-not-found errors in mod_http_bind (part of EJABS-…
prefiks Apr 27, 2012
6719d96
Fix get_subscription_lists/4
Apr 29, 2012
e8921d7
Receiving missing http-bind request shouldn't close waiting out-ouf-o…
prefiks May 2, 2012
6c94d04
Repeated http-bind request should abort only requests with same rid
prefiks May 2, 2012
e5d5ea4
Revert "Update ejabberd version number to 2.1.11"
badlop May 15, 2012
bb026ef
Update Slovak translation (thanks to Marek Bečka)
badlop May 15, 2012
a99c1e7
Fix account registration
badlop Jun 6, 2012
bc07726
Fix MUC start when Mnesia tables don't exist yet
badlop Jun 8, 2012
75756f0
Check node name is available before starting ejabberd (EJAB-1572)
badlop Jun 8, 2012
2bf8125
Allow multiple fqdn values in configuration (EJAB-1578)
badlop Jun 27, 2012
4e6eff3
Fix file name of Name Service Switch (thanks to Konstantin Khomoutov)
badlop Jul 6, 2012
efc0b0b
Reduce size of XML stream state
jdziemidowicz Mar 22, 2012
0cc9205
Fix regression introduced in odbc/mnesia merge
Jul 17, 2012
e06c1c4
Disable SSL 2.0 in TLS driver
jdziemidowicz Jul 18, 2012
d2d5138
Disable old and unsecure ciphers in TLS driver
jdziemidowicz Jul 18, 2012
a407382
Enable ECDHE key exchange in TSL driver
jdziemidowicz Jul 18, 2012
bc65b50
Enable DHE key exchange in TLS driver
jdziemidowicz Jul 18, 2012
5e7a1c8
Detect OpenSSL version at runtime, not at compile time
jdziemidowicz Jul 24, 2012
4d54bce
Send announce Message stanzas as Headline type instead of Normal
badlop Jul 24, 2012
a47fd96
On shutdown, first stop listeners, then modules (thanks to Vishal Xic…
badlop Jul 25, 2012
4147081
Added clause so ejabberdctl number of arguments error report works wi…
badlop Aug 27, 2012
8a737f8
Add SCRAM and remove MD5 support to ejabberd commands auth verification
badlop Aug 27, 2012
2dc2769
Log IP address when auth attempt fails (thanks to Zach Calvert)
badlop Aug 27, 2012
625e801
Document in the guide the db_type modules option (EJAB-1560)
badlop Oct 3, 2012
ec51ba7
New Hebrew translation (thanks to Isratine Citizen)
badlop Oct 17, 2012
dfcdf1c
Fixed mod_offline:store_offline_msg argument (EJAB-1581)
alexeyshch Nov 9, 2012
9208f4d
Make terms serialization faster
Nov 18, 2012
2c26926
Copy, fix and document export2odbc command from mod_admin_extra.erl
badlop Nov 26, 2012
be33ab8
Fix broken JPEG photo (EJAB-1526)
Dec 12, 2012
1f290c8
Merge pull request #37 from rraptorr/tls
alexeyshch Dec 17, 2012
5a80d56
Updating mod_roster to allows ejabberd to store rosters in redis.
engobi Apr 21, 2013
b3105fd
Fix error in get_in_pending_subscriptions
May 2, 2013
1d778a3
Allowing ejabberd to connect to redis proxy nutcracker (ex twemproxy)
engobi May 23, 2013
b33dd2e
Updating mod_roster to allows ejabberd to store rosters in redis.
engobi Apr 21, 2013
169ddfb
Fix error in get_in_pending_subscriptions
engobi May 2, 2013
f8377b5
Allowing ejabberd to connect to redis proxy nutcracker (ex twemproxy)
engobi May 23, 2013
f1dbf76
Enabled connection to redis with a password
engobi May 27, 2013
dae48d2
Fix invalid argument error when askmessage field of the roster is empty
engobi Jun 18, 2013
42dda08
Sets default redis password value to none.
engobi Jun 18, 2013
8539af4
Fix item deletion from the roster
engobi Jun 18, 2013
da19e79
Add missing function
engobi Jun 18, 2013
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions contrib/extract_translations/extract_translations.erl
Original file line number Diff line number Diff line change
Expand Up @@ -281,14 +281,14 @@ build_additional_translators(List) ->
List).

print_translation(File, Line, Str, StrT) ->
{ok, StrQ, _} = regexp:gsub(Str, "\"", "\\\""),
{ok, StrTQ, _} = regexp:gsub(StrT, "\"", "\\\""),
StrQ = ejabberd_regexp:greplace(Str, "\\\"", "\\\\\""),
StrTQ = ejabberd_regexp:greplace(StrT, "\\\"", "\\\\\""),
io:format("#: ~s:~p~nmsgid \"~s\"~nmsgstr \"~s\"~n~n", [File, Line, StrQ, StrTQ]).

print_translation_obsolete(Str, StrT) ->
File = "unknown.erl",
Line = 1,
{ok, StrQ, _} = regexp:gsub(Str, "\"", "\\\""),
{ok, StrTQ, _} = regexp:gsub(StrT, "\"", "\\\""),
StrQ = ejabberd_regexp:greplace(Str, "\\\"", "\\\\\""),
StrTQ = ejabberd_regexp:greplace(StrT, "\\\"", "\\\\\""),
io:format("#: ~s:~p~n#~~ msgid \"~s\"~n#~~ msgstr \"~s\"~n~n", [File, Line, StrQ, StrTQ]).

54 changes: 39 additions & 15 deletions doc/guide.html

Large diffs are not rendered by default.

127 changes: 57 additions & 70 deletions doc/guide.tex

Large diffs are not rendered by default.

58 changes: 58 additions & 0 deletions doc/release_notes_2.1.11.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@

Release Notes
ejabberd 2.1.11

ejabberd 2.1.11 includes a few bugfixes and improvements.

Read more details about the changes in:
http://redir.process-one.net/ejabberd-2.1.11

Download the source code and installers from:
http://www.process-one.net/en/ejabberd/


The major changes are:

* HTTP service
- Fix ejabberd_http:get_line
- Don't use binary:match to extract lines from binaries
- Parse and encode https header names like native http parser does
- Parse correctly https request split into multiple packets
- Properly handle HEAD request in mod_http_bind (EJAB-1538)
- New option default_host for handling requests with ambiguous Host (EJAB-1261)

* ODBC
- New ODBC support for mod_announce
- New ODBC support for mod_blocking
- New ODBC support for mod_irc
- New ODBC support for mod_muc
- New ODBC support for mod_shared_roster
- New ODBC support for mod_vcard_xupdate
- Add ODBC exporting function for privacy table
- Work also with some unicode strings in PgSQL (EJAB-1490)
- Replace a single quote with double quotes in an ODBC escape

* SSL
- Make sure that res is initialized in all cases
- Parse correctly https request split into multiple packets (EJAB-1537)
- Added missed tls:recv_data/2
- Don't ignore Length parameter in tls:recv
- Avoid quadratic behavior in reading SSL data
- Dix http_bind webserver TLS fail on Chrome (EJAB-1530)

* Miscelanea
- Assume we have only one CPU when an auto-detection fails (EJAB-1516)
- Auth: Relax digest-uri handling (EJAB-1529)
- Caps: Cache caps timestamp before the IQ-request is done
- IRC: Use of MUC password
- Private: misc errors cases fixes
- Pubsub: return user affiliation for a specified node (EJAB-1294)
- Shared Roster: Foreign items were not pushed (EJAB-1509)
- Shared Roster LDAP: user substitution in ldap_rfilter (EJAB-1555)
- Windows: Fix makefile rules for building DLLs


Bug reports

You can officially report bugs on ProcessOne support site:
http://support.process-one.net/
4 changes: 2 additions & 2 deletions src/Makefile.win32
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ LD=link.exe
LD_FLAGS=-release -nologo -incremental:no -dll "$(EI_DIR)\lib\ei_md.lib" "$(EI_DIR)\lib\erl_interface_md.lib" "$(EXPAT_LIB)" MSVCRT.LIB kernel32.lib advapi32.lib gdi32.lib user32.lib comctl32.lib comdlg32.lib shell32.lib

$(DLL) : $(OBJECT)
$(LD) $(LD_FLAGS) -out:$(DLL) $(OBJECT)
$(LD) $(LD_FLAGS) -out:$@ $<

$(OBJECT) : $(SOURCE)
$(CC) $(CC_FLAGS) -c -Fo$(OBJECT) $(SOURCE)
$(CC) $(CC_FLAGS) -c -Fo$@ $<
14 changes: 11 additions & 3 deletions src/acl.erl
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,11 @@ match_acl(ACL, JID, Host) ->
lists:member(Server, ?MYHOSTS)))
andalso is_regexp_match(User, UR);
{shared_group, G} ->
mod_shared_roster:is_user_in_group({User, Server}, G, Host);
Mod = loaded_shared_roster_module(Host),
Mod:is_user_in_group({User, Server}, G, Host);
{shared_group, G, H} ->
mod_shared_roster:is_user_in_group({User, Server}, G, H);
Mod = loaded_shared_roster_module(H),
Mod:is_user_in_group({User, Server}, G, H);
{user_regexp, UR, S} ->
(S == Server) andalso
is_regexp_match(User, UR);
Expand Down Expand Up @@ -238,4 +240,10 @@ is_regexp_match(String, RegExp) ->
is_glob_match(String, Glob) ->
is_regexp_match(String, ejabberd_regexp:sh_to_awk(Glob)).


loaded_shared_roster_module(Host) ->
case gen_mod:is_loaded(Host, mod_shared_roster_ldap) of
true ->
mod_shared_roster_ldap;
false ->
mod_shared_roster
end.
89 changes: 89 additions & 0 deletions src/basho_bench_driver_eredis.erl
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
-module(basho_bench_driver_eredis).

-export([new/1,
run/4]).

-export([value_gen/1]).

new(_Id) ->
case whereis(eredis_driver) of
undefined ->
case eredis:start_link() of
{ok, Client} ->
register(eredis_driver, Client),
{ok, Client};
{error, Reason} ->
{error, Reason}
end;
Pid ->
{ok, Pid}
end.

run(get, KeyGen, _ValueGen, Client) ->
Start = KeyGen(),
%%case eredis:q(["MGET" | lists:seq(Start, Start + 500)]) of
case catch(eredis:q(Client, ["GET", Start], 100)) of
{ok, _Value} ->
{ok, Client};
{error, Reason} ->
{error, Reason, Client};
{'EXIT', {timeout, _}} ->
{error, timeout, Client}
end;

run(pipeline_get, KeyGen, _ValueGen, Client) ->
Seq = lists:seq(1, 5),
P = [["GET", KeyGen()] || _ <- Seq],

case catch(eredis:qp(Client, P, 500)) of
{error, Reason} ->
{error, Reason, Client};
{'EXIT', {timeout, _}} ->
{error, timeout, Client};
Res ->
case check_pipeline_get(Res, Seq) of
ok ->
{ok, Client};
{error, Reason} ->
{error, Reason, Client}
end
end;

run(put, KeyGen, ValueGen, Client) ->
case catch(eredis:q(Client, ["SET", KeyGen(), ValueGen()], 100)) of
{ok, <<"OK">>} ->
{ok, Client};
{error, Reason} ->
{error, Reason, Client};
{'EXIT', {timeout, _}} ->
{error, timeout, Client}
end;

run(pipeline_put, KeyGen, ValueGen, Client) ->
Seq = lists:seq(1, 5),
P = [["SET", KeyGen(), ValueGen()] || _ <- Seq],
R = [{ok, <<"OK">>} || _ <- Seq],

case catch(eredis:qp(Client, P, 500)) of
R ->
{ok, Client};
{error, Reason} ->
{error, Reason, Client};
{'EXIT', {timeout, _}} ->
{error, timeout, Client}
end.


check_pipeline_get([], []) ->
ok;
check_pipeline_get([{ok, _}|Res], [_|Seq]) ->
check_pipeline_get(Res, Seq);
check_pipeline_get([{error, Reason}], _) ->
{error, Reason}.


value_gen(_Id) ->
fun() ->
%% %% Example data from http://json.org/example.html
<<"{\"web-app\":{\"servlet\":[{\"servlet-name\":\"cofaxCDS\",\"servlet-class\":\"org.cofax.cds.CDSServlet\",\"init-param\":{\"configGlossary:installationAt\":\"Philadelphia,PA\",\"configGlossary:adminEmail\":\"ksm@pobox.com\",\"configGlossary:poweredBy\":\"Cofax\",\"configGlossary:poweredByIcon\":\"/images/cofax.gif\",\"configGlossary:staticPath\":\"/content/static\",\"templateProcessorClass\":\"org.cofax.WysiwygTemplate\",\"templateLoaderClass\":\"org.cofax.FilesTemplateLoader\",\"templatePath\":\"templates\",\"templateOverridePath\":\"\",\"defaultListTemplate\":\"listTemplate.htm\",\"defaultFileTemplate\":\"articleTemplate.htm\",\"useJSP\":false,\"jspListTemplate\":\"listTemplate.jsp\",\"jspFileTemplate\":\"articleTemplate.jsp\",\"cachePackageTagsTrack\":200,\"cachePackageTagsStore\":200,\"cachePackageTagsRefresh\":60,\"cacheTemplatesTrack\":100,\"cacheTemplatesStore\":50,\"cacheTemplatesRefresh\":15,\"cachePagesTrack\":200,\"cachePagesStore\":100,\"cachePagesRefresh\":10,\"cachePagesDirtyRead\":10,\"searchEngineListTemplate\":\"forSearchEnginesList.htm\",\"searchEngineFileTemplate\":\"forSearchEngines.htm\",\"searchEngineRobotsDb\":\"WEB-INF/robots.db\",\"useDataStore\":true,\"dataStoreClass\":\"org.cofax.SqlDataStore\",\"redirectionClass\":\"org.cofax.SqlRedirection\",\"dataStoreName\":\"cofax\",\"dataStoreDriver\":\"com.microsoft.jdbc.sqlserver.SQLServerDriver\",\"dataStoreUrl\":\"jdbc:microsoft:sqlserver://LOCALHOST:1433;DatabaseName=goon\",\"dataStoreUser\":\"sa\",\"dataStorePassword\":\"dataStoreTestQuery\",\"dataStoreTestQuery\":\"SETNOCOUNTON;selecttest='test';\",\"dataStoreLogFile\":\"/usr/local/tomcat/logs/datastore.log\",\"dataStoreInitConns\":10,\"dataStoreMaxConns\":100,\"dataStoreConnUsageLimit\":100,\"dataStoreLogLevel\":\"debug\",\"maxUrlLength\":500}},{\"servlet-name\":\"cofaxEmail\",\"servlet-class\":\"org.cofax.cds.EmailServlet\",\"init-param\":{\"mailHost\":\"mail1\",\"mailHostOverride\":\"mail2\"}},{\"servlet-name\":\"cofaxAdmin\",\"servlet-class\":\"org.cofax.cds.AdminServlet\"},{\"servlet-name\":\"fileServlet\",\"servlet-class\":\"org.cofax.cds.FileServlet\"},{\"servlet-name\":\"cofaxTools\",\"servlet-class\":\"org.cofax.cms.CofaxToolsServlet\",\"init-param\":{\"templatePath\":\"toolstemplates/\",\"log\":1,\"logLocation\":\"/usr/local/tomcat/logs/CofaxTools.log\",\"logMaxSize\":\"\",\"dataLog\":1,\"dataLogLocation\":\"/usr/local/tomcat/logs/dataLog.log\",\"dataLogMaxSize\":\"\",\"removePageCache\":\"/content/admin/remove?cache=pages&id=\",\"removeTemplateCache\":\"/content/admin/remove?cache=templates&id=\",\"fileTransferFolder\":\"/usr/local/tomcat/webapps/content/fileTransferFolder\",\"lookInContext\":1,\"adminGroupID\":4,\"betaServer\":true}}],\"servlet-mapping\":{\"cofaxCDS\":\"/\",\"cofaxEmail\":\"/cofaxutil/aemail/*\",\"cofaxAdmin\":\"/admin/*\",\"fileServlet\":\"/static/*\",\"cofaxTools\":\"/tools/*\"},\"taglib\":{\"taglib-uri\":\"cofax.tld\",\"taglib-location\":\"/WEB-INF/tlds/cofax.tld\"}}">>
end.
29 changes: 29 additions & 0 deletions src/basho_bench_driver_erldis.erl
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
-module(basho_bench_driver_erldis).

-export([new/1,
run/4]).

new(_Id) ->
case erldis_client:connect() of
{ok, Pid} ->
{ok, Pid};
{error, {already_started, Pid}} ->
{ok, Pid}
end.

run(get, KeyGen, _ValueGen, Client) ->
Start = KeyGen(),
case erldis:mget(Client, lists:seq(Start, Start + 500)) of
{error, Reason} ->
{error, Reason, Client};
_Value ->
{ok, Client}
end;

run(put, KeyGen, ValueGen, Client) ->
case erldis:set(Client, integer_to_list(KeyGen()), ValueGen()) of
{error, Reason} ->
{error, Reason, Client};
_Value ->
{ok, Client}
end.
53 changes: 41 additions & 12 deletions src/cyrsasl_digest.erl
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,11 @@
-behaviour(cyrsasl).

-record(state, {step, nonce, username, authzid, get_password, check_password, auth_module,
host}).
host, hostfqdn}).

start(_Opts) ->
Fqdn = get_local_fqdn(),
?INFO_MSG("FQDN used to check DIGEST-MD5 SASL authentication: ~p", [Fqdn]),
cyrsasl:register_mechanism("DIGEST-MD5", ?MODULE, digest).

stop() ->
Expand All @@ -49,6 +51,7 @@ mech_new(Host, GetPassword, _CheckPassword, CheckPasswordDigest) ->
{ok, #state{step = 1,
nonce = randoms:get_string(),
host = Host,
hostfqdn = get_local_fqdn(),
get_password = GetPassword,
check_password = CheckPasswordDigest}}.

Expand All @@ -64,10 +67,11 @@ mech_step(#state{step = 3, nonce = Nonce} = State, ClientIn) ->
KeyVals ->
DigestURI = xml:get_attr_s("digest-uri", KeyVals),
UserName = xml:get_attr_s("username", KeyVals),
case is_digesturi_valid(DigestURI, State#state.host) of
case is_digesturi_valid(DigestURI, State#state.host, State#state.hostfqdn) of
false ->
?DEBUG("User login not authorized because digest-uri "
"seems invalid: ~p", [DigestURI]),
"seems invalid: ~p (checking for Host ~p, FQDN ~p)", [DigestURI,
State#state.host, State#state.hostfqdn]),
{error, "not-authorized", UserName};
true ->
AuthzId = xml:get_attr_s("authzid", KeyVals),
Expand Down Expand Up @@ -154,21 +158,46 @@ parse4([], Key, Val, Ts) ->
%% however ejabberd doesn't allow that.
%% If the service (for example jabber.example.org)
%% is provided by several hosts (being one of them server3.example.org),
%% then digest-uri can be like xmpp/server3.example.org/jabber.example.org
%% In that case, ejabberd only checks the service name, not the host.
is_digesturi_valid(DigestURICase, JabberHost) ->
%% then acceptable digest-uris would be:
%% xmpp/server3.example.org/jabber.example.org, xmpp/server3.example.org and
%% xmpp/jabber.example.org
%% The last version is not actually allowed by the RFC, but implemented by popular clients
is_digesturi_valid(DigestURICase, JabberDomain, JabberFQDN) ->
DigestURI = stringprep:tolower(DigestURICase),
case catch string:tokens(DigestURI, "/") of
["xmpp", Host] when Host == JabberHost ->
true;
["xmpp", _Host, ServName] when ServName == JabberHost ->
true;
["xmpp", Host] ->
IsHostFqdn = is_host_fqdn(Host, JabberFQDN),
(Host == JabberDomain) or IsHostFqdn;
["xmpp", Host, ServName] ->
IsHostFqdn = is_host_fqdn(Host, JabberFQDN),
(ServName == JabberDomain) and IsHostFqdn;
_ ->
false
end.



is_host_fqdn(Host, [Letter | _Tail] = Fqdn) when not is_list(Letter) ->
Host == Fqdn;
is_host_fqdn(_Host, []) ->
false;
is_host_fqdn(Host, [Fqdn | _FqdnTail]) when Host == Fqdn ->
true;
is_host_fqdn(Host, [Fqdn | FqdnTail]) when Host /= Fqdn ->
is_host_fqdn(Host, FqdnTail).

get_local_fqdn() ->
case (catch get_local_fqdn2()) of
Str when is_list(Str) -> Str;
_ -> "unknown-fqdn, please configure fqdn option in ejabberd.cfg!"
end.
get_local_fqdn2() ->
case ejabberd_config:get_local_option(fqdn) of
ConfiguredFqdn when is_list(ConfiguredFqdn) ->
ConfiguredFqdn;
_undefined ->
{ok, Hostname} = inet:gethostname(),
{ok, {hostent, Fqdn, _, _, _, _}} = inet:gethostbyname(Hostname),
Fqdn
end.

digit_to_xchar(D) when (D >= 0) and (D < 10) ->
D + 48;
Expand Down
6 changes: 0 additions & 6 deletions src/ejabberd.app
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,12 @@
mod_irc,
mod_irc_connection,
mod_last,
mod_last_odbc,
mod_muc,
mod_muc_log,
mod_muc_room,
mod_offline,
mod_offline_odbc,
mod_privacy,
mod_privacy_odbc,
mod_private,
mod_private_odbc,
mod_proxy65,
mod_proxy65_lib,
mod_proxy65_service,
Expand All @@ -96,14 +92,12 @@
mod_pubsub,
mod_register,
mod_roster,
mod_roster_odbc,
mod_service_log,
mod_shared_roster,
mod_stats,
mod_time,
mod_vcard,
mod_vcard_ldap,
mod_vcard_odbc,
mod_version,
node_buddy,
node_club,
Expand Down
3 changes: 3 additions & 0 deletions src/ejabberd.cfg.example
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,9 @@
%% Store the plain passwords or hashed for SCRAM:
%%{auth_password_format, plain}.
%%{auth_password_format, scram}.
%%
%% Define the FQDN if ejabberd doesn't detect it:
%%{fqdn, "server3.example.com"}.

%%
%% Authentication using external script
Expand Down
Loading