*/
#include "stdinc.h"
-#include "tools.h"
#include "send.h"
#include "channel.h"
#include "client.h"
#include "config.h"
#include "ircd.h"
#include "numeric.h"
-#include "memory.h"
#include "s_conf.h"
#include "s_newconf.h"
#include "s_serv.h"
#include "msg.h"
#include "parse.h"
#include "modules.h"
-#include "sprintf_irc.h"
#include "whowas.h"
#include "monitor.h"
clean_host(const char *host)
{
int len = 0;
+ const char *last_slash = 0;
if (*host == '\0' || *host == ':')
return 0;
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
return 0;
del_from_hostname_hash(source_p->orighost, source_p);
- strlcpy(source_p->orighost, parv[1], sizeof source_p->orighost);
+ rb_strlcpy(source_p->orighost, parv[1], sizeof source_p->orighost);
if (irccmp(source_p->host, source_p->orighost))
SetDynSpoof(source_p);
else
/*
* ms_chghost
- * parv[0] = origin
* parv[1] = target
* parv[2] = host
*/
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;
/*
* me_chghost
- * parv[0] = origin
* parv[1] = target
* parv[2] = host
*/
/*
* mo_chghost
- * parv[0] = origin
* parv[1] = target
* parv[2] = host
*/
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");