Fixed 2-bans-needed-trick (). If a user got banned while having mode +x,

then does a -x virthost gets freed and the user can join again/circumvent the ban.
virhost should probably be moved in to the User struct like char virthost[HOSTLEN+1]
but in the meantime I've just removed the free() when someone does -x.
I noticed we already do make_userhost at connect even if mode +x isn't set, and also
is_banned checks if virthost exists.. if so -> check if that's banned... so this
patch won't decrease performance much.
This commit is contained in:
Bram Matthys 2003-01-26 02:18:30 +00:00
parent 117ec38808
commit 74a984da48
2 changed files with 5 additions and 0 deletions

View file

@ -1821,3 +1821,4 @@ seen. gmtime warning still there
- Blah... forgot to remove some debugging code in badwords.c (new fast replace system).
- Fixed yet another bug in new badwords replace system (should be almost finished now! ;P).
- Optimization: channel msg routine now 10-30% faster.
- Fixed 2-bans-needed-trick. (#0000626)

View file

@ -2478,6 +2478,9 @@ CMD_FUNC(m_umode)
sendto_serv_butone_token_opt(cptr, OPT_VHP, sptr->name,
MSG_SETHOST, TOK_SETHOST, "%s", sptr->user->virthost);
}
/* Disabled because we use this for checking bans against virthosts -- Syzop */
#if 0
if (!IsHidden(sptr) && (setflags & UMODE_HIDE))
{
if (sptr->user->virthost)
@ -2486,6 +2489,7 @@ CMD_FUNC(m_umode)
sptr->user->virthost = NULL;
}
}
#endif
/*
* If I understand what this code is doing correctly...
* If the user WAS an operator and has now set themselves -o/-O