mirror of
https://git.photon.obnh.io/AXSY/whois.git
synced 2026-03-13 02:01:32 +00:00
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:
32
mwhoisd.patch
Normal file
32
mwhoisd.patch
Normal 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
|
||||
Reference in New Issue
Block a user