X-Git-Url: https://jfr.im/git/irc/rqf/shadowircd.git/blobdiff_plain/907468c485f837cb8442c32509c8efec8f3f43b1..585e477be8d7cfa2c0308568e5cab8df095a639e:/modules/m_chghost.c diff --git a/modules/m_chghost.c b/modules/m_chghost.c index 92e2652..647ee68 100644 --- a/modules/m_chghost.c +++ b/modules/m_chghost.c @@ -25,7 +25,6 @@ #include "msg.h" #include "parse.h" #include "modules.h" -#include "sprintf_irc.h" #include "whowas.h" #include "monitor.h" @@ -58,6 +57,7 @@ static int clean_host(const char *host) { int len = 0; + const char *last_slash = 0; if (*host == '\0' || *host == ':') return 0; @@ -68,17 +68,21 @@ clean_host(const char *host) if(!IsHostChar(*host)) return 0; + if(*host == '/') + last_slash = host; } if(len > HOSTLEN) return 0; + if(last_slash && IsDigit(last_slash[1])) + return 0; + return 1; } /* * me_realhost - * parv[0] = origin * parv[1] = real host * * Yes this contains a little race condition if someone does a whois @@ -141,7 +145,6 @@ do_chghost(struct Client *source_p, struct Client *target_p, /* * ms_chghost - * parv[0] = origin * parv[1] = target * parv[2] = host */ @@ -162,9 +165,6 @@ ms_chghost(struct Client *client_p, struct Client *source_p, sendto_server(client_p, NULL, CAP_TS6, CAP_EUID, ":%s ENCAP * CHGHOST %s :%s", use_id(source_p), use_id(target_p), parv[2]); - sendto_server(client_p, NULL, - NOCAPS, CAP_TS6, ":%s ENCAP * CHGHOST %s :%s", - source_p->name, target_p->name, parv[2]); } return 0; @@ -172,7 +172,6 @@ ms_chghost(struct Client *client_p, struct Client *source_p, /* * me_chghost - * parv[0] = origin * parv[1] = target * parv[2] = host */ @@ -192,7 +191,6 @@ me_chghost(struct Client *client_p, struct Client *source_p, /* * mo_chghost - * parv[0] = origin * parv[1] = target * parv[2] = host */ @@ -234,9 +232,6 @@ mo_chghost(struct Client *client_p, struct Client *source_p, sendto_server(NULL, NULL, CAP_TS6, CAP_EUID, ":%s ENCAP * CHGHOST %s :%s", use_id(source_p), use_id(target_p), parv[2]); - sendto_server(NULL, NULL, - NOCAPS, CAP_TS6, ":%s ENCAP * CHGHOST %s :%s", - source_p->name, target_p->name, parv[2]); #else sendto_one_numeric(source_p, ERR_DISABLED, form_str(ERR_DISABLED), "CHGHOST");