Fix remote exploit
- fixes the exploit so that 0.6.2 can be used in tests
This commit is contained in:
parent
b304872b68
commit
3822c1e934
|
@ -3,8 +3,10 @@ from os import path, listdir
|
||||||
from string import lower
|
from string import lower
|
||||||
|
|
||||||
from debug import logger
|
from debug import logger
|
||||||
|
import messagetypes
|
||||||
import paths
|
import paths
|
||||||
|
|
||||||
|
|
||||||
class MsgBase(object):
|
class MsgBase(object):
|
||||||
def encode(self):
|
def encode(self):
|
||||||
self.data = {"": lower(type(self).__name__)}
|
self.data = {"": lower(type(self).__name__)}
|
||||||
|
@ -12,8 +14,8 @@ class MsgBase(object):
|
||||||
|
|
||||||
def constructObject(data):
|
def constructObject(data):
|
||||||
try:
|
try:
|
||||||
classBase = eval(data[""] + "." + data[""].title())
|
classBase = getattr(getattr(messagetypes, data[""]), data[""].title())
|
||||||
except NameError:
|
except (NameError, AttributeError):
|
||||||
logger.error("Don't know how to handle message type: \"%s\"", data[""])
|
logger.error("Don't know how to handle message type: \"%s\"", data[""])
|
||||||
return None
|
return None
|
||||||
try:
|
try:
|
||||||
|
@ -39,7 +41,7 @@ else:
|
||||||
if splitted[1] != ".py":
|
if splitted[1] != ".py":
|
||||||
continue
|
continue
|
||||||
try:
|
try:
|
||||||
import_module("." + splitted[0], "messagetypes")
|
import_module(".{}".format(splitted[0]), "messagetypes")
|
||||||
except ImportError:
|
except ImportError:
|
||||||
logger.error("Error importing %s", mod, exc_info=True)
|
logger.error("Error importing %s", mod, exc_info=True)
|
||||||
else:
|
else:
|
||||||
|
|
Reference in New Issue
Block a user