]> git.proxmox.com Git - mirror_edk2.git/blobdiff - AppPkg/Applications/Python/Python-2.7.2/Demo/sockets/rpythond.py
edk2: Remove AppPkg, StdLib, StdLibPrivateInternalFiles
[mirror_edk2.git] / AppPkg / Applications / Python / Python-2.7.2 / Demo / sockets / rpythond.py
diff --git a/AppPkg/Applications/Python/Python-2.7.2/Demo/sockets/rpythond.py b/AppPkg/Applications/Python/Python-2.7.2/Demo/sockets/rpythond.py
deleted file mode 100644 (file)
index 50653fb..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-#! /usr/bin/env python\r
-\r
-# Remote python server.\r
-# Execute Python commands remotely and send output back.\r
-# WARNING: This version has a gaping security hole -- it accepts requests\r
-# from any host on the Internet!\r
-\r
-import sys\r
-from socket import *\r
-import StringIO\r
-import traceback\r
-\r
-PORT = 4127\r
-BUFSIZE = 1024\r
-\r
-def main():\r
-    if len(sys.argv) > 1:\r
-        port = int(eval(sys.argv[1]))\r
-    else:\r
-        port = PORT\r
-    s = socket(AF_INET, SOCK_STREAM)\r
-    s.bind(('', port))\r
-    s.listen(1)\r
-    while 1:\r
-        conn, (remotehost, remoteport) = s.accept()\r
-        print 'connected by', remotehost, remoteport\r
-        request = ''\r
-        while 1:\r
-            data = conn.recv(BUFSIZE)\r
-            if not data:\r
-                break\r
-            request = request + data\r
-        reply = execute(request)\r
-        conn.send(reply)\r
-        conn.close()\r
-\r
-def execute(request):\r
-    stdout = sys.stdout\r
-    stderr = sys.stderr\r
-    sys.stdout = sys.stderr = fakefile = StringIO.StringIO()\r
-    try:\r
-        try:\r
-            exec request in {}, {}\r
-        except:\r
-            print\r
-            traceback.print_exc(100)\r
-    finally:\r
-        sys.stderr = stderr\r
-        sys.stdout = stdout\r
-    return fakefile.getvalue()\r
-\r
-main()\r