util.ip: Fix protocol detection of IPv6 addresses beginning with : [Backported from...
[prosody.git] / util / dependencies.lua
index 5baea942af4b52781332af029b0c30e47841219d..4d50cf63a17452d76f17891cdba3f9e57d5eec51 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"
@@ -136,6 +144,22 @@ function log_warnings()
                        log("error", "This version of LuaSec contains a known bug that causes disconnects, see http://prosody.im/doc/depends");
                end
        end
+       if lxp then
+               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.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
 end
 
 return _M;