public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/ejabberd] f45: Fixed http-poll
@ 2026-09-23 19:07 Peter Lemenkov
0 siblings, 0 replies; only message in thread
From: Peter Lemenkov @ 2026-09-23 19:07 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/ejabberd
Branch : f45
Commit : 695666a344894fa83b5b8755e67b991ab460cb3a
Author : Peter Lemenkov <lemenkov@gmail.com>
Date : 2010-08-18T14:58:20+04:00
Stats : +633/-543 in 15 file(s)
URL : https://src.fedoraproject.org/rpms/ejabberd/c/695666a344894fa83b5b8755e67b991ab460cb3a?branch=f45
Log:
Fixed http-poll
Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
---
diff --git a/ejabberd-0001-Fix-PAM-service-example-name-to-match-actual-one.patch b/ejabberd-0001-Fix-PAM-service-example-name-to-match-actual-one.patch
index 0718a03..5e9444f 100644
--- a/ejabberd-0001-Fix-PAM-service-example-name-to-match-actual-one.patch
+++ b/ejabberd-0001-Fix-PAM-service-example-name-to-match-actual-one.patch
@@ -1,7 +1,7 @@
From 5fdb6557be8b5758856a91e8172acfddc9d04382 Mon Sep 17 00:00:00 2001
From: Peter Lemenkov <lemenkov@gmail.com>
Date: Tue, 16 Feb 2010 16:03:38 +0300
-Subject: [PATCH 1/9] Fix PAM service example name to match actual one
+Subject: [PATCH 01/10] Fix PAM service example name to match actual one
Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
---
@@ -22,5 +22,5 @@ index 4087947..b351cfc 100644
%%
%% Authentication using LDAP
--
-1.7.2
+1.7.2.1
diff --git a/ejabberd-0002-Mention-mod_ctlextra-as-an-ejabberd-module.patch b/ejabberd-0002-Mention-mod_ctlextra-as-an-ejabberd-module.patch
index 3751b73..5d14e87 100644
--- a/ejabberd-0002-Mention-mod_ctlextra-as-an-ejabberd-module.patch
+++ b/ejabberd-0002-Mention-mod_ctlextra-as-an-ejabberd-module.patch
@@ -1,7 +1,7 @@
From ca74de7045b7393b09b53dd02e548e76cab9c849 Mon Sep 17 00:00:00 2001
From: Peter Lemenkov <lemenkov@gmail.com>
Date: Tue, 16 Feb 2010 16:05:53 +0300
-Subject: [PATCH 2/9] Mention mod_ctlextra as an ejabberd module
+Subject: [PATCH 02/10] Mention mod_ctlextra as an ejabberd module
Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
---
@@ -21,5 +21,5 @@ index 0ebb1aa..3a8d604 100644
mod_echo,
mod_http_bind,
--
-1.7.2
+1.7.2.1
diff --git a/ejabberd-0003-Fixed-delays-in-s2s-connections.patch b/ejabberd-0003-Fixed-delays-in-s2s-connections.patch
index f5f0ec8..b313ddd 100644
--- a/ejabberd-0003-Fixed-delays-in-s2s-connections.patch
+++ b/ejabberd-0003-Fixed-delays-in-s2s-connections.patch
@@ -1,7 +1,7 @@
From 9c8d1d47cf8e8ab98e8063161b04c8beabfc9ce5 Mon Sep 17 00:00:00 2001
From: Sergei Golovan <sgolovan@nes.ru>
Date: Tue, 16 Feb 2010 16:07:37 +0300
-Subject: [PATCH 3/9] Fixed delays in s2s connections.
+Subject: [PATCH 03/10] Fixed delays in s2s connections.
Patch by Sergei Golovan increases timeouts in S2S and removes horrible 5-minute
delay between remote server connection attempts after a falure (in case of
@@ -50,5 +50,5 @@ index a1c6412..b8393cb 100644
open_socket(stop, StateData) ->
?INFO_MSG("s2s connection: ~s -> ~s (stopped in open socket)",
--
-1.7.2
+1.7.2.1
diff --git a/ejabberd-0004-Introducing-mod_admin_extra.patch b/ejabberd-0004-Introducing-mod_admin_extra.patch
index d3c320e..872e4b7 100644
--- a/ejabberd-0004-Introducing-mod_admin_extra.patch
+++ b/ejabberd-0004-Introducing-mod_admin_extra.patch
@@ -1,7 +1,7 @@
From a0769ced87381fa07c6845d5fda18b5e584d4ed5 Mon Sep 17 00:00:00 2001
From: Badlop <badlop@process-one.net>
Date: Tue, 16 Feb 2010 16:12:17 +0300
-Subject: [PATCH 4/9] Introducing mod_admin_extra
+Subject: [PATCH 04/10] Introducing mod_admin_extra
Adds the mod_admin_extra module to ejabberd.
This module extends the functionality provided by ejabberdctl
@@ -1314,5 +1314,5 @@ index 0000000..9f3ca14
+is_glob_match(String, Glob) ->
+ is_regexp_match(String, regexp:sh_to_awk(Glob)).
--
-1.7.2
+1.7.2.1
diff --git a/ejabberd-0005-Fedora-specific-changes-to-ejabberdctl.patch b/ejabberd-0005-Fedora-specific-changes-to-ejabberdctl.patch
index 3cec2cc..a76471e 100644
--- a/ejabberd-0005-Fedora-specific-changes-to-ejabberdctl.patch
+++ b/ejabberd-0005-Fedora-specific-changes-to-ejabberdctl.patch
@@ -1,7 +1,7 @@
From 52209eb6efd83b91d5ad49623d99c53a27ffcbe9 Mon Sep 17 00:00:00 2001
From: Peter Lemenkov <lemenkov@gmail.com>
Date: Tue, 16 Feb 2010 16:30:05 +0300
-Subject: [PATCH 5/9] Fedora-specific changes to ejabberdctl
+Subject: [PATCH 05/10] Fedora-specific changes to ejabberdctl
Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
---
@@ -44,5 +44,5 @@ index fecdecc..bceec28 100644
done
if [ "$ID" -eq "$EJID" ] ; then
--
-1.7.2
+1.7.2.1
diff --git a/ejabberd-0006-Change-directory-to-readable-by-everyone.patch b/ejabberd-0006-Change-directory-to-readable-by-everyone.patch
new file mode 100644
index 0000000..0567ab7
--- /dev/null
+++ b/ejabberd-0006-Change-directory-to-readable-by-everyone.patch
@@ -0,0 +1,33 @@
+From ae241feec49dd9b9fc1355e4be37c3f8b268de87 Mon Sep 17 00:00:00 2001
+From: Peter Lemenkov <lemenkov@gmail.com>
+Date: Thu, 18 Mar 2010 14:57:21 +0300
+Subject: [PATCH 06/10] Change directory to readable by everyone
+
+This requires to suppress error messages like
+"File operation error: eacces". See rhbz #564686:
+
+https://bugzilla.redhat.com/564686
+
+Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
+---
+ src/ejabberdctl.template | 4 ++++
+ 1 files changed, 4 insertions(+), 0 deletions(-)
+
+diff --git a/src/ejabberdctl.template b/src/ejabberdctl.template
+index bceec28..ee74650 100644
+--- a/src/ejabberdctl.template
++++ b/src/ejabberdctl.template
+@@ -355,6 +355,10 @@ wait_for_status()
+ return $status
+ }
+
++# In order to prevent issues with "File operation error: eacces."
++# See rhbz #564686.
++cd /
++
+ case $ARGS in
+ ' start') start;;
+ ' debug') debug;;
+--
+1.7.2.1
+
diff --git a/ejabberd-0006-Support-to-authenticate-against-SASL-GSSAPI.patch b/ejabberd-0006-Support-to-authenticate-against-SASL-GSSAPI.patch
deleted file mode 100644
index 839a3dd..0000000
--- a/ejabberd-0006-Support-to-authenticate-against-SASL-GSSAPI.patch
+++ /dev/null
@@ -1,428 +0,0 @@
-From 6819e946b2cfd7cc31ae182225ecd5ed47b2f057 Mon Sep 17 00:00:00 2001
-From: Badlop <badlop@process-one.net>
-Date: Tue, 29 Sep 2009 15:10:15 +0200
-Subject: [PATCH 6/9] Support to authenticate against SASL GSSAPI.
- http://www.ejabberd.im/cyrsasl_gssapi
-
----
- src/cyrsasl.erl | 34 ++++++-----
- src/cyrsasl_anonymous.erl | 6 +-
- src/cyrsasl_digest.erl | 4 +-
- src/cyrsasl_gssapi.erl | 142 +++++++++++++++++++++++++++++++++++++++++++++
- src/cyrsasl_plain.erl | 5 +-
- src/ejabberd.hrl | 7 ++
- src/ejabberd_c2s.erl | 8 ++-
- src/ejabberd_net.erl | 42 +++++++++++++
- 8 files changed, 226 insertions(+), 22 deletions(-)
- create mode 100644 src/cyrsasl_gssapi.erl
- create mode 100644 src/ejabberd_net.erl
-
-diff --git a/src/cyrsasl.erl b/src/cyrsasl.erl
-index 121ef6d..192d5b5 100644
---- a/src/cyrsasl.erl
-+++ b/src/cyrsasl.erl
-@@ -30,19 +30,20 @@
- -export([start/0,
- register_mechanism/3,
- listmech/1,
-- server_new/7,
-+ server_new/8,
- server_start/3,
- server_step/2]).
-
- -record(sasl_mechanism, {mechanism, module, require_plain_password}).
---record(sasl_state, {service, myname, realm,
-- get_password, check_password, check_password_digest,
-- mech_mod, mech_state}).
-+-record(sasl_state, {service, myname,
-+ mech_mod, mech_state, ctx}).
-+
-+-include("ejabberd.hrl").
-
- -export([behaviour_info/1]).
-
- behaviour_info(callbacks) ->
-- [{mech_new, 4}, {mech_step, 2}];
-+ [{mech_new, 1}, {mech_step, 2}];
- behaviour_info(_Other) ->
- undefined.
-
-@@ -50,6 +51,7 @@ start() ->
- ets:new(sasl_mechanism, [named_table,
- public,
- {keypos, #sasl_mechanism.mechanism}]),
-+ cyrsasl_gssapi:start([]),
- cyrsasl_plain:start([]),
- cyrsasl_digest:start([]),
- cyrsasl_anonymous:start([]),
-@@ -113,24 +115,26 @@ listmech(Host) ->
- filter_anonymous(Host, Mechs).
-
- server_new(Service, ServerFQDN, UserRealm, _SecFlags,
-- GetPassword, CheckPassword, CheckPasswordDigest) ->
-+ GetPassword, CheckPassword, CheckPasswordDigest, FQDN) ->
-+ Ctx = #sasl_ctx{
-+ host = ServerFQDN,
-+ realm = UserRealm,
-+ get_password = GetPassword,
-+ check_password = CheckPassword,
-+ check_password_digest= CheckPasswordDigest,
-+ fqdn = FQDN
-+ },
-+
- #sasl_state{service = Service,
- myname = ServerFQDN,
-- realm = UserRealm,
-- get_password = GetPassword,
-- check_password = CheckPassword,
-- check_password_digest= CheckPasswordDigest}.
-+ ctx = Ctx}.
-
- server_start(State, Mech, ClientIn) ->
- case lists:member(Mech, listmech(State#sasl_state.myname)) of
- true ->
- case ets:lookup(sasl_mechanism, Mech) of
- [#sasl_mechanism{module = Module}] ->
-- {ok, MechState} = Module:mech_new(
-- State#sasl_state.myname,
-- State#sasl_state.get_password,
-- State#sasl_state.check_password,
-- State#sasl_state.check_password_digest),
-+ {ok, MechState} = Module:mech_new(State#sasl_state.ctx),
- server_step(State#sasl_state{mech_mod = Module,
- mech_state = MechState},
- ClientIn);
-diff --git a/src/cyrsasl_anonymous.erl b/src/cyrsasl_anonymous.erl
-index 2b3ba36..ec75f40 100644
---- a/src/cyrsasl_anonymous.erl
-+++ b/src/cyrsasl_anonymous.erl
-@@ -27,12 +27,14 @@
-
- -module(cyrsasl_anonymous).
-
---export([start/1, stop/0, mech_new/4, mech_step/2]).
-+-export([start/1, stop/0, mech_new/1, mech_step/2]).
-
- -behaviour(cyrsasl).
-
- -record(state, {server}).
-
-+-include("ejabberd.hrl").
-+
- start(_Opts) ->
- cyrsasl:register_mechanism("ANONYMOUS", ?MODULE, false),
- ok.
-@@ -40,7 +42,7 @@ start(_Opts) ->
- stop() ->
- ok.
-
--mech_new(Host, _GetPassword, _CheckPassword, _CheckPasswordDigest) ->
-+mech_new(#sasl_ctx{host=Host}) ->
- {ok, #state{server = Host}}.
-
- mech_step(State, _ClientIn) ->
-diff --git a/src/cyrsasl_digest.erl b/src/cyrsasl_digest.erl
-index 2a7ce2a..a354778 100644
---- a/src/cyrsasl_digest.erl
-+++ b/src/cyrsasl_digest.erl
-@@ -29,7 +29,7 @@
-
- -export([start/1,
- stop/0,
-- mech_new/4,
-+ mech_new/1,
- mech_step/2]).
-
- -include("ejabberd.hrl").
-@@ -45,7 +45,7 @@ start(_Opts) ->
- stop() ->
- ok.
-
--mech_new(Host, GetPassword, _CheckPassword, CheckPasswordDigest) ->
-+mech_new(#sasl_ctx{host=Host, get_password=GetPassword, check_password_digest=CheckPasswordDigest}) ->
- {ok, #state{step = 1,
- nonce = randoms:get_string(),
- host = Host,
-diff --git a/src/cyrsasl_gssapi.erl b/src/cyrsasl_gssapi.erl
-new file mode 100644
-index 0000000..24a3796
---- /dev/null
-+++ b/src/cyrsasl_gssapi.erl
-@@ -0,0 +1,142 @@
-+%%%----------------------------------------------------------------------
-+%%% File : cyrsasl_gssapi.erl
-+%%% Author : Mikael Magnusson <mikma@users.sourceforge.net>
-+%%% Purpose : GSSAPI SASL mechanism
-+%%% Created : 1 June 2007 by Mikael Magnusson <mikma@users.sourceforge.net>
-+%%% Id : $Id: $
-+%%%----------------------------------------------------------------------
-+%%%
-+%%% Copyright (C) 2007 Mikael Magnusson <mikma@users.sourceforge.net>
-+%%%
-+%%% Permission is hereby granted, free of charge, to any person
-+%%% obtaining a copy of this software and associated documentation
-+%%% files (the "Software"), to deal in the Software without
-+%%% restriction, including without limitation the rights to use, copy,
-+%%% modify, merge, publish, distribute, sublicense, and/or sell copies
-+%%% of the Software, and to permit persons to whom the Software is
-+%%% furnished to do so, subject to the following conditions:
-+%%%
-+%%% The above copyright notice and this permission notice shall be
-+%%% included in all copies or substantial portions of the Software.
-+%%%
-+%%% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-+%%% EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-+%%% MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-+%%% NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
-+%%% BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
-+%%% ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-+%%% CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-+%%% SOFTWARE.
-+%%%
-+
-+%%%
-+%%% configuration options:
-+%%% {sasl_realm, "<Kerberos realm>"}.
-+%%%
-+%%% environment variables:
-+%%% KRB5_KTNAME
-+%%%
-+
-+-module(cyrsasl_gssapi).
-+-author('mikma@users.sourceforge.net').
-+-vsn('$Revision: $ ').
-+
-+-include("ejabberd.hrl").
-+
-+-export([start/1,
-+ stop/0,
-+ mech_new/1,
-+ mech_step/2]).
-+
-+-behaviour(cyrsasl).
-+
-+-define(SERVER, cyrsasl_gssapi).
-+
-+-record(state, {sasl,
-+ needsmore=true,
-+ step=0,
-+ host,
-+ authid,
-+ authzid,
-+ authrealm}).
-+
-+start(_Opts) ->
-+ ChildSpec =
-+ {?SERVER,
-+ {esasl, start_link, [{local, ?SERVER}]},
-+ transient,
-+ 1000,
-+ worker,
-+ [esasl]},
-+
-+ {ok, _Pid} = supervisor:start_child(ejabberd_sup, ChildSpec),
-+
-+ cyrsasl:register_mechanism("GSSAPI", ?MODULE, false).
-+
-+stop() ->
-+ esasl:stop(?SERVER),
-+ supervisor:terminate_child(ejabberd_sup, ?SERVER),
-+ supervisor:delete_child(ejabberd_sup, ?SERVER).
-+
-+mech_new(#sasl_ctx{host=Host, fqdn=FQDN}) ->
-+ ?DEBUG("mech_new ~p ~p~n", [Host, FQDN]),
-+ {ok, Sasl} = esasl:server_start(?SERVER, "GSSAPI", "xmpp", FQDN),
-+ {ok, #state{sasl=Sasl,host=Host}}.
-+
-+mech_step(State, ClientIn) when is_list(ClientIn) ->
-+ catch do_step(State, ClientIn).
-+
-+do_step(#state{needsmore=false}=State, _) ->
-+ check_user(State);
-+do_step(#state{needsmore=true,sasl=Sasl,step=Step}=State, ClientIn) ->
-+ ?DEBUG("mech_step~n", []),
-+ case esasl:step(Sasl, list_to_binary(ClientIn)) of
-+ {ok, RspAuth} ->
-+ ?DEBUG("ok~n", []),
-+ {ok, Display_name} = esasl:property_get(Sasl, gssapi_display_name),
-+ {ok, Authzid} = esasl:property_get(Sasl, authzid),
-+ {Authid, [$@ | Auth_realm]} =
-+ lists:splitwith(fun(E)->E =/= $@ end, Display_name),
-+ State1 = State#state{authid=Authid,
-+ authzid=Authzid,
-+ authrealm=Auth_realm},
-+ handle_step_ok(State1, binary_to_list(RspAuth));
-+ {needsmore, RspAuth} ->
-+ ?DEBUG("needsmore~n", []),
-+ if (Step > 0) and (ClientIn =:= []) and (RspAuth =:= <<>>) ->
-+ {error, "not-authorized"};
-+ true ->
-+ {continue, binary_to_list(RspAuth),
-+ State#state{step=Step+1}}
-+ end;
-+ {error, _} ->
-+ {error, "not-authorized"}
-+ end.
-+
-+handle_step_ok(State, []) ->
-+ check_user(State);
-+handle_step_ok(#state{step=Step}=State, RspAuth) ->
-+ ?DEBUG("continue~n", []),
-+ {continue, RspAuth, State#state{needsmore=false,step=Step+1}}.
-+
-+check_user(#state{authid=Authid,authzid=Authzid,
-+ authrealm=Auth_realm,host=Host}) ->
-+ Realm = ejabberd_config:get_local_option({sasl_realm, Host}),
-+
-+ if Realm =/= Auth_realm ->
-+ ?DEBUG("bad realm ~p (expected ~p)~n",[Auth_realm, Realm]),
-+ throw({error, "not-authorized"});
-+ true ->
-+ ok
-+ end,
-+
-+ case ejabberd_auth:is_user_exists(Authid, Host) of
-+ false ->
-+ ?DEBUG("bad user ~p~n",[Authid]),
-+ throw({error, "not-authorized"});
-+ true ->
-+ ok
-+ end,
-+
-+ ?DEBUG("GSSAPI authenticated ~p ~p~n", [Authid, Authzid]),
-+ {ok, [{username, Authid}, {authzid, Authzid}]}.
-diff --git a/src/cyrsasl_plain.erl b/src/cyrsasl_plain.erl
-index 129fb8b..d920463 100644
---- a/src/cyrsasl_plain.erl
-+++ b/src/cyrsasl_plain.erl
-@@ -27,10 +27,11 @@
- -module(cyrsasl_plain).
- -author('alexey@process-one.net').
-
---export([start/1, stop/0, mech_new/4, mech_step/2, parse/1]).
-+-export([start/1, stop/0, mech_new/1, mech_step/2, parse/1]).
-
- -behaviour(cyrsasl).
-
-+-include("ejabberd.hrl").
- -record(state, {check_password}).
-
- start(_Opts) ->
-@@ -40,7 +41,7 @@ start(_Opts) ->
- stop() ->
- ok.
-
--mech_new(_Host, _GetPassword, CheckPassword, _CheckPasswordDigest) ->
-+mech_new(#sasl_ctx{check_password=CheckPassword}) ->
- {ok, #state{check_password = CheckPassword}}.
-
- mech_step(State, ClientIn) ->
-diff --git a/src/ejabberd.hrl b/src/ejabberd.hrl
-index e1f0cfd..39a41d5 100644
---- a/src/ejabberd.hrl
-+++ b/src/ejabberd.hrl
-@@ -59,3 +59,10 @@
- -define(CRITICAL_MSG(Format, Args),
- ejabberd_logger:critical_msg(?MODULE,?LINE,Format, Args)).
-
-+-record(sasl_ctx, {
-+ host,
-+ realm,
-+ get_password,
-+ check_password,
-+ check_password_digest,
-+ fqdn}).
-diff --git a/src/ejabberd_c2s.erl b/src/ejabberd_c2s.erl
-index d4b6809..fe016d9 100644
---- a/src/ejabberd_c2s.erl
-+++ b/src/ejabberd_c2s.erl
-@@ -71,6 +71,7 @@
- -record(state, {socket,
- sockmod,
- socket_monitor,
-+ fqdn,
- xml_socket,
- streamid,
- sasl_state,
-@@ -208,9 +209,11 @@ init([{SockMod, Socket}, Opts]) ->
- Socket
- end,
- SocketMonitor = SockMod:monitor(Socket1),
-+ {ok, FQDN} = ejabberd_net:gethostname(Socket),
- {ok, wait_for_stream, #state{socket = Socket1,
- sockmod = SockMod,
- socket_monitor = SocketMonitor,
-+ fqdn = FQDN,
- xml_socket = XMLSocket,
- zlib = Zlib,
- tls = TLS,
-@@ -254,6 +257,8 @@ wait_for_stream({xmlstreamstart, _Name, Attrs}, StateData) ->
- send_header(StateData, Server, "1.0", DefaultLang),
- case StateData#state.authenticated of
- false ->
-+ FQDN = StateData#state.fqdn,
-+ ?INFO_MSG("FQDN: ~p~n", [FQDN]),
- SASLState =
- cyrsasl:server_new(
- "jabber", Server, "", [],
-@@ -268,7 +273,8 @@ wait_for_stream({xmlstreamstart, _Name, Attrs}, StateData) ->
- fun(U, P, D, DG) ->
- ejabberd_auth:check_password_with_authmodule(
- U, Server, P, D, DG)
-- end),
-+ end,
-+ FQDN),
- Mechs = lists:map(
- fun(S) ->
- {xmlelement, "mechanism", [],
-diff --git a/src/ejabberd_net.erl b/src/ejabberd_net.erl
-new file mode 100644
-index 0000000..b6943e1
---- /dev/null
-+++ b/src/ejabberd_net.erl
-@@ -0,0 +1,42 @@
-+%%%----------------------------------------------------------------------
-+%%% File : ejabberd_net.erl
-+%%% Author : Mikael Magnusson <mikma@users.sourceforge.net>
-+%%% Purpose : Serve C2S connection
-+%%% Created : 6 June 2007 by Mikael Magnusson <mikma@users.sourceforge.net>
-+%%% Id : $Id: $
-+%%%----------------------------------------------------------------------
-+
-+-module(ejabberd_net).
-+-author('mikma@users.sourceforge.net').
-+%% -update_info({update, 0}).
-+
-+-export([gethostname/1]).
-+
-+-include("ejabberd.hrl").
-+-include_lib("kernel/include/inet.hrl").
-+
-+%% Copied from ejabberd_socket.erl of ejabberd 2.0.3
-+-record(socket_state, {sockmod, socket, receiver}).
-+
-+%%
-+%% gethostname(Socket)
-+%%
-+gethostname(Socket) ->
-+ ?INFO_MSG("gethostname ~p~n", [Socket]),
-+%% {ok, "skinner.hem.za.org"}.
-+
-+ case ejabberd_config:get_local_option({sasl_fqdn, ?MYNAME}) of
-+ undefined ->
-+ {ok, {Addr, _Port}} = inet:sockname(Socket#socket_state.socket),
-+ case inet:gethostbyaddr(Addr) of
-+ {ok, HostEnt} when is_record(HostEnt, hostent) ->
-+ {ok, HostEnt#hostent.h_name};
-+ {error, nxdomain} ->
-+ % Quick fix
-+ {ok, inet_parse:ntoa(Addr)};
-+ {error, What} ->
-+ ?ERROR_MSG("Error in gethostname:~nSocket: ~p~nError: ~p at Addr ~p", [Socket, What, Addr]),
-+ error
-+ end;
-+ F -> {ok, F}
-+ end.
---
-1.7.2
-
diff --git a/ejabberd-0007-Change-directory-to-readable-by-everyone.patch b/ejabberd-0007-Change-directory-to-readable-by-everyone.patch
deleted file mode 100644
index 8cb54ae..0000000
--- a/ejabberd-0007-Change-directory-to-readable-by-everyone.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From 5e33cd01bfce37dd0dffde1cb372a9b485439796 Mon Sep 17 00:00:00 2001
-From: Peter Lemenkov <lemenkov@gmail.com>
-Date: Thu, 18 Mar 2010 14:57:21 +0300
-Subject: [PATCH 7/9] Change directory to readable by everyone
-
-This requires to suppress error messages like
-"File operation error: eacces". See rhbz #564686:
-
-https://bugzilla.redhat.com/564686
-
-Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
----
- src/ejabberdctl.template | 4 ++++
- 1 files changed, 4 insertions(+), 0 deletions(-)
-
-diff --git a/src/ejabberdctl.template b/src/ejabberdctl.template
-index bceec28..ee74650 100644
---- a/src/ejabberdctl.template
-+++ b/src/ejabberdctl.template
-@@ -355,6 +355,10 @@ wait_for_status()
- return $status
- }
-
-+# In order to prevent issues with "File operation error: eacces."
-+# See rhbz #564686.
-+cd /
-+
- case $ARGS in
- ' start') start;;
- ' debug') debug;;
---
-1.7.2
-
diff --git a/ejabberd-0007-Install-.so-objects-with-0755-permissions.patch b/ejabberd-0007-Install-.so-objects-with-0755-permissions.patch
new file mode 100644
index 0000000..be801ae
--- /dev/null
+++ b/ejabberd-0007-Install-.so-objects-with-0755-permissions.patch
@@ -0,0 +1,26 @@
+From c91ddeb5735d2a4cebda364df6419637679a0dbe Mon Sep 17 00:00:00 2001
+From: Peter Lemenkov <lemenkov@gmail.com>
+Date: Sat, 12 Jun 2010 14:14:52 +0400
+Subject: [PATCH 07/10] Install *.so objects with 0755 permissions
+
+Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
+---
+ src/Makefile.in | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/src/Makefile.in b/src/Makefile.in
+index cf600c3..c9492f3 100644
+--- a/src/Makefile.in
++++ b/src/Makefile.in
+@@ -230,7 +230,7 @@ install: all
+ #
+ # Binary system libraries
+ install -d $(SODIR)
+- install -m 644 *.so $(SODIR)
++ install -m 755 *.so $(SODIR)
+ #
+ # Translated strings
+ install -d $(MSGSDIR)
+--
+1.7.2.1
+
diff --git a/ejabberd-0008-Install-.so-objects-with-0755-permissions.patch b/ejabberd-0008-Install-.so-objects-with-0755-permissions.patch
deleted file mode 100644
index edd53f6..0000000
--- a/ejabberd-0008-Install-.so-objects-with-0755-permissions.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From 875c6c223a7ec6e807bf1629f02c4d9a0f1dc70c Mon Sep 17 00:00:00 2001
-From: Peter Lemenkov <lemenkov@gmail.com>
-Date: Sat, 12 Jun 2010 14:14:52 +0400
-Subject: [PATCH 8/9] Install *.so objects with 0755 permissions
-
-Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
----
- src/Makefile.in | 2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
-
-diff --git a/src/Makefile.in b/src/Makefile.in
-index cf600c3..c9492f3 100644
---- a/src/Makefile.in
-+++ b/src/Makefile.in
-@@ -230,7 +230,7 @@ install: all
- #
- # Binary system libraries
- install -d $(SODIR)
-- install -m 644 *.so $(SODIR)
-+ install -m 755 *.so $(SODIR)
- #
- # Translated strings
- install -d $(MSGSDIR)
---
-1.7.2
-
diff --git a/ejabberd-0008-Use-versioned-directory-for-storing-docs.patch b/ejabberd-0008-Use-versioned-directory-for-storing-docs.patch
new file mode 100644
index 0000000..4ea23bc
--- /dev/null
+++ b/ejabberd-0008-Use-versioned-directory-for-storing-docs.patch
@@ -0,0 +1,35 @@
+From 55622d1af9b27028219257ed7e5583c607a91d2e Mon Sep 17 00:00:00 2001
+From: Peter Lemenkov <lemenkov@gmail.com>
+Date: Sat, 12 Jun 2010 16:12:11 +0400
+Subject: [PATCH 08/10] Use versioned directory for storing docs
+
+It's also a good idea to store doc-files under the versioned directory.
+This may greatly simplify parallel installation of different versions of
+ejabbed.
+
+Note that this may be done in the other way - by changing proper field
+in the AC_INIT macro, see the explanation of the field 'tarname':
+
+http://www.gnu.org/software/autoconf/manual/html_node/Initializing-configure.html
+
+Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
+---
+ src/Makefile.in | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/src/Makefile.in b/src/Makefile.in
+index c9492f3..7b585d0 100644
+--- a/src/Makefile.in
++++ b/src/Makefile.in
+@@ -92,7 +92,7 @@ SBINDIR = $(DESTDIR)@sbindir@
+ EJABBERDDIR = $(DESTDIR)@libdir@/ejabberd
+
+ # /share/doc/ejabberd
+-PACKAGE_TARNAME = @PACKAGE_TARNAME@
++PACKAGE_TARNAME = @PACKAGE_TARNAME@-@PACKAGE_VERSION@
+ datarootdir = @datarootdir@
+ DOCDIR = $(DESTDIR)@docdir@
+
+--
+1.7.2.1
+
diff --git a/ejabberd-0009-Support-SASL-GSSAPI-authentication-thanks-to-Mikael-.patch b/ejabberd-0009-Support-SASL-GSSAPI-authentication-thanks-to-Mikael-.patch
new file mode 100644
index 0000000..435d503
--- /dev/null
+++ b/ejabberd-0009-Support-SASL-GSSAPI-authentication-thanks-to-Mikael-.patch
@@ -0,0 +1,480 @@
+From 6b258db9aba30218c2d651c2c656bdfce39c48a9 Mon Sep 17 00:00:00 2001
+From: Badlop <badlop@process-one.net>
+Date: Thu, 15 Apr 2010 17:20:16 +0200
+Subject: [PATCH 09/10] Support SASL GSSAPI authentication (thanks to Mikael Magnusson)(EJAB-831)
+
+---
+ src/cyrsasl.erl | 76 +++++++++++++++++----
+ src/cyrsasl.hrl | 15 ++++
+ src/cyrsasl_anonymous.erl | 6 +-
+ src/cyrsasl_digest.erl | 6 +-
+ src/cyrsasl_gssapi.erl | 166 +++++++++++++++++++++++++++++++++++++++++++++
+ src/cyrsasl_plain.erl | 6 +-
+ src/ejabberd_c2s.erl | 12 +++-
+ src/ejabberd_socket.erl | 19 +++++
+ 8 files changed, 283 insertions(+), 23 deletions(-)
+ create mode 100644 src/cyrsasl.hrl
+ create mode 100644 src/cyrsasl_gssapi.erl
+
+diff --git a/src/cyrsasl.erl b/src/cyrsasl.erl
+index 121ef6d..ea358f0 100644
+--- a/src/cyrsasl.erl
++++ b/src/cyrsasl.erl
+@@ -30,19 +30,39 @@
+ -export([start/0,
+ register_mechanism/3,
+ listmech/1,
+- server_new/7,
++ server_new/8,
+ server_start/3,
+ server_step/2]).
+
++-include("cyrsasl.hrl").
++-include("ejabberd.hrl").
++
++%% @type saslmechanism() = {sasl_mechanism, Mechanism, Module, Require_Plain}
++%% Mechanism = string()
++%% Module = atom()
++%% Require_Plain = bool().
++%% Registry entry of a supported SASL mechanism.
++
+ -record(sasl_mechanism, {mechanism, module, require_plain_password}).
+--record(sasl_state, {service, myname, realm,
+- get_password, check_password, check_password_digest,
+- mech_mod, mech_state}).
++
++%% @type saslstate() = {sasl_state, Service, Myname, Realm, GetPassword, CheckPassword, CheckPasswordDigest, Mech_Mod, Mech_State}
++%% Service = string()
++%% Myname = string()
++%% Realm = string()
++%% GetPassword = function()
++%% CheckPassword = function()
++%% CheckPasswordDigest = any()
++%% Mech_Mod = atom()
++%% Mech_State = term().
++%% State of this process.
++
++-record(sasl_state, {service, myname,
++ mech_mod, mech_state, params}).
+
+ -export([behaviour_info/1]).
+
+ behaviour_info(callbacks) ->
+- [{mech_new, 4}, {mech_step, 2}];
++ [{mech_new, 1}, {mech_step, 2}];
+ behaviour_info(_Other) ->
+ undefined.
+
+@@ -53,8 +73,30 @@ start() ->
+ cyrsasl_plain:start([]),
+ cyrsasl_digest:start([]),
+ cyrsasl_anonymous:start([]),
++ maybe_try_start_gssapi(),
+ ok.
+
++maybe_try_start_gssapi() ->
++ case os:getenv("KRB5_KTNAME") of
++ false ->
++ ok;
++ _String ->
++ try_start_gssapi()
++ end.
++
++try_start_gssapi() ->
++ case code:load_file(esasl) of
++ {module, _Module} ->
++ cyrsasl_gssapi:start([]);
++ {error, What} ->
++ ?ERROR_MSG("Support for GSSAPI not started because esasl.beam was not found: ~p", [What])
++ end.
++
++%% @spec (Mechanism, Module, Require_Plain) -> true
++%% Mechanism = string()
++%% Module = atom()
++%% Require_Plain = bool()
++
+ register_mechanism(Mechanism, Module, RequirePlainPassword) ->
+ ets:insert(sasl_mechanism,
+ #sasl_mechanism{mechanism = Mechanism,
+@@ -113,24 +155,28 @@ listmech(Host) ->
+ filter_anonymous(Host, Mechs).
+
+ server_new(Service, ServerFQDN, UserRealm, _SecFlags,
+- GetPassword, CheckPassword, CheckPasswordDigest) ->
++ GetPassword, CheckPassword, CheckPasswordDigest, Socket) ->
++ Params = #sasl_params{
++ host = ServerFQDN,
++ realm = UserRealm,
++ get_password = GetPassword,
++ check_password = CheckPassword,
++ check_password_digest= CheckPasswordDigest,
++ socket = Socket
++ },
++
+ #sasl_state{service = Service,
+ myname = ServerFQDN,
+- realm = UserRealm,
+- get_password = GetPassword,
+- check_password = CheckPassword,
+- check_password_digest= CheckPasswordDigest}.
++ params = Params}.
++
+
+ server_start(State, Mech, ClientIn) ->
+ case lists:member(Mech, listmech(State#sasl_state.myname)) of
+ true ->
+ case ets:lookup(sasl_mechanism, Mech) of
+ [#sasl_mechanism{module = Module}] ->
+- {ok, MechState} = Module:mech_new(
+- State#sasl_state.myname,
+- State#sasl_state.get_password,
+- State#sasl_state.check_password,
+- State#sasl_state.check_password_digest),
++ {ok, MechState} =
++ Module:mech_new(State#sasl_state.params),
+ server_step(State#sasl_state{mech_mod = Module,
+ mech_state = MechState},
+ ClientIn);
+diff --git a/src/cyrsasl.hrl b/src/cyrsasl.hrl
+new file mode 100644
+index 0000000..b4cc3e3
+--- /dev/null
++++ b/src/cyrsasl.hrl
+@@ -0,0 +1,15 @@
++%% @type saslparams() = {sasl_params, Host, Realm, GetPassword, CheckPassword, CheckPasswordDigest}
++%% Host = string()
++%% Realm = string()
++%% GetPassword = function()
++%% CheckPassword = function()
++%% CheckPasswordDigest = any().
++%% Parameters for SASL.
++
++-record(sasl_params, {
++ host,
++ realm,
++ get_password,
++ check_password,
++ check_password_digest,
++ socket}).
+diff --git a/src/cyrsasl_anonymous.erl b/src/cyrsasl_anonymous.erl
+index 2b3ba36..2647d28 100644
+--- a/src/cyrsasl_anonymous.erl
++++ b/src/cyrsasl_anonymous.erl
+@@ -27,7 +27,9 @@
+
+ -module(cyrsasl_anonymous).
+
+--export([start/1, stop/0, mech_new/4, mech_step/2]).
++-export([start/1, stop/0, mech_new/1, mech_step/2]).
++
++-include("cyrsasl.hrl").
+
+ -behaviour(cyrsasl).
+
+@@ -40,7 +42,7 @@ start(_Opts) ->
+ stop() ->
+ ok.
+
+-mech_new(Host, _GetPassword, _CheckPassword, _CheckPasswordDigest) ->
++mech_new(#sasl_params{host=Host}) ->
+ {ok, #state{server = Host}}.
+
+ mech_step(State, _ClientIn) ->
+diff --git a/src/cyrsasl_digest.erl b/src/cyrsasl_digest.erl
+index 2a7ce2a..9628137 100644
+--- a/src/cyrsasl_digest.erl
++++ b/src/cyrsasl_digest.erl
+@@ -29,10 +29,11 @@
+
+ -export([start/1,
+ stop/0,
+- mech_new/4,
++ mech_new/1,
+ mech_step/2]).
+
+ -include("ejabberd.hrl").
++-include("cyrsasl.hrl").
+
+ -behaviour(cyrsasl).
+
+@@ -45,7 +46,8 @@ start(_Opts) ->
+ stop() ->
+ ok.
+
+-mech_new(Host, GetPassword, _CheckPassword, CheckPasswordDigest) ->
++mech_new(#sasl_params{host=Host, get_password=GetPassword,
++ check_password_digest=CheckPasswordDigest}) ->
+ {ok, #state{step = 1,
+ nonce = randoms:get_string(),
+ host = Host,
+diff --git a/src/cyrsasl_gssapi.erl b/src/cyrsasl_gssapi.erl
+new file mode 100644
+index 0000000..11d9955
+--- /dev/null
++++ b/src/cyrsasl_gssapi.erl
+@@ -0,0 +1,166 @@
++%%%----------------------------------------------------------------------
++%%% File : cyrsasl_gssapi.erl
++%%% Author : Mikael Magnusson <mikma@users.sourceforge.net>
++%%% Purpose : GSSAPI SASL mechanism
++%%% Created : 1 June 2007 by Mikael Magnusson <mikma@users.sourceforge.net>
++%%% Id : $Id: $
++%%%----------------------------------------------------------------------
++%%%
++%%% Copyright (C) 2007-2009 Mikael Magnusson <mikma@users.sourceforge.net>
++%%%
++%%% Permission is hereby granted, free of charge, to any person
++%%% obtaining a copy of this software and associated documentation
++%%% files (the "Software"), to deal in the Software without
++%%% restriction, including without limitation the rights to use, copy,
++%%% modify, merge, publish, distribute, sublicense, and/or sell copies
++%%% of the Software, and to permit persons to whom the Software is
++%%% furnished to do so, subject to the following conditions:
++%%%
++%%% The above copyright notice and this permission notice shall be
++%%% included in all copies or substantial portions of the Software.
++%%%
++%%% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
++%%% EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
++%%% MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
++%%% NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
++%%% BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
++%%% ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
++%%% CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
++%%% SOFTWARE.
++%%%
++
++%%%
++%%% configuration options:
++%%% {sasl_realm, "<Kerberos realm>"}.
++%%%
++%%% environment variables:
++%%% KRB5_KTNAME
++%%%
++
++-module(cyrsasl_gssapi).
++-author('mikma@users.sourceforge.net').
++-vsn('$Revision: $ ').
++
++-export([start/1,
++ stop/0,
++ mech_new/1,
++ mech_step/2]).
++
++-include("ejabberd.hrl").
++-include("cyrsasl.hrl").
++
++-behaviour(cyrsasl).
++
++-define(SERVER, ?MODULE).
++-define(SERVICE, "xmpp").
++
++-record(state, {sasl,
++ needsmore=true,
++ step=0,
++ host,
++ realm,
++ authid,
++ authzid,
++ authrealm,
++ error}).
++
++start(_Opts) ->
++ ChildSpec =
++ {?SERVER,
++ {esasl, start_link, [{local, ?SERVER}]},
++ transient,
++ 1000,
++ worker,
++ [esasl]},
++
++ case supervisor:start_child(ejabberd_sup, ChildSpec) of
++ {ok, _Pid} ->
++ cyrsasl:register_mechanism("GSSAPI", ?MODULE, false);
++ {error, Error} = E ->
++ ?ERROR_MSG("esasl failed: ~p", [Error]),
++ E
++ end.
++
++
++stop() ->
++ catch esasl:stop(?SERVER),
++ supervisor:terminate_child(ejabberd_sup, ?SERVER),
++ supervisor:delete_child(ejabberd_sup, ?SERVER).
++
++mech_new(#sasl_params{host=Host, realm=Realm, socket=Socket}) ->
++ case ejabberd_socket:gethostname(Socket) of
++ {ok, FQDN} ->
++ ?DEBUG("mech_new ~p ~p ~p~n", [Host, Realm, FQDN]),
++ case esasl:server_start(?SERVER, "GSSAPI", ?SERVICE, FQDN) of
++ {ok, Sasl} ->
++ {ok, #state{sasl=Sasl,host=Host,realm=Realm}};
++ {error, {gsasl_error, Error}} ->
++ {ok, Str} = esasl:str_error(?SERVER, Error),
++ ?DEBUG("esasl error: ~p", [Str]),
++ {ok, #state{needsmore=error,error="internal-server-error"}};
++ {error, Error} ->
++ ?DEBUG("esasl error: ~p", [Error]),
++ {ok, #state{needsmore=error,error="internal-server-error"}}
++ end;
++ {error, Error} ->
++ ?DEBUG("gethostname error: ~p", [Error]),
++ {ok, #state{needsmore=error,error="internal-server-error"}}
++ end.
++
++mech_step(State, ClientIn) when is_list(ClientIn) ->
++ catch do_step(State, ClientIn).
++
++do_step(#state{needsmore=error,error=Error}=_State, _) ->
++ {error, Error};
++do_step(#state{needsmore=false}=State, _) ->
++ check_user(State);
++do_step(#state{needsmore=true,sasl=Sasl,step=Step}=State, ClientIn) ->
++ ?DEBUG("mech_step~n", []),
++ case esasl:step(Sasl, list_to_binary(ClientIn)) of
++ {ok, RspAuth} ->
++ ?DEBUG("ok~n", []),
++ {ok, Display_name} = esasl:property_get(Sasl, gssapi_display_name),
++ {ok, Authzid} = esasl:property_get(Sasl, authzid),
++ {Authid, [$@ | Auth_realm]} =
++ lists:splitwith(fun(E)->E =/= $@ end, Display_name),
++ State1 = State#state{authid=Authid,
++ authzid=Authzid,
++ authrealm=Auth_realm},
++ handle_step_ok(State1, binary_to_list(RspAuth));
++ {needsmore, RspAuth} ->
++ ?DEBUG("needsmore~n", []),
++ if (Step > 0) and (ClientIn =:= []) and (RspAuth =:= <<>>) ->
++ {error, "not-authorized"};
++ true ->
++ {continue, binary_to_list(RspAuth),
++ State#state{step=Step+1}}
++ end;
++ {error, _} ->
++ {error, "not-authorized"}
++ end.
++
++handle_step_ok(State, []) ->
++ check_user(State);
++handle_step_ok(#state{step=Step}=State, RspAuth) ->
++ ?DEBUG("continue~n", []),
++ {continue, RspAuth, State#state{needsmore=false,step=Step+1}}.
++
++check_user(#state{authid=Authid,authzid=Authzid,
++ authrealm=Auth_realm,host=Host,realm=Realm}) ->
++ if Realm =/= Auth_realm ->
++ ?DEBUG("bad realm ~p (expected ~p)~n",[Auth_realm, Realm]),
++ throw({error, "not-authorized"});
++ true ->
++ ok
++ end,
++
++ case ejabberd_auth:is_user_exists(Authid, Host) of
++ false ->
++ ?DEBUG("bad user ~p~n",[Authid]),
++ throw({error, "not-authorized"});
++ true ->
++ ok
++ end,
++
++ ?DEBUG("GSSAPI authenticated ~p ~p~n", [Authid, Authzid]),
++ {ok, [{username, Authid}, {authzid, Authzid}]}.
+diff --git a/src/cyrsasl_plain.erl b/src/cyrsasl_plain.erl
+index 129fb8b..4799a41 100644
+--- a/src/cyrsasl_plain.erl
++++ b/src/cyrsasl_plain.erl
+@@ -27,7 +27,9 @@
+ -module(cyrsasl_plain).
+ -author('alexey@process-one.net').
+
+--export([start/1, stop/0, mech_new/4, mech_step/2, parse/1]).
++-export([start/1, stop/0, mech_new/1, mech_step/2, parse/1]).
++
++-include("cyrsasl.hrl").
+
+ -behaviour(cyrsasl).
+
+@@ -40,7 +42,7 @@ start(_Opts) ->
+ stop() ->
+ ok.
+
+-mech_new(_Host, _GetPassword, CheckPassword, _CheckPasswordDigest) ->
++mech_new(#sasl_params{check_password = CheckPassword}) ->
+ {ok, #state{check_password = CheckPassword}}.
+
+ mech_step(State, ClientIn) ->
+diff --git a/src/ejabberd_c2s.erl b/src/ejabberd_c2s.erl
+index d4b6809..3e0a49c 100644
+--- a/src/ejabberd_c2s.erl
++++ b/src/ejabberd_c2s.erl
+@@ -254,9 +254,16 @@ wait_for_stream({xmlstreamstart, _Name, Attrs}, StateData) ->
+ send_header(StateData, Server, "1.0", DefaultLang),
+ case StateData#state.authenticated of
+ false ->
++ Realm =
++ case ejabberd_config:get_local_option({sasl_realm, Server}) of
++ undefined ->
++ "";
++ Realm0 ->
++ Realm0
++ end,
+ SASLState =
+ cyrsasl:server_new(
+- "jabber", Server, "", [],
++ "jabber", Server, Realm, [],
+ fun(U) ->
+ ejabberd_auth:get_password_with_authmodule(
+ U, Server)
+@@ -268,7 +275,8 @@ wait_for_stream({xmlstreamstart, _Name, Attrs}, StateData) ->
+ fun(U, P, D, DG) ->
+ ejabberd_auth:check_password_with_authmodule(
+ U, Server, P, D, DG)
+- end),
++ end,
++ StateData#state.socket),
+ Mechs = lists:map(
+ fun(S) ->
+ {xmlelement, "mechanism", [],
+diff --git a/src/ejabberd_socket.erl b/src/ejabberd_socket.erl
+index 25ff64c..e8c5fca 100644
+--- a/src/ejabberd_socket.erl
++++ b/src/ejabberd_socket.erl
+@@ -44,9 +44,11 @@
+ get_peer_certificate/1,
+ get_verify_result/1,
+ close/1,
++ gethostname/1,
+ sockname/1, peername/1]).
+
+ -include("ejabberd.hrl").
++-include_lib("kernel/include/inet.hrl").
+
+ -record(socket_state, {sockmod, socket, receiver}).
+
+@@ -222,6 +224,23 @@ peername(#socket_state{sockmod = SockMod, socket = Socket}) ->
+ SockMod:peername(Socket)
+ end.
+
++gethostname(#socket_state{socket = Socket} = State) ->
++ ?DEBUG("gethostname ~p~n", [Socket]),
++
++ case sockname(State) of
++ {ok, {Addr, _Port}} ->
++ case inet:gethostbyaddr(Addr) of
++ {ok, HostEnt} when is_record(HostEnt, hostent) ->
++ ?DEBUG("gethostname result ~p~n",
++ [HostEnt#hostent.h_name]),
++ {ok, HostEnt#hostent.h_name};
++ {error, _Reason} = E ->
++ E
++ end;
++ {error, _Reason} = E ->
++ E
++ end.
++
+ %%====================================================================
+ %% Internal functions
+ %%====================================================================
+--
+1.7.2.1
+
diff --git a/ejabberd-0009-Use-versioned-directory-for-storing-docs.patch b/ejabberd-0009-Use-versioned-directory-for-storing-docs.patch
deleted file mode 100644
index 5d71b47..0000000
--- a/ejabberd-0009-Use-versioned-directory-for-storing-docs.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From 9fd1fc4302b10e2b064cfb92484a29c75493cc91 Mon Sep 17 00:00:00 2001
-From: Peter Lemenkov <lemenkov@gmail.com>
-Date: Sat, 12 Jun 2010 16:12:11 +0400
-Subject: [PATCH 9/9] Use versioned directory for storing docs
-
-It's also a good idea to store doc-files under the versioned directory.
-This may greatly simplify parallel installation of different versions of
-ejabbed.
-
-Note that this may be done in the other way - by changing proper field
-in the AC_INIT macro, see the explanation of the field 'tarname':
-
-http://www.gnu.org/software/autoconf/manual/html_node/Initializing-configure.html
-
-Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
----
- src/Makefile.in | 2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
-
-diff --git a/src/Makefile.in b/src/Makefile.in
-index c9492f3..7b585d0 100644
---- a/src/Makefile.in
-+++ b/src/Makefile.in
-@@ -92,7 +92,7 @@ SBINDIR = $(DESTDIR)@sbindir@
- EJABBERDDIR = $(DESTDIR)@libdir@/ejabberd
-
- # /share/doc/ejabberd
--PACKAGE_TARNAME = @PACKAGE_TARNAME@
-+PACKAGE_TARNAME = @PACKAGE_TARNAME@-@PACKAGE_VERSION@
- datarootdir = @datarootdir@
- DOCDIR = $(DESTDIR)@docdir@
-
---
-1.7.2
-
diff --git a/ejabberd-0010-Fix-http-poll.patch b/ejabberd-0010-Fix-http-poll.patch
new file mode 100644
index 0000000..3a98d94
--- /dev/null
+++ b/ejabberd-0010-Fix-http-poll.patch
@@ -0,0 +1,28 @@
+From cfca338f9548e05e254e39a605e63cbb5ec7421b Mon Sep 17 00:00:00 2001
+From: Peter Lemenkov <lemenkov@gmail.com>
+Date: Wed, 18 Aug 2010 14:09:57 +0400
+Subject: [PATCH 10/10] Fix http-poll
+
+Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
+---
+ src/web/ejabberd_http_poll.erl | 4 ++++
+ 1 files changed, 4 insertions(+), 0 deletions(-)
+
+diff --git a/src/web/ejabberd_http_poll.erl b/src/web/ejabberd_http_poll.erl
+index 0bdbc62..3de2ea4 100644
+--- a/src/web/ejabberd_http_poll.erl
++++ b/src/web/ejabberd_http_poll.erl
+@@ -271,6 +271,10 @@ handle_event(_Event, StateName, StateData) ->
+ %% {stop, Reason, NewStateData} |
+ %% {stop, Reason, Reply, NewStateData}
+ %%----------------------------------------------------------------------
++handle_sync_event({send, Packet}, _From, StateName, StateData) when is_binary(Packet) ->
++ Output = StateData#state.output ++ lists:flatten(binary_to_list(Packet)),
++ Reply = ok,
++ {reply, Reply, StateName, StateData#state{output = Output}};
+ handle_sync_event({send, Packet}, _From, StateName, StateData) ->
+ Output = StateData#state.output ++ [lists:flatten(Packet)],
+ Reply = ok,
+--
+1.7.2.1
+
diff --git a/ejabberd.spec b/ejabberd.spec
index db5c8e8..797b9b9 100644
--- a/ejabberd.spec
+++ b/ejabberd.spec
@@ -11,7 +11,7 @@
Name: ejabberd
Version: 2.1.5
-Release: 1%{?dist}
+Release: 3%{?dist}
Summary: A distributed, fault-tolerant Jabber/XMPP server
Group: Applications/Internet
@@ -48,14 +48,16 @@ Patch3: ejabberd-0003-Fixed-delays-in-s2s-connections.patch
Patch4: ejabberd-0004-Introducing-mod_admin_extra.patch
# BZ# 439583, 452326, 451554, 465196, 502361 (fedora/epel-specific)
Patch5: ejabberd-0005-Fedora-specific-changes-to-ejabberdctl.patch
-# http://www.ejabberd.im/cyrsasl_gssapi (proposed for inclusion into upstream)
-Patch6: ejabberd-0006-Support-to-authenticate-against-SASL-GSSAPI.patch
# Fix issue with "File operation error: eacces"
-Patch7: ejabberd-0007-Change-directory-to-readable-by-everyone.patch
+Patch6: ejabberd-0006-Change-directory-to-readable-by-everyone.patch
# Fix so-lib permissions while installing (fedora/epel-specific)
-Patch8: ejabberd-0008-Install-.so-objects-with-0755-permissions.patch
+Patch7: ejabberd-0007-Install-.so-objects-with-0755-permissions.patch
# Will be proposed for incusion into upstream
-Patch9: ejabberd-0009-Use-versioned-directory-for-storing-docs.patch
+Patch8: ejabberd-0008-Use-versioned-directory-for-storing-docs.patch
+# Backported from upstream
+Patch9: ejabberd-0009-Support-SASL-GSSAPI-authentication-thanks-to-Mikael-.patch
+# Will be proposed for inclusion into upstream
+Patch10: ejabberd-0010-Fix-http-poll.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -64,7 +66,6 @@ BuildRequires: expat-devel
BuildRequires: openssl-devel >= 0.9.8
BuildRequires: pam-devel
BuildRequires: erlang
-BuildRequires: dos2unix
BuildRequires: fedora-usermgmt-devel
%if 0%{?with_hevea}
BuildRequires: hevea
@@ -118,10 +119,11 @@ Documentation for ejabberd.
%patch3 -p1 -b .s2s_delays
%patch4 -p1 -b .mod_admin_extra
%patch5 -p1 -b .fedora_specific
-%patch6 -p1 -b .gssapi
-%patch7 -p1 -b .fix_access
-%patch8 -p1 -b .fix_perms
-%patch9 -p1 -b .versioned_docdir
+%patch6 -p1 -b .fix_access
+%patch7 -p1 -b .fix_perms
+%patch8 -p1 -b .versioned_docdir
+%patch9 -p1 -b .gssapi
+%patch10 -p1 -b .http-poll
cp %{S:4} src
cp %{S:5} src
@@ -307,6 +309,7 @@ rm -rf %{buildroot}
%{_libdir}/%{name}/ebin/*.beam
%{_libdir}/%{name}/include/XmppAddr.hrl
%{_libdir}/%{name}/include/adhoc.hrl
+%{_libdir}/%{name}/include/cyrsasl.hrl
%{_libdir}/%{name}/include/ejabberd.hrl
%{_libdir}/%{name}/include/ejabberd_commands.hrl
%{_libdir}/%{name}/include/ejabberd_config.hrl
@@ -351,6 +354,13 @@ rm -rf %{buildroot}
%doc %{_docdir}/%{name}-%{version}/*.txt
%changelog
+* Wed Aug 18 2010 Peter Lemenkov <lemenkov@gmail.com> 2.1.5-3
+- Fixed http-poll (BOSH)
+- New version of GSSAPI patch (backported from upstream)
+
+* Wed Aug 4 2010 Peter Lemenkov <lemenkov@gmail.com> 2.1.5-2
+- Don't require dos2unix for building anymore
+
* Wed Aug 4 2010 Peter Lemenkov <lemenkov@gmail.com> 2.1.5-1
- Ver. 2.1.5
- OpenSSL >= 0.9.8
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-09-23 19:07 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-23 19:07 [rpms/ejabberd] f45: Fixed http-poll Peter Lemenkov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox