ftpd: fix ipv6 bonks (#628)

This commit is contained in:
ed 2025-08-21 20:28:21 +00:00
parent 0de07d8e8b
commit 6d76254c88
2 changed files with 5 additions and 5 deletions

View file

@ -68,13 +68,13 @@ class FtpAuth(DummyAuthorizer):
if ip.startswith("::ffff:"): if ip.startswith("::ffff:"):
ip = ip[7:] ip = ip[7:]
ip = ipnorm(ip) ipn = ipnorm(ip)
bans = self.hub.bans bans = self.hub.bans
if ip in bans: if ipn in bans:
rt = bans[ip] - time.time() rt = bans[ipn] - time.time()
if rt < 0: if rt < 0:
logging.info("client unbanned") logging.info("client unbanned")
del bans[ip] del bans[ipn]
else: else:
raise AuthenticationFailed("banned") raise AuthenticationFailed("banned")

View file

@ -433,7 +433,7 @@ class SvcHub(object):
# create netmaps early to avoid firewall gaps, # create netmaps early to avoid firewall gaps,
# but the mutex blocks multiprocessing startup # but the mutex blocks multiprocessing startup
for zs in "ipu_iu ftp_ipa_nm tftp_ipa_nm".split(): for zs in "ipu_nm ftp_ipa_nm tftp_ipa_nm".split():
try: try:
getattr(args, zs).mutex = threading.Lock() getattr(args, zs).mutex = threading.Lock()
except: except: