summaryrefslogtreecommitdiff
path: root/bin/tiny_socket.py
diff options
context:
space:
mode:
authorFabien Pinckaers <fp@tinyerp.com>2008-08-19 00:31:40 +0200
committerFabien Pinckaers <fp@tinyerp.com>2008-08-19 00:31:40 +0200
commit7f9e392861fa7fefa78791354b420ae6c45b8b3e (patch)
treead71a39ffdf8bfe62d39dac3c91572184e021d74 /bin/tiny_socket.py
parentbd7c09b70bf14b351448af288406ff93bc3bf110 (diff)
Check for globals in socket
bzr revid: fp@tinyerp.com-20080818223140-l69ekd9uyfw2c87w
Diffstat (limited to 'bin/tiny_socket.py')
-rw-r--r--bin/tiny_socket.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/bin/tiny_socket.py b/bin/tiny_socket.py
index 076155748d3..8f89fe97297 100644
--- a/bin/tiny_socket.py
+++ b/bin/tiny_socket.py
@@ -28,6 +28,7 @@
###############################################################################
import socket
import cPickle
+import cStringIO
import marshal
class Myexception(Exception):
@@ -82,7 +83,11 @@ class mysocket:
if chunk == '':
raise RuntimeError, "socket connection broken"
msg = msg + chunk
- res = cPickle.loads(msg)
+ msgio = cStringIO.StringIO(msg)
+ unpickler = cPickle.Unpickler(msgio)
+ unpickler.find_global = None
+ res = unpickler.load()
+
if isinstance(res[0],Exception):
if exception:
raise Myexception(str(res[0]), str(res[1]))