From 8c027ab41d6990c174a148f2f549d79091d3869a Mon Sep 17 00:00:00 2001 From: Alexey Shchepin Date: Thu, 16 Oct 2003 18:17:44 +0000 Subject: [PATCH] * src/mod_configure.erl: Fixed some error codes * src/cyrsasl_digest.erl: Bugfix (thanks to Justin Karneges) SVN Revision: 151 --- ChangeLog | 6 ++++++ src/cyrsasl_digest.erl | 11 +++++------ src/mod_configure.erl | 20 ++++++++++---------- 3 files changed, 21 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index 04dd65443..78002c649 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2003-10-16 Alexey Shchepin + + * src/mod_configure.erl: Fixed some error codes + + * src/cyrsasl_digest.erl: Bugfix (thanks to Justin Karneges) + 2003-10-14 Alexey Shchepin * src/ejabberd_local.erl: Bugfix diff --git a/src/cyrsasl_digest.erl b/src/cyrsasl_digest.erl index 9b43b2e35..5d768b926 100644 --- a/src/cyrsasl_digest.erl +++ b/src/cyrsasl_digest.erl @@ -33,7 +33,7 @@ mech_new() -> mech_step(#state{step = 1, nonce = Nonce} = State, "") -> {continue, - "nonce=\"" ++ jlib:encode_base64(Nonce) ++ + "nonce=\"" ++ Nonce ++ "\",qop=\"auth\",charset=utf-8,algorithm=md5-sess", %"\",qop=\"auth,auth-int\",charset=utf-8,algorithm=md5-sess", State#state{step = 3}}; @@ -48,13 +48,13 @@ mech_step(#state{step = 3, nonce = Nonce} = State, ClientIn) -> false -> {error, "no-user"}; Passwd -> - Response = response(KeyVals, UserName, Passwd, AuthzId, - "AUTHENTICATE"), + Response = response(KeyVals, UserName, Passwd, + Nonce, AuthzId, "AUTHENTICATE"), case xml:get_attr_s("response", KeyVals) of Response -> RspAuth = response(KeyVals, UserName, Passwd, - AuthzId, ""), + Nonce, AuthzId, ""), {continue, "rspauth=" ++ RspAuth, State#state{step = 5, @@ -127,9 +127,8 @@ hex([N | Ns], Res) -> digit_to_xchar(N div 16) | Res]). -response(KeyVals, User, Passwd, AuthzId, A2Prefix) -> +response(KeyVals, User, Passwd, Nonce, AuthzId, A2Prefix) -> Realm = xml:get_attr_s("realm", KeyVals), - Nonce = xml:get_attr_s("nonce", KeyVals), CNonce = xml:get_attr_s("cnonce", KeyVals), DigestURI = xml:get_attr_s("digest-uri", KeyVals), NC = xml:get_attr_s("nc", KeyVals), diff --git a/src/mod_configure.erl b/src/mod_configure.erl index 18cdbdc90..9702b83fe 100644 --- a/src/mod_configure.erl +++ b/src/mod_configure.erl @@ -126,7 +126,7 @@ process_local_iq(From, To, {iq, ID, Type, XMLNS, SubEl}) -> get_form(["running nodes", ENode, "DB"], Lang) -> case search_running_node(ENode) of false -> - {error, "404", "Not Found"}; + {error, ?ERR_ITEM_NOT_FOUND}; Node -> case rpc:call(Node, mnesia, system_info, [tables]) of {badrpc, Reason} -> @@ -160,7 +160,7 @@ get_form(["running nodes", ENode, "DB"], Lang) -> get_form(["running nodes", ENode, "modules", "stop"], Lang) -> case search_running_node(ENode) of false -> - {error, "404", "Not Found"}; + {error, ?ERR_ITEM_NOT_FOUND}; Node -> case rpc:call(Node, gen_mod, loaded_modules, []) of {badrpc, Reason} -> @@ -387,7 +387,7 @@ get_form(_, Lang) -> set_form(["running nodes", ENode, "DB"], Lang, XData) -> case search_running_node(ENode) of false -> - {error, "404", "Not Found"}; + {error, ?ERR_ITEM_NOT_FOUND}; Node -> lists:foreach( fun({SVar, SVals}) -> @@ -421,7 +421,7 @@ set_form(["running nodes", ENode, "DB"], Lang, XData) -> set_form(["running nodes", ENode, "modules", "stop"], Lang, XData) -> case search_running_node(ENode) of false -> - {error, "404", "Not Found"}; + {error, ?ERR_ITEM_NOT_FOUND}; Node -> lists:foreach( fun({Var, Vals}) -> @@ -439,7 +439,7 @@ set_form(["running nodes", ENode, "modules", "stop"], Lang, XData) -> set_form(["running nodes", ENode, "modules", "start"], Lang, XData) -> case search_running_node(ENode) of false -> - {error, "404", "Not Found"}; + {error, ?ERR_ITEM_NOT_FOUND}; Node -> case lists:keysearch("modules", 1, XData) of false -> @@ -475,7 +475,7 @@ set_form(["running nodes", ENode, "modules", "start"], Lang, XData) -> set_form(["running nodes", ENode, "backup", "backup"], Lang, XData) -> case search_running_node(ENode) of false -> - {error, "404", "Not Found"}; + {error, ?ERR_ITEM_NOT_FOUND}; Node -> case lists:keysearch("path", 1, XData) of false -> @@ -498,7 +498,7 @@ set_form(["running nodes", ENode, "backup", "backup"], Lang, XData) -> set_form(["running nodes", ENode, "backup", "restore"], Lang, XData) -> case search_running_node(ENode) of false -> - {error, "404", "Not Found"}; + {error, ?ERR_ITEM_NOT_FOUND}; Node -> case lists:keysearch("path", 1, XData) of false -> @@ -522,7 +522,7 @@ set_form(["running nodes", ENode, "backup", "restore"], Lang, XData) -> set_form(["running nodes", ENode, "backup", "textfile"], Lang, XData) -> case search_running_node(ENode) of false -> - {error, "404", "Not Found"}; + {error, ?ERR_ITEM_NOT_FOUND}; Node -> case lists:keysearch("path", 1, XData) of false -> @@ -545,7 +545,7 @@ set_form(["running nodes", ENode, "backup", "textfile"], Lang, XData) -> set_form(["running nodes", ENode, "import", "file"], Lang, XData) -> case search_running_node(ENode) of false -> - {error, "404", "Not Found"}; + {error, ?ERR_ITEM_NOT_FOUND}; Node -> case lists:keysearch("path", 1, XData) of false -> @@ -562,7 +562,7 @@ set_form(["running nodes", ENode, "import", "file"], Lang, XData) -> set_form(["running nodes", ENode, "import", "dir"], Lang, XData) -> case search_running_node(ENode) of false -> - {error, "404", "Not Found"}; + {error, ?ERR_ITEM_NOT_FOUND}; Node -> case lists:keysearch("path", 1, XData) of false ->