Commit c922e55a authored by Martín Ferrari's avatar Martín Ferrari

more bugs; allow empty b64 parameters

parent c706e136
......@@ -201,9 +201,9 @@ class Server(object):
try:
if args[i][0] == '=':
args[i] = base64.b64decode(args[i][1:])
if len(args[i]) == 0:
self.reply(500, "Invalid parameter: empty.")
return None
# if len(args[i]) == 0:
# self.reply(500, "Invalid parameter: empty.")
# return None
except TypeError:
self.reply(500, "Invalid parameter: not base-64 encoded.")
return None
......@@ -463,7 +463,7 @@ class Client(object):
params = []
for k, v in env.items():
params.extend([_b64(k), _b64(v)])
self._send_cmd("PROC", "ENV", params)
self._send_cmd("PROC", "ENV", *params)
self._read_and_check_reply()
if stdin != None:
......@@ -478,7 +478,7 @@ class Client(object):
raise
self._send_cmd("PROC", "RUN")
pid = self._read_and_check_reply().split()[0]
pid = int(self._read_and_check_reply().split()[0])
return pid
......
......@@ -103,7 +103,7 @@ class TestServer(unittest.TestCase):
check_ok(self, "proc wait 0", None, [0])
check_ok(self, "proc kill 0", None, [0])
check_error(self, "proc crte =") # empty b64
check_ok(self, "proc crte =", srv.do_PROC_CRTE, [""]) # empty b64
check_error(self, "proc crte =a") # invalid b64
# simulate proc mode
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment