From d47dee8009826d6a43bc5ceaf74ed3899fadf599 Mon Sep 17 00:00:00 2001 From: Evgeniy Khramtsov Date: Thu, 3 Jan 2013 20:26:16 +1000 Subject: [PATCH] Make sure update_info returns atoms only (EJAB-1595) (Thanks to Jose M Herrero) --- src/ejabberd_update.erl | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/src/ejabberd_update.erl b/src/ejabberd_update.erl index 7572d3da4..19a4029bd 100644 --- a/src/ejabberd_update.erl +++ b/src/ejabberd_update.erl @@ -142,23 +142,26 @@ build_script(Dir, UpdatedBeams) -> release_handler_1:check_script( LowLevelScript, [{ejabberd, "", filename:join(Dir, "..")}]), - case Check of - ok -> - %% This clause is for OTP R14B03 and older. - %% Newer Dialyzer reports a never match pattern; don't worry. - ?DEBUG("script: ~p~n", [Script]), - ?DEBUG("low level script: ~p~n", [LowLevelScript]), - ?DEBUG("check: ~p~n", [Check]); - {ok, []} -> - ?DEBUG("script: ~p~n", [Script]), - ?DEBUG("low level script: ~p~n", [LowLevelScript]), - ?DEBUG("check: ~p~n", [Check]); - _ -> - ?ERROR_MSG("script: ~p~n", [Script]), - ?ERROR_MSG("low level script: ~p~n", [LowLevelScript]), - ?ERROR_MSG("check: ~p~n", [Check]) - end, - {Script, LowLevelScript, Check}. + Check1 = case Check of + ok -> + %% This clause is for OTP R14B03 and older. + %% Newer Dialyzer reports a never match pattern; don't worry. + ?DEBUG("script: ~p~n", [Script]), + ?DEBUG("low level script: ~p~n", [LowLevelScript]), + ?DEBUG("check: ~p~n", [Check]), + ok; + {ok, []} -> + ?DEBUG("script: ~p~n", [Script]), + ?DEBUG("low level script: ~p~n", [LowLevelScript]), + ?DEBUG("check: ~p~n", [Check]), + ok; + _ -> + ?ERROR_MSG("script: ~p~n", [Script]), + ?ERROR_MSG("low level script: ~p~n", [LowLevelScript]), + ?ERROR_MSG("check: ~p~n", [Check]), + error + end, + {Script, LowLevelScript, Check1}. %% Copied from Erlang/OTP file: lib/sasl/src/systools.hrl -record(application,