/* Only opers can change other users modes */
if ((source != dest) && (!*source->oper))
return MODEACTION_DENY;
-
+
+ /* For remote clients, we dont take any action, we just allow it.
+ * The local server where they are will set their cloak instead.
+ */
+ if (!IS_LOCAL(dest))
+ return MODEACTION_ALLOW;
+
if (adding)
{
if(!dest->IsModeSet('x'))
* are connecting via localhost) -- this doesnt matter much.
*/
- if (strchr(dest->host,'.'))
+ if (strchr(dest->host,'.') || strchr(dest->host,':'))
{
/* InspIRCd users have two hostnames; A displayed
* hostname which can be modified by modules (e.g.
* to create vhosts, implement chghost, etc) and a
* 'real' hostname which you shouldnt write to.
*/
-
- std::string a = strstr(dest->host,".");
+
+ char* n = strstr(dest->host,".");
+ if (!n)
+ n = strstr(dest->host,":");
+
+ std::string a = n;
char ra[64];
this->GenHash(dest->host,ra);
std::string b = "";
- in_addr testaddr;
+ insp_inaddr testaddr;
std::string hostcloak = prefix + "-" + std::string(ra) + a;
/* Fix by brain - if the cloaked host is > the max length of a host (64 bytes
* 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 ((insp_aton(dest->host,&testaddr) < 1) && (hostcloak.length() < 64))
{
// if they have a hostname, make something appropriate
b = hostcloak;