diff --git a/ChangeLog b/ChangeLog index 350c217..ade7a49 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +jilles 2007/05/19 23:36:51 UTC (20070519-3466) + Log: + Prevent too wide klines with CIDR masks. + + + Changes: Modified: + +17 -5 trunk/modules/m_kline.c (File Modified) + + jilles 2007/05/19 22:21:10 UTC (20070519-3464) Log: Exempt klines with a fixed user@ (no */?) from min_nonwildcard checks. diff --git a/extensions/Makefile.in b/extensions/Makefile.in index 503e3b3..01f32bf 100644 --- a/extensions/Makefile.in +++ b/extensions/Makefile.in @@ -1,7 +1,7 @@ # # Makefile.in for ircd/contrib # -# $Id: Makefile.in 1849 2006-08-23 12:40:21Z jilles $ +# $Id: Makefile.in 3468 2007-05-24 03:58:27Z nenolod $ # CC = @CC@ RM = @RM@ @@ -40,6 +40,7 @@ SRCS = \ sno_farconnect.c \ sno_globalkline.c \ sno_globaloper.c \ + sno_whois.c \ m_42.c \ m_findforwards.c \ m_identify.c \ @@ -58,7 +59,6 @@ SRCS = \ spy_stats_notice.c \ spy_stats_p_notice.c \ spy_trace_notice.c \ - spy_whois_notice.c \ spy_whois_notice_global.c \ example_module.c diff --git a/extensions/sno_whois.c b/extensions/sno_whois.c new file mode 100644 index 0000000..6fed63c --- /dev/null +++ b/extensions/sno_whois.c @@ -0,0 +1,63 @@ +/* + * +W snomask: Displays if a local user has done a WHOIS request on you. + * derived from spy_whois_notice.c. + * + * If #define OPERONLY is removed, then any user can use this snomask. + * + * $Id: sno_whois.c 3468 2007-05-24 03:58:27Z nenolod $ + */ + +#include "stdinc.h" +#include "modules.h" +#include "hook.h" +#include "client.h" +#include "ircd.h" +#include "send.h" + +/* undefine this to allow anyone to receive whois notifications */ +#define OPERONLY + +void show_whois(hook_data_client *); + +mapi_hfn_list_av1 whois_hfnlist[] = { + {"doing_whois", (hookfn) show_whois}, + {NULL, NULL} +}; + +static int +init(void) +{ + snomask_modes['W'] = find_snomask_slot(); + + return 0; +} + +static void +fini(void) +{ + snomask_modes['W'] = find_snomask_slot(); +} + +DECLARE_MODULE_AV1(sno_whois, init, fini, NULL, NULL, whois_hfnlist, "$Revision: 3468 $"); + +void +show_whois(hook_data_client *data) +{ + struct Client *source_p = data->client; + struct Client *target_p = data->target; + + /* source being MyConnect() is implicit here from m_whois.c --fl */ + if(MyClient(target_p) && +#ifdef OPERONLY + IsOper(target_p) && +#endif + (source_p != target_p) && + (target_p->snomask & snomask_modes['W'])) + { + sendto_one_notice(target_p, + ":*** Notice -- %s (%s@%s) is doing a whois on you [%s]", + source_p->name, + source_p->username, source_p->host, + source_p->user->server); + } +} diff --git a/extensions/spy_whois_notice.c b/extensions/spy_whois_notice.c deleted file mode 100644 index aa8e25b..0000000 --- a/extensions/spy_whois_notice.c +++ /dev/null @@ -1,56 +0,0 @@ -/* - * ircd-ratbox: A slightly useful ircd. - * spy_whois_notice.c: Sends a notice when someone uses WHOIS. - * - * Copyright (C) 2002 by the past and present ircd coders, and others. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA - * - * $Id: spy_whois_notice.c 3161 2007-01-25 07:23:01Z nenolod $ - */ -#include "stdinc.h" -#include "modules.h" -#include "hook.h" -#include "client.h" -#include "ircd.h" -#include "send.h" - -void show_whois(hook_data_client *); - -mapi_hfn_list_av1 whois_hfnlist[] = { - {"doing_whois", (hookfn) show_whois}, - {NULL, NULL} -}; - -DECLARE_MODULE_AV1(whois_spy, NULL, NULL, NULL, NULL, whois_hfnlist, "$Revision: 3161 $"); - -void -show_whois(hook_data_client *data) -{ - struct Client *source_p = data->client; - struct Client *target_p = data->target; - - /* source being MyConnect() is implicit here from m_whois.c --fl */ - if(MyClient(target_p) && IsOper(target_p) && (source_p != target_p) && - (target_p->snomask & SNO_SPY)) - { - sendto_one_notice(target_p, - ":*** Notice -- %s (%s@%s) is doing a whois on you [%s]", - source_p->name, - source_p->username, source_p->host, - source_p->user->server); - } -} diff --git a/include/serno.h b/include/serno.h index 5da9cf5..91aca31 100644 --- a/include/serno.h +++ b/include/serno.h @@ -1 +1 @@ -#define SERNO "20070519-3464" +#define SERNO "20070519-3466"