Merge with 0.10
[prosody.git] / util / dependencies.lua
index 109a3332e9180c50dcc0915cd4d3af0d53340584..ea19d9a8b606b4f5cfa1d372b54d0f117035135c 100644 (file)
@@ -49,6 +49,14 @@ package.preload["util.ztact"] = function ()
 end;
 
 function check_dependencies()
+       if _VERSION ~= "Lua 5.1" then
+               print "***********************************"
+               print("Unsupported Lua version: ".._VERSION);
+               print("Only Lua 5.1 is supported.");
+               print "***********************************"
+               return false;
+       end
+
        local fatal;
 
        local lxp = softreq "lxp"
@@ -140,7 +148,15 @@ function log_warnings()
                if not pcall(lxp.new, { StartDoctypeDecl = false }) then
                        log("error", "The version of LuaExpat on your system leaves Prosody "
                                .."vulnerable to denial-of-service attacks. You should upgrade to "
-                               .."LuaExpat 1.1.1 or higher as soon as possible. See "
+                               .."LuaExpat 1.3.0 or higher as soon as possible. See "
+                               .."http://prosody.im/doc/depends#luaexpat for more information.");
+               end
+               if not lxp.new({}).getcurrentbytecount then
+                       log("error", "The version of LuaExpat on your system does not support "
+                               .."stanza size limits, which may leave servers on untrusted "
+                               .."networks (e.g. the internet) vulnerable to denial-of-service "
+                               .."attacks. You should upgrade to LuaExpat 1.3.0 or higher as "
+                               .."soon as possible. See "
                                .."http://prosody.im/doc/depends#luaexpat for more information.");
                end
        end