]> git.mxchange.org Git - fba.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Sat, 20 May 2023 07:04:54 +0000 (09:04 +0200)
committerRoland Häder <roland@mxchange.org>
Sat, 20 May 2023 07:04:54 +0000 (09:04 +0200)
- some instances reported others with '@' in it which isn't correct for a
  domain name/host IP

fba.py
fetch_instances.py

diff --git a/fba.py b/fba.py
index 2237e34f294865a28df16ebd16fa92df138f43d4..18f2b707969a4a92e24fec1440cb0f37aa97bb6d 100644 (file)
--- a/fba.py
+++ b/fba.py
@@ -128,6 +128,13 @@ def update_last_seen(last_seen: int, blocker: str, blocked: str, block_level: st
         sys.exit(255)
 
 def block_instance(blocker: str, blocked: str, reason: str, block_level: str, first_added: int, last_seen: int):
+    if blocker.find("@") > 0:
+        print("WARNING: Bad blocker:", blocker)
+        raise
+    elif blocked.find("@") > 0:
+        print("WARNING: Bad blocked:", blocked)
+        raise
+
     print("--- New block:", blocker, blocked, reason, block_level, first_added, last_seen)
     try:
         c.execute(
@@ -147,6 +154,10 @@ def block_instance(blocker: str, blocked: str, reason: str, block_level: str, fi
         sys.exit(255)
 
 def add_instance(domain: str):
+    if domain.find("@") > 0:
+        print("WARNING: Bad domain name:", domain)
+        raise
+
     print("--- Adding new instance:", domain)
     try:
         c.execute(
index fd13b25a1daf352523801fad8c1e52ddafbac405..f9e3836ed21909cc85a70366427c63a4614b0df0 100644 (file)
@@ -8,11 +8,14 @@ def fetch_instances(domain: str):
     peerlist = fba.get_peers(domain)
 
     if (peerlist is None):
-        print("FATAL: CANNOT FETCH PEERS:", domain)
+        print("ERROR: Cannot fetch peers:", domain)
         return
 
     for instance in peerlist:
         instance = instance.lower()
+        if instance.find("@") > 0:
+            print("WARNING: Bad instance name,domain:", instance, domain)
+            continue
 
         blacklisted = False
         for domain in fba.blacklist: