From 1d73db560c9e7bf5d9e6f3705b80ad606f5d7d43 Mon Sep 17 00:00:00 2001 From: Bram Matthys Date: Fri, 24 Sep 2021 10:09:20 +0200 Subject: [PATCH] Get rid of modules/snomasks directory, since the snomask module API is gone. (IRCOps can set any snomask dynamically now) --- .gitignore | 1 - Makefile.in | 3 -- Makefile.windows | 4 -- configure | 3 +- configure.ac | 1 - doc/conf/modules.default.conf | 4 -- src/modules/Makefile.in | 2 - src/modules/dccdeny.c | 12 ++++++ src/modules/snomasks/Makefile.in | 53 ------------------------ src/modules/snomasks/dccreject.c | 69 -------------------------------- src/windows/unrealinst.iss | 1 - 11 files changed, 13 insertions(+), 140 deletions(-) delete mode 100644 src/modules/snomasks/Makefile.in delete mode 100644 src/modules/snomasks/dccreject.c diff --git a/.gitignore b/.gitignore index 46780c6a8..2a869a3c7 100644 --- a/.gitignore +++ b/.gitignore @@ -9,7 +9,6 @@ extras/c-ares* config.status extras/ircdcron/ircd.cron extras/ircdcron/ircdchk -src/modules/snomasks/Makefile src/modules/chanmodes/Makefile src/modules/extbans/Makefile src/modules/usermodes/Makefile diff --git a/Makefile.in b/Makefile.in index 7c3bbbebd..a1f644cf7 100644 --- a/Makefile.in +++ b/Makefile.in @@ -214,9 +214,6 @@ install: all $(INSTALL) -m 0700 -d $(DESTDIR)@MODULESDIR@/chanmodes @rm -f $(DESTDIR)@MODULESDIR@/chanmodes/*.so 1>/dev/null 2>&1 $(INSTALL) -m 0700 src/modules/chanmodes/*.so $(DESTDIR)@MODULESDIR@/chanmodes - $(INSTALL) -m 0700 -d $(DESTDIR)@MODULESDIR@/snomasks - @rm -f $(DESTDIR)@MODULESDIR@/snomasks/*.so 1>/dev/null 2>&1 - $(INSTALL) -m 0700 src/modules/snomasks/*.so $(DESTDIR)@MODULESDIR@/snomasks $(INSTALL) -m 0700 -d $(DESTDIR)@MODULESDIR@/extbans @rm -f $(DESTDIR)@MODULESDIR@/extbans/*.so 1>/dev/null 2>&1 $(INSTALL) -m 0700 src/modules/extbans/*.so $(DESTDIR)@MODULESDIR@/extbans diff --git a/Makefile.windows b/Makefile.windows index 1bfebf24a..16bbae687 100644 --- a/Makefile.windows +++ b/Makefile.windows @@ -337,7 +337,6 @@ DLL_FILES=\ src/modules/sinfo.dll \ src/modules/sjoin.dll \ src/modules/slog.dll \ - src/modules/snomasks/dccreject.dll \ src/modules/sqline.dll \ src/modules/squit.dll \ src/modules/staff.dll \ @@ -1068,9 +1067,6 @@ src/modules/sjoin.dll: src/modules/sjoin.c $(INCLUDES) src/modules/slog.dll: src/modules/slog.c $(INCLUDES) $(CC) $(MODCFLAGS) src/modules/slog.c /Fesrc/modules/ /Fosrc/modules/ /Fdsrc/modules/slog.pdb $(MODLFLAGS) -src/modules/snomasks/dccreject.dll: src/modules/snomasks/dccreject.c $(INCLUDES) - $(CC) $(MODCFLAGS) src/modules/snomasks/dccreject.c /Fesrc/modules/snomasks/ /Fosrc/modules/snomasks/ /Fdsrc/modules/snomasks/dccreject.pdb $(MODLFLAGS) - src/modules/sqline.dll: src/modules/sqline.c $(INCLUDES) $(CC) $(MODCFLAGS) src/modules/sqline.c /Fesrc/modules/ /Fosrc/modules/ /Fdsrc/modules/sqline.pdb $(MODLFLAGS) diff --git a/configure b/configure index f91071189..8d4ac606e 100755 --- a/configure +++ b/configure @@ -8872,7 +8872,7 @@ fi -ac_config_files="$ac_config_files Makefile src/Makefile src/modules/Makefile src/modules/chanmodes/Makefile src/modules/usermodes/Makefile src/modules/snomasks/Makefile src/modules/extbans/Makefile src/modules/third/Makefile extras/unrealircd-upgrade-script unrealircd" +ac_config_files="$ac_config_files Makefile src/Makefile src/modules/Makefile src/modules/chanmodes/Makefile src/modules/usermodes/Makefile src/modules/extbans/Makefile src/modules/third/Makefile extras/unrealircd-upgrade-script unrealircd" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -9570,7 +9570,6 @@ do "src/modules/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/Makefile" ;; "src/modules/chanmodes/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/chanmodes/Makefile" ;; "src/modules/usermodes/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/usermodes/Makefile" ;; - "src/modules/snomasks/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/snomasks/Makefile" ;; "src/modules/extbans/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/extbans/Makefile" ;; "src/modules/third/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/third/Makefile" ;; "extras/unrealircd-upgrade-script") CONFIG_FILES="$CONFIG_FILES extras/unrealircd-upgrade-script" ;; diff --git a/configure.ac b/configure.ac index dedaf0185..09591f358 100644 --- a/configure.ac +++ b/configure.ac @@ -870,7 +870,6 @@ AC_CONFIG_FILES([Makefile src/modules/Makefile src/modules/chanmodes/Makefile src/modules/usermodes/Makefile - src/modules/snomasks/Makefile src/modules/extbans/Makefile src/modules/third/Makefile extras/unrealircd-upgrade-script diff --git a/doc/conf/modules.default.conf b/doc/conf/modules.default.conf index 3fb8971a2..73b558295 100644 --- a/doc/conf/modules.default.conf +++ b/doc/conf/modules.default.conf @@ -192,10 +192,6 @@ loadmodule "usermodes/secureonlymsg"; /* +Z (only TLS users may private message loadmodule "usermodes/privdeaf"; /* +D (don't let other user PM you) */ -/*** Server notice masks */ -loadmodule "snomasks/dccreject"; /* +D (rejected DCC's) */ - - /*** Extended Bans ***/ loadmodule "extbans/join"; /* +b ~j (prevent only joins) */ loadmodule "extbans/quiet"; /* +b ~q (prevent only messaging) */ diff --git a/src/modules/Makefile.in b/src/modules/Makefile.in index 50e322fe3..b0d6b9153 100644 --- a/src/modules/Makefile.in +++ b/src/modules/Makefile.in @@ -92,7 +92,6 @@ all: build build: $(MODULES) cd chanmodes; $(MAKE) all cd usermodes; $(MAKE) all - cd snomasks; $(MAKE) all cd extbans; $(MAKE) all cd third; $(MAKE) all @@ -100,7 +99,6 @@ clean: $(RM) -f *.o *.so *~ core cd chanmodes; $(MAKE) clean cd usermodes; $(MAKE) clean - cd snomasks; $(MAKE) clean cd extbans; $(MAKE) clean cd third; $(MAKE) clean diff --git a/src/modules/dccdeny.c b/src/modules/dccdeny.c index fdfd80524..0fda03f0e 100644 --- a/src/modules/dccdeny.c +++ b/src/modules/dccdeny.c @@ -41,6 +41,7 @@ int dccdeny_configtest_allow_dcc(ConfigFile *cf, ConfigEntry *ce, int type, int int dccdeny_configrun_deny_dcc(ConfigFile *cf, ConfigEntry *ce, int type); int dccdeny_configrun_allow_dcc(ConfigFile *cf, ConfigEntry *ce, int type); int dccdeny_stats(Client *client, const char *para); +int dccdeny_dcc_denied(Client *client, const char *target, const char *realfile, const char *displayfile, ConfigItem_deny_dcc *dccdeny); CMD_FUNC(cmd_dccdeny); CMD_FUNC(cmd_undccdeny); CMD_FUNC(cmd_svsfline); @@ -81,6 +82,7 @@ MOD_INIT() HookAdd(modinfo->handle, HOOKTYPE_CAN_SEND_TO_USER, 0, dccdeny_can_send_to_user); HookAdd(modinfo->handle, HOOKTYPE_CAN_SEND_TO_CHANNEL, 0, dccdeny_can_send_to_channel); HookAdd(modinfo->handle, HOOKTYPE_SERVER_SYNC, 0, dccdeny_server_sync); + HookAdd(modinfo->handle, HOOKTYPE_DCC_DENIED, 0, dccdeny_dcc_denied); return MOD_SUCCESS; } @@ -867,3 +869,13 @@ int dccdeny_stats(Client *client, const char *para) } return 1; } + +int dccdeny_dcc_denied(Client *client, const char *target, const char *realfile, const char *displayfile, ConfigItem_deny_dcc *dccdeny) +{ + unreal_log(ULOG_INFO, "dcc", "DCC_REJECTED", client, + "$client.details tried to send forbidden file $filename ($ban_reason) to $target (is blocked now)", + log_data_string("filename", displayfile), + log_data_string("ban_reason", dccdeny->reason), + log_data_string("target", target)); + return 0; +} diff --git a/src/modules/snomasks/Makefile.in b/src/modules/snomasks/Makefile.in deleted file mode 100644 index aba643def..000000000 --- a/src/modules/snomasks/Makefile.in +++ /dev/null @@ -1,53 +0,0 @@ -#************************************************************************ -#* IRC - Internet Relay Chat, src/modules/snomasks/Makefile -#* Copyright (C) The UnrealIRCd team -#* -#* 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 1, 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., 675 Mass Ave, Cambridge, MA 02139, USA. -#*/ - -CC = "==== DO NOT RUN MAKE FROM THIS DIRECTORY ====" - -INCLUDES = ../../include/channel.h \ - ../../include/common.h ../../include/config.h ../../include/dbuf.h \ - ../../include/dynconf.h ../../include/fdlist.h ../../include/h.h \ - ../../include/ircsprintf.h \ - ../../include/license.h \ - ../../include/modules.h ../../include/modversion.h ../../include/msg.h \ - ../../include/numeric.h ../../include/dns.h \ - ../../include/resource.h ../../include/setup.h \ - ../../include/struct.h ../../include/sys.h \ - ../../include/types.h \ - ../../include/version.h ../../include/whowas.h - -R_MODULES=\ - dccreject.so - -MODULES=$(R_MODULES) -MODULEFLAGS=@MODULEFLAGS@ -RM=@RM@ - -.SUFFIXES: -.SUFFIXES: .c .h .so - -all: build - -build: $(MODULES) - -clean: - $(RM) -f *.o *.so *~ core - -%.so: %.c $(INCLUDES) - $(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \ - -o $@ $< diff --git a/src/modules/snomasks/dccreject.c b/src/modules/snomasks/dccreject.c deleted file mode 100644 index 14cab32b8..000000000 --- a/src/modules/snomasks/dccreject.c +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Show DCC SEND rejection notices (Snomask +D) - * (C) Copyright 2000-.. Bram Matthys (Syzop) and the UnrealIRCd team - * - * 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 1, 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., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#include "unrealircd.h" - -/* Module header */ -ModuleHeader MOD_HEADER - = { - "snomasks/dccreject", - "4.2", - "Snomask +D", - "UnrealIRCd Team", - "unrealircd-6", - }; - -/* Global variables */ -long SNO_DCCREJECT = 0L; - -/* Forward declarations */ -int dccreject_dcc_denied(Client *client, const char *target, const char *realfile, const char *displayfile, ConfigItem_deny_dcc *dccdeny); - -MOD_TEST() -{ - return MOD_SUCCESS; -} - -MOD_INIT() -{ - HookAdd(modinfo->handle, HOOKTYPE_DCC_DENIED, 0, dccreject_dcc_denied); - - MARK_AS_OFFICIAL_MODULE(modinfo); - return MOD_SUCCESS; -} - -MOD_LOAD() -{ - return MOD_SUCCESS; -} - -MOD_UNLOAD() -{ - return MOD_SUCCESS; -} - -int dccreject_dcc_denied(Client *client, const char *target, const char *realfile, const char *displayfile, ConfigItem_deny_dcc *dccdeny) -{ - unreal_log(ULOG_INFO, "dcc", "DCC_REJECTED", client, - "$client.details tried to send forbidden file $filename ($ban_reason) to $target (is blocked now)", - log_data_string("filename", displayfile), - log_data_string("ban_reason", dccdeny->reason), - log_data_string("target", target)); - return 0; -} diff --git a/src/windows/unrealinst.iss b/src/windows/unrealinst.iss index 4adcf5c7d..cac0abc20 100644 --- a/src/windows/unrealinst.iss +++ b/src/windows/unrealinst.iss @@ -66,7 +66,6 @@ Source: "extras\tls.cnf"; DestDir: "{app}\bin"; Flags: ignoreversion Source: "src\modules\*.dll"; DestDir: "{app}\modules"; Flags: ignoreversion Source: "src\modules\chanmodes\*.dll"; DestDir: "{app}\modules\chanmodes"; Flags: ignoreversion Source: "src\modules\usermodes\*.dll"; DestDir: "{app}\modules\usermodes"; Flags: ignoreversion -Source: "src\modules\snomasks\*.dll"; DestDir: "{app}\modules\snomasks"; Flags: ignoreversion Source: "src\modules\extbans\*.dll"; DestDir: "{app}\modules\extbans"; Flags: ignoreversion Source: "src\modules\third\*.dll"; DestDir: "{app}\modules\third"; Flags: ignoreversion skipifsourcedoesntexist