From 7bad267652f176a3cfe537e6a3b8c06335d3fc0e Mon Sep 17 00:00:00 2001 From: Valentin Gehrke Date: Fri, 8 May 2015 03:16:16 +0200 Subject: [PATCH] fakeftp: nur IPv4 --- fakeftp.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/fakeftp.py b/fakeftp.py index 77752d2..783347f 100644 --- a/fakeftp.py +++ b/fakeftp.py @@ -4,6 +4,8 @@ import socket from random import randint import datetime +SocketServer.ThreadingTCPServer.address_family = socket.AF_INET + class Utils: @staticmethod def mask(rights): @@ -605,7 +607,7 @@ class State: except Exception: handler.send( FatalServerErrorMessage() ) handler.running = False - + class BaseState(State): handlers = [ QuitCommandHandler(), NoOperationCommandHandler() ] @@ -784,10 +786,10 @@ handler.rootDirectory = Directory("",files=[ File("initrd.img",size=4000000) ]) -port = 1234 +port = 21 while True: try: - server = SocketServer.ThreadingTCPServer(("",port),handler) + server = SocketServer.ThreadingTCPServer(("0.0.0.0",port),handler) print "Listening on port %d" % port server.serve_forever() break