summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-03-27 20:17:05 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-03-27 20:17:05 +0000
commitcac4bef53dcef911e9133705748ab3584dbf9ae1 (patch)
tree11f5a737442763bcfe969916cb351b04258a186b
parent6dc0b83a416ef200ef7eba04ee6dc7e69842f5cc (diff)
Fix typo in spanningtree (who put this colon here?)
Allow for safer cloaking of hosts > 64 (backport from stable) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3782 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--src/modules/m_cloaking.cpp26
-rw-r--r--src/modules/m_spanningtree.cpp2
2 files changed, 17 insertions, 11 deletions
diff --git a/src/modules/m_cloaking.cpp b/src/modules/m_cloaking.cpp
index cddf2778d..92ae1af6c 100644
--- a/src/modules/m_cloaking.cpp
+++ b/src/modules/m_cloaking.cpp
@@ -368,16 +368,22 @@ class ModuleCloaking : public Module
this->GenHash(dest->host,ra);
std::string b = "";
in_addr testaddr;
- if (!inet_aton(dest->host,&testaddr))
- {
- // if they have a hostname, make something appropriate
- b = prefix + "-" + std::string(ra) + a;
- }
- else
- {
- // else, they have an ip
- b = std::string(ra) + "." + prefix + ".cloak";
- }
+ std::string hostcloak = prefix + "-" + std::string(ra) + a;
+ /* Fix by brain - if the cloaked host is > the max length of a host (64 bytes
+ * according to the DNS RFC) then tough titty, they get cloaked as an IP.
+ * Their ISP shouldnt go to town on subdomains, or they shouldnt have a kiddie
+ * vhost.
+ */
+ if ((!inet_aton(dest->host,&testaddr)) && (hostcloak.length() < 64))
+ {
+ // if they have a hostname, make something appropriate
+ b = hostcloak;
+ }
+ else
+ {
+ // else, they have an ip
+ b = std::string(ra) + "." + prefix + ".cloak";
+ }
Srv->Log(DEBUG,"cloak: allocated "+b);
Srv->ChangeHost(dest,b);
}
diff --git a/src/modules/m_spanningtree.cpp b/src/modules/m_spanningtree.cpp
index 660e40ae7..4830d715d 100644
--- a/src/modules/m_spanningtree.cpp
+++ b/src/modules/m_spanningtree.cpp
@@ -1200,7 +1200,7 @@ class TreeSocket : public InspSocket
const char* n = "";
if (x & UCMODE_OP)
- ; {
+ {
n = "@";
}
else if (x & UCMODE_HOP)