diff --git a/Changes b/Changes index 9090ac658..baa122a3b 100644 --- a/Changes +++ b/Changes @@ -716,3 +716,9 @@ So use with care on mixed-version nets. - Fixed /(G)ZLINE [nick] placing the *line on *@host instead of *@IP, reported by Snake (#0002246). +- A warning is now sent to the oper if (s)he tries to add a (G)ZLINE on *@host. + (G)ZLINES should have an ipmask, not a hostmask, because they are processed BEFORE + any dns lookups are done. Therefore any (g)zlines placed will probably work + (but not necessarily) for like an hour (or whatever TTL), but after that the + (ab)user can get in again so this is usually not what you want ;). + I suppose I'll add a FAQ entry about this. diff --git a/src/modules/m_tkl.c b/src/modules/m_tkl.c index 2f153b094..1af2b0617 100644 --- a/src/modules/m_tkl.c +++ b/src/modules/m_tkl.c @@ -447,6 +447,21 @@ DLLFUNC int m_tkl_line(aClient *cptr, aClient *sptr, int parc, char *parv[], ch hostmask = usermask; usermask = "*"; } + + if ((*type == 'z') || (*type == 'Z')) + { + /* It's a (G)ZLINE, make sure the user isn't specyfing a HOST. + * Just a warning for now, but perhaps in 3.2.4 we should make this an error. + */ + for (p=hostmask; *p; p++) + if (isalpha(*p)) + { + sendnotice(sptr, "WARNING: (g)zlines should be placed on user@IPMASK, not user@hostmask " + "(this is because (g)zlines are processed BEFORE a dns lookup is done)"); + break; + } + } + /* set 'p' right for later... */ p = hostmask-1; } else