1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-06-30 08:06:38 +02:00

'SVSMODE Nick -t' does not remove vhost (while MODE 'MODE Nick -t' does)

Reported by The_Myth in https://bugs.unrealircd.org/view.php?id=5111
This commit is contained in:
Bram Matthys
2018-09-07 10:50:00 +02:00
parent aa3e66bb5b
commit 858aaa774a
+23
View File
@@ -508,6 +508,29 @@ int do_svsmode(aClient *cptr, aClient *sptr, int parc, char *parv[], int show_c
acptr->user->virthost);
}
goto setmodex;
case 't':
/* We support -t nowadays, which means we remove the vhost and set the cloaked host
* (note that +t is a NOOP, that code is in +x)
*/
if (what == MODE_DEL)
{
/* First, check if there's a change at all. Perhaps it's a -t on someone
* with no virthost or virthost being cloakedhost?
* Also, check to make sure user->cloakedhost exists at all.
* This so we won't crash in weird cases like non-conformant servers.
*/
if (acptr->user->virthost && acptr->user->cloakedhost && strcasecmp(acptr->user->cloakedhost, GetHost(acptr)))
{
/* Make the change effective: */
safestrdup(acptr->user->virthost, acptr->user->cloakedhost);
/* And broadcast the change to VHP servers */
if (MyClient(acptr))
sendto_server(NULL, PROTO_VHP, 0, ":%s SETHOST :%s", acptr->name,
acptr->user->virthost);
}
goto setmodex;
}
break;
case 'z':
/* Setting and unsetting user mode 'z' remotely is not supported */
break;