Bläddra i källkod

cast offset and length to int. allows clients to get around the xmlrpc i4 size limit and validates the args for free.

Chris McDonough 18 år sedan
förälder
incheckning
8554972baa
1 ändrade filer med 3 tillägg och 3 borttagningar
  1. 3 3
      src/supervisor/xmlrpc.py

+ 3 - 3
src/supervisor/xmlrpc.py

@@ -237,7 +237,7 @@ class SupervisorNamespaceRPCInterface:
             raise RPCError(Faults.NO_FILE, logfile)
             raise RPCError(Faults.NO_FILE, logfile)
 
 
         try:
         try:
-            return readFile(logfile, offset, length)
+            return readFile(logfile, int(offset), int(length))
         except ValueError, inst:
         except ValueError, inst:
             why = inst.args[0]
             why = inst.args[0]
             raise RPCError(getattr(Faults, why))
             raise RPCError(getattr(Faults, why))
@@ -640,7 +640,7 @@ class SupervisorNamespaceRPCInterface:
             raise RPCError(Faults.NO_FILE, logfile)
             raise RPCError(Faults.NO_FILE, logfile)
 
 
         try:
         try:
-            return readFile(logfile, offset, length)
+            return readFile(logfile, int(offset), int(length))
         except ValueError, inst:
         except ValueError, inst:
             why = inst.args[0]
             why = inst.args[0]
             raise RPCError(getattr(Faults, why))
             raise RPCError(getattr(Faults, why))
@@ -673,7 +673,7 @@ class SupervisorNamespaceRPCInterface:
         if logfile is None or not os.path.exists(logfile):
         if logfile is None or not os.path.exists(logfile):
             return ['', 0, False]
             return ['', 0, False]
 
 
-        return tailFile(logfile, offset, length)
+        return tailFile(logfile, int(offset), int(length))
 
 
     def clearProcessLog(self, name):
     def clearProcessLog(self, name):
         """ Clear the log for name and reopen it
         """ Clear the log for name and reopen it