Initial commit: mwhois with SCION AS support and decimal AS conversion

Based on mwhois by Antonios A. Chariton
Modifications for SCION AS support by Olaf Baumert, Axpo Systems AG
This commit is contained in:
Olaf Baumert
2025-06-03 11:01:02 +00:00
commit 34c631a06d
340 changed files with 212460 additions and 0 deletions

32
mwhoisd.patch Normal file
View File

@@ -0,0 +1,32 @@
--- mwhoisd.original
+++ mwhoisd
@@ -54,7 +54,7 @@
if(len(qr.split(".")) == 1):
return False
zones = qr.split(".")
- ac = re.compile("^[a-z0-9\.-]+\n")
+ ac = re.compile(r"^[a-z0-9\.-]+\n")
for zone in zones:
if(zone == ""):
return False
@@ -83,7 +83,9 @@
query = con.recv(MAX_QUERY_SIZE)
if not query:
break
- log = log + query.replace("\r\n", "").replace("\n", "") + " - "
+ # Decode bytes to string
+ query_str = query.decode('utf-8', errors='ignore')
+ log = log + query_str.replace("\r\n", "").replace("\n", "") + " - "
query = sanitizeQuery(query)
rsp = "# +-----------------------------------+" + n
@@ -130,7 +132,8 @@
log = log + "Unrecognized" + n
rsp = rsp + n
rsp = rsp + "# Error. Unknown query type. Query is not IPv4, Domain or SCION AS" + n
- con.send(rsp)
+ # Encode string to bytes before sending
+ con.send(rsp.encode('utf-8'))
con.close()
if(LOGFILE!=""):
# Save to logs