# HG changeset patch # User Waqas Hussain # Date 1321910022 -18000 # Node ID ee65aa40ef601d941673aa3ff4a55ce32c2823d1 # Parent 6f5ed0f4a3e693ecc7f1b3c84501e9ba204c387f util.dependencies, util.xmppstream: Move LuaExpat version checking to util.dependencies. diff -r 6f5ed0f4a3e6 -r ee65aa40ef60 util/dependencies.lua --- a/util/dependencies.lua Tue Nov 22 01:44:28 2011 +0500 +++ b/util/dependencies.lua Tue Nov 22 02:13:42 2011 +0500 @@ -136,6 +136,14 @@ 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.1.1 or higher as soon as possible. See " + .."http://prosody.im/doc/depends#luaexpat for more information."); + end + end end return _M; diff -r 6f5ed0f4a3e6 -r ee65aa40ef60 util/xmppstream.lua --- a/util/xmppstream.lua Tue Nov 22 01:44:28 2011 +0500 +++ b/util/xmppstream.lua Tue Nov 22 02:13:42 2011 +0500 @@ -20,13 +20,6 @@ -- COMPAT: w/LuaExpat 1.1.0 local lxp_supports_doctype = pcall(lxp.new, { StartDoctypeDecl = false }); -if not lxp_supports_doctype then - local default_log = require "util.logger".init("xmppstream"); - default_log("warn", "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 " - .."http://prosody.im/doc/depends#luaexpat for more information."); -end module "xmppstream"