Entropy/SocketInterface:

- when processing a command, make sure cmd_data (thus cmd) is valid (must be a dict)


git-svn-id: http://svn.sabayonlinux.org/projects/entropy/trunk@2726 cd1c1023-2f26-0410-ae45-c471fc1f0318
This commit is contained in:
lxnay
2008-12-06 15:33:43 +00:00
parent c1346bea70
commit 4b9c8956a8
+10 -1
View File
@@ -13642,7 +13642,15 @@ class SocketHostInterface:
# decide if we need to load authenticator or Entropy
authenticator = None
cmd_data = self.HostInterface.valid_commands.get(cmd)
if (("authenticator" in cmd_data['args']) or (cmd in self.HostInterface.login_pass_commands)) and isinstance(cmd_data,dict):
if not isinstance(cmd_data,dict):
self.HostInterface.updateProgress(
'[from: %s] command error: invalid command: %s' % (
self.client_address,
cmd,
)
)
return "close"
elif (("authenticator" in cmd_data['args']) or (cmd in self.HostInterface.login_pass_commands)):
try:
authenticator = self.load_authenticator()
except exceptionTools.ConnectionError, e:
@@ -17571,6 +17579,7 @@ class DistributionUGCInterface(RemoteDbSkelInterface):
key = self.get_cache_item_key(cache_item)
self.dumpTools.dumpobj(key, r)
# expired get_ugc_alldownloads 0 86400 1228577077
def get_cached_result(self, cache_item):
if not self.cached_results.get(cache_item): return None
key = self.get_cache_item_key(cache_item)