mirror of
https://github.com/9001/copyparty.git
synced 2025-08-22 03:12:20 -06:00
ftpd: fix ipv6 bonks (#628)
This commit is contained in:
parent
0de07d8e8b
commit
6d76254c88
|
@ -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")
|
||||||
|
|
||||||
|
|
|
@ -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:
|
||||||
|
|
Loading…
Reference in a new issue