Disallow double quotes in klines.

These could cause parse problems with kline.conf.
This commit is contained in:
Jilles Tjoelker 2009-05-08 01:50:35 +02:00
parent b0f30fa1ca
commit 23a8f750f7

View file

@ -588,8 +588,9 @@ find_user_host(struct Client *source_p, const char *userhost, char *luser, char
static int static int
valid_user_host(struct Client *source_p, const char *luser, const char *lhost) valid_user_host(struct Client *source_p, const char *luser, const char *lhost)
{ {
/* # is invalid, as are '!' (n!u@h kline) and '@' (u@@h kline) */ /* # and " are invalid, as are '!' (n!u@h kline) and '@' (u@@h kline) */
if(strchr(lhost, '#') || strchr(luser, '#') || strchr(luser, '!') || if(strchr(lhost, '#') || strchr(luser, '#') || strchr(lhost, '"') ||
strchr(luser, '"') || strchr(luser, '!') ||
strchr(lhost, '@')) strchr(lhost, '@'))
{ {
sendto_one_notice(source_p, ":Invalid K-Line"); sendto_one_notice(source_p, ":Invalid K-Line");