diff options
author | Narayan Desai <desai@mcs.anl.gov> | 2007-04-16 19:04:03 +0000 |
---|---|---|
committer | Narayan Desai <desai@mcs.anl.gov> | 2007-04-16 19:04:03 +0000 |
commit | 1a9234d10ca90bb47cbf99a1fc54f126eabc35fa (patch) | |
tree | 3a390654208d9d22f496393432236ebc9fe9325c | |
parent | 36f33818ca07a008febf79fb057f023e6d643144 (diff) | |
download | bcfg2-1a9234d10ca90bb47cbf99a1fc54f126eabc35fa.tar.gz bcfg2-1a9234d10ca90bb47cbf99a1fc54f126eabc35fa.tar.bz2 bcfg2-1a9234d10ca90bb47cbf99a1fc54f126eabc35fa.zip |
Handle garbled XMLRPC requests properly
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@3044 ce84e21b-d406-0410-9b95-82705330c041
-rw-r--r-- | src/lib/Server/Component.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/lib/Server/Component.py b/src/lib/Server/Component.py index 5aebbcbdc..fe4324b29 100644 --- a/src/lib/Server/Component.py +++ b/src/lib/Server/Component.py @@ -144,7 +144,13 @@ class Component(TLSServer, """Decode and dispatch XMLRPC requests. Overloaded to pass through client address information """ - rawparams, method = xmlrpclib.loads(data) + try: + rawparams, method = xmlrpclib.loads(data) + except: + self.logger.error("Failed to parse request from %s" \ + % (address[0])) + #open('/tmp/badreq', 'w').write(data) + return xmlrpclib.dumps(xmlrpclib.Fault(4, "Bad Request")) if len(rawparams) < 2: self.logger.error("No authentication included with request from %s" % address[0]) return xmlrpclib.dumps(xmlrpclib.Fault(2, "No Authentication Info")) |