trunk
changeset 4940:39781d4d3173
Merge 0.9->trunk
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Thu, 05 Jul 2012 17:40:12 +0100 |
| parents | 212e81ac6ebb 0545a574667b |
| children | 716db7d94481 |
| files | |
| diffstat | 7 files changed, 40 insertions(+), 8 deletions(-) [+] |
line diff
1.1 --- a/TODO Thu Jul 05 00:15:49 2012 +0200 1.2 +++ b/TODO Thu Jul 05 17:40:12 2012 +0100 1.3 @@ -5,5 +5,6 @@ 1.4 - Web interface 1.5 1.6 == 1.0 == 1.7 +- Statistics 1.8 - Clustering 1.9 - World domination
2.1 --- a/plugins/mod_saslauth.lua Thu Jul 05 00:15:49 2012 +0200 2.2 +++ b/plugins/mod_saslauth.lua Thu Jul 05 17:40:12 2012 +0100 2.3 @@ -208,7 +208,7 @@ 2.4 session.sasl_handler = nil; -- allow starting a new SASL negotiation before completing an old one 2.5 end 2.6 if not session.sasl_handler then 2.7 - session.sasl_handler = usermanager_get_sasl_handler(module.host); 2.8 + session.sasl_handler = usermanager_get_sasl_handler(module.host, session); 2.9 end 2.10 local mechanism = stanza.attr.mechanism; 2.11 if not session.secure and (secure_auth_only or (mechanism == "PLAIN" and not allow_unencrypted_plain_auth)) then 2.12 @@ -246,7 +246,7 @@ 2.13 if secure_auth_only and not origin.secure then 2.14 return; 2.15 end 2.16 - origin.sasl_handler = usermanager_get_sasl_handler(module.host); 2.17 + origin.sasl_handler = usermanager_get_sasl_handler(module.host, origin); 2.18 local mechanisms = st.stanza("mechanisms", mechanisms_attr); 2.19 for mechanism in pairs(origin.sasl_handler:mechanisms()) do 2.20 if mechanism ~= "PLAIN" or origin.secure or allow_unencrypted_plain_auth then
3.1 --- a/prosodyctl Thu Jul 05 00:15:49 2012 +0200 3.2 +++ b/prosodyctl Thu Jul 05 17:40:12 2012 +0100 3.3 @@ -688,7 +688,7 @@ 3.4 show_message("There was a problem, see OpenSSL output"); 3.5 else 3.6 show_usage("cert key HOSTNAME <bits>", "Generates a RSA key named HOSTNAME.key\n " 3.7 - .."Promps for a key size if none given") 3.8 + .."Prompts for a key size if none given") 3.9 end 3.10 end 3.11
4.1 --- a/util-src/pposix.c Thu Jul 05 00:15:49 2012 +0200 4.2 +++ b/util-src/pposix.c Thu Jul 05 17:40:12 2012 +0100 4.3 @@ -581,6 +581,37 @@ 4.4 return 1; 4.5 } 4.6 4.7 +int lc_setenv(lua_State* L) 4.8 +{ 4.9 + const char *var = luaL_checkstring(L, 1); 4.10 + const char *value; 4.11 + 4.12 + /* If the second argument is nil or nothing, unset the var */ 4.13 + if(lua_isnoneornil(L, 2)) 4.14 + { 4.15 + if(unsetenv(var) != 0) 4.16 + { 4.17 + lua_pushnil(L); 4.18 + lua_pushstring(L, strerror(errno)); 4.19 + return 2; 4.20 + } 4.21 + lua_pushboolean(L, 1); 4.22 + return 1; 4.23 + } 4.24 + 4.25 + value = luaL_checkstring(L, 2); 4.26 + 4.27 + if(setenv(var, value, 1) != 0) 4.28 + { 4.29 + lua_pushnil(L); 4.30 + lua_pushstring(L, strerror(errno)); 4.31 + return 2; 4.32 + } 4.33 + 4.34 + lua_pushboolean(L, 1); 4.35 + return 1; 4.36 +} 4.37 + 4.38 /* Register functions */ 4.39 4.40 int luaopen_util_pposix(lua_State *L) 4.41 @@ -612,6 +643,8 @@ 4.42 4.43 { "uname", lc_uname }, 4.44 4.45 + { "setenv", lc_setenv }, 4.46 + 4.47 { NULL, NULL } 4.48 }; 4.49
5.1 --- a/util/logger.lua Thu Jul 05 00:15:49 2012 +0200 5.2 +++ b/util/logger.lua Thu Jul 05 17:40:12 2012 +0100 5.3 @@ -23,8 +23,6 @@ 5.4 local log_warn = make_logger(name, "warn"); 5.5 local log_error = make_logger(name, "error"); 5.6 5.7 - --name = nil; -- While this line is not commented, will automatically fill in file/line number info 5.8 - local namelen = #name; 5.9 return function (level, message, ...) 5.10 if level == "debug" then 5.11 return log_debug(message, ...);
6.1 --- a/util/sasl.lua Thu Jul 05 00:15:49 2012 +0200 6.2 +++ b/util/sasl.lua Thu Jul 05 17:40:12 2012 +0100 6.3 @@ -35,7 +35,7 @@ 6.4 local backend_mechanism = {}; 6.5 6.6 -- register a new SASL mechanims 6.7 -local function registerMechanism(name, backends, f) 6.8 +function registerMechanism(name, backends, f) 6.9 assert(type(name) == "string", "Parameter name MUST be a string."); 6.10 assert(type(backends) == "string" or type(backends) == "table", "Parameter backends MUST be either a string or a table."); 6.11 assert(type(f) == "function", "Parameter f MUST be a function.");
7.1 --- a/util/stanza.lua Thu Jul 05 00:15:49 2012 +0200 7.2 +++ b/util/stanza.lua Thu Jul 05 17:40:12 2012 +0100 7.3 @@ -133,14 +133,14 @@ 7.4 end 7.5 7.6 function stanza_mt:childtags(name, xmlns) 7.7 - xmlns = xmlns or self.attr.xmlns; 7.8 local tags = self.tags; 7.9 local start_i, max_i = 1, #tags; 7.10 return function () 7.11 for i = start_i, max_i do 7.12 local v = tags[i]; 7.13 if (not name or v.name == name) 7.14 - and (not xmlns or xmlns == v.attr.xmlns) then 7.15 + and ((not xmlns and self.attr.xmlns == v.attr.xmlns) 7.16 + or v.attr.xmlns == xmlns) then 7.17 start_i = i+1; 7.18 return v; 7.19 end
