diff --git a/Makefile.in b/Makefile.in index 7018c7be1..ac3ae4961 100644 --- a/Makefile.in +++ b/Makefile.in @@ -203,6 +203,8 @@ install: all $(INSTALL) -m 0700 src/modules/usermodes/*.so @MODULESDIR@/usermodes $(INSTALL) -m 0700 -d @MODULESDIR@/chanmodes $(INSTALL) -m 0700 src/modules/chanmodes/*.so @MODULESDIR@/chanmodes + $(INSTALL) -m 0700 -d @MODULESDIR@/snomasks + $(INSTALL) -m 0700 src/modules/snomasks/*.so @MODULESDIR@/snomasks $(INSTALL) -m 0700 -d @MODULESDIR@/extbans $(INSTALL) -m 0700 src/modules/extbans/*.so @MODULESDIR@/extbans $(INSTALL) -m 0700 -d @TMPDIR@ diff --git a/configure b/configure index b645bf8ca..253726919 100755 --- a/configure +++ b/configure @@ -6274,10 +6274,10 @@ _ACEOF else cat >>confdefs.h <<_ACEOF -#define PIDFILE "$HOME/unrealircd/data/ircd.pid" +#define PIDFILE "$HOME/unrealircd/data/unrealircd.pid" _ACEOF - PIDFILE="$HOME/unrealircd/data/ircd.pid" + PIDFILE="$HOME/unrealircd/data/unrealircd.pid" fi @@ -7987,7 +7987,7 @@ fi UNRLINCDIR="`pwd`/include" -ac_config_files="$ac_config_files Makefile src/modules/Makefile src/modules/chanmodes/Makefile src/modules/usermodes/Makefile src/modules/extbans/Makefile unrealircd extras/ircdcron/ircdchk extras/ircdcron/ircd.cron" +ac_config_files="$ac_config_files Makefile src/modules/Makefile src/modules/chanmodes/Makefile src/modules/usermodes/Makefile src/modules/snomasks/Makefile src/modules/extbans/Makefile unrealircd extras/ircdcron/ircdchk extras/ircdcron/ircd.cron" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -8684,6 +8684,7 @@ 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" ;; "unrealircd") CONFIG_FILES="$CONFIG_FILES unrealircd" ;; "extras/ircdcron/ircdchk") CONFIG_FILES="$CONFIG_FILES extras/ircdcron/ircdchk" ;; diff --git a/configure.ac b/configure.ac index eb45dd7fb..2126fa837 100644 --- a/configure.ac +++ b/configure.ac @@ -788,6 +788,7 @@ AC_CONFIG_FILES([Makefile src/modules/Makefile src/modules/chanmodes/Makefile src/modules/usermodes/Makefile + src/modules/snomasks/Makefile src/modules/extbans/Makefile unrealircd extras/ircdcron/ircdchk diff --git a/doc/conf/modules.full.conf b/doc/conf/modules.full.conf index b331a0f3c..92ad11e5f 100644 --- a/doc/conf/modules.full.conf +++ b/doc/conf/modules.full.conf @@ -174,6 +174,10 @@ loadmodule "usermodes/nokick"; /* +q (unkickable oper) */ loadmodule "usermodes/regonlymsg"; /* +R (only registered users may private message you) */ +/*** Server notice masks */ +loadmodule "snomasks/dccreject"; /* +D (rejected DCC's) */ + + /*** Extended Bans ***/ loadmodule "extbans/join"; /* +b ~j */ loadmodule "extbans/quiet"; /* +b ~q */ diff --git a/include/h.h b/include/h.h index 949ddd81a..50e4087a4 100644 --- a/include/h.h +++ b/include/h.h @@ -408,7 +408,6 @@ extern MODVAR long UMODE_HIDE; /* 0x8000 Hide from Nukes */ extern MODVAR long UMODE_NETADMIN; /* 0x10000 Network Admin */ extern MODVAR long UMODE_COADMIN; /* 0x80000 Co Admin */ extern MODVAR long UMODE_SECURE; /* 0x800000 User is a secure connect */ -extern MODVAR long UMODE_VICTIM; /* 0x8000000 Intentional Victim */ extern MODVAR long UMODE_DEAF; /* 0x10000000 Deaf */ extern MODVAR long UMODE_HIDEOPER; /* 0x20000000 Hide oper mode */ extern MODVAR long UMODE_SETHOST; /* 0x40000000 used sethost */ diff --git a/include/modules.h b/include/modules.h index 079edbeee..624c0e035 100644 --- a/include/modules.h +++ b/include/modules.h @@ -749,6 +749,7 @@ extern char *moddata_client_get(aClient *acptr, char *varname); #define HOOKTYPE_MODE_DEOP 84 #define HOOKTYPE_PRE_KILL 85 #define HOOKTYPE_SEE_CHANNEL_IN_WHOIS 86 +#define HOOKTYPE_DCC_DENIED 87 /* Hook return values */ #define HOOK_CONTINUE 0 diff --git a/include/struct.h b/include/struct.h index df4ed01b2..25254bd4e 100644 --- a/include/struct.h +++ b/include/struct.h @@ -354,7 +354,6 @@ typedef OperPermission (*OperClassEntryEvalCallback)(OperClassACLEntryVar* varia /* * flags macros. */ -#define IsVictim(x) ((x)->umodes & UMODE_VICTIM) #define IsDeaf(x) ((x)->umodes & UMODE_DEAF) #define IsKillsF(x) ((x)->user->snomask & SNO_KILLS) #define IsClientF(x) ((x)->user->snomask & SNO_CLIENT) diff --git a/src/modules/Makefile.in b/src/modules/Makefile.in index 128f4ec23..1221e79be 100644 --- a/src/modules/Makefile.in +++ b/src/modules/Makefile.in @@ -68,6 +68,7 @@ all: build build: $(MODULES) cd chanmodes; $(MAKE) all cd usermodes; $(MAKE) all + cd snomasks; $(MAKE) all cd extbans; $(MAKE) all custommodule: $(MODULEFILE).c diff --git a/src/modules/chanmodes/Makefile.in b/src/modules/chanmodes/Makefile.in index a1897aee7..cd0cc6a41 100644 --- a/src/modules/chanmodes/Makefile.in +++ b/src/modules/chanmodes/Makefile.in @@ -1,6 +1,6 @@ #************************************************************************ #* IRC - Internet Relay Chat, src/modules/chanmodes/Makefile -#* Copyright (C) Carsten V. Munk 2001 & The UnrealIRCd Team +#* 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 diff --git a/src/modules/m_message.c b/src/modules/m_message.c index 03d4c616c..21a58b909 100644 --- a/src/modules/m_message.c +++ b/src/modules/m_message.c @@ -665,13 +665,10 @@ int size_string, ret; sptr->name, displayfile, target, fl->reason); sendto_one(sptr, ":%s NOTICE %s :*** You have been blocked from sending files, reconnect to regain permission to send files", me.name, sptr->name); - - sendto_umode(UMODE_VICTIM, - "%s tried to send forbidden file %s (%s) to %s (is blocked now)", - sptr->name, displayfile, fl->reason, target); - sendto_server(NULL, 0, 0, ":%s SMO v :%s tried to send forbidden file %s (%s) to %s (is blocked now)", - me.name, sptr->name, displayfile, fl->reason, target); sptr->flags |= FLAGS_DCCBLOCK; + + RunHook5(HOOKTYPE_DCC_DENIED, sptr, target, realfile, displayfile, fl); + return 0; /* block */ } @@ -751,13 +748,6 @@ int size_string; "more information on using the dccallow system by typing '/DCCALLOW HELP'", from->name); } - /* if (SHOW_ALLDENIEDDCCS) */ - if (0) - { - sendto_umode(UMODE_VICTIM, - "[DCCALLOW] %s tried to send forbidden file %s (%s) to %s", - from->name, displayfile, fl->reason, to->name); - } return 0; } } diff --git a/src/modules/m_svsnoop.c b/src/modules/m_svsnoop.c index 1f9e4d0be..89a078031 100644 --- a/src/modules/m_svsnoop.c +++ b/src/modules/m_svsnoop.c @@ -105,7 +105,7 @@ long oldumodes; UMODE_SADMIN | UMODE_ADMIN | UMODE_NETADMIN | UMODE_DEAF | UMODE_HIDEOPER | UMODE_FAILOP | - UMODE_COADMIN | UMODE_VICTIM); + UMODE_COADMIN); acptr->oflag = 0; remove_oper_snomasks(acptr); send_umode_out(acptr, acptr, oldumodes); diff --git a/src/modules/m_svso.c b/src/modules/m_svso.c index 92b60781a..f5c6d26bf 100644 --- a/src/modules/m_svso.c +++ b/src/modules/m_svso.c @@ -164,7 +164,7 @@ int m_svso(aClient *cptr, aClient *sptr, int parc, char *parv[]) acptr->umodes &= ~(UMODE_OPER | UMODE_LOCOP | UMODE_SADMIN | UMODE_ADMIN | UMODE_COADMIN); acptr->umodes &= ~(UMODE_NETADMIN); - acptr->umodes &= ~(UMODE_DEAF | UMODE_HIDEOPER | UMODE_VICTIM); + acptr->umodes &= ~(UMODE_DEAF | UMODE_HIDEOPER); acptr->oflag = 0; remove_oper_snomasks(acptr); RunHook2(HOOKTYPE_LOCAL_OPER, acptr, 0); diff --git a/src/modules/snomasks/Makefile.in b/src/modules/snomasks/Makefile.in new file mode 100644 index 000000000..1f95f7281 --- /dev/null +++ b/src/modules/snomasks/Makefile.in @@ -0,0 +1,58 @@ +#************************************************************************ +#* 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. +#*/ + +INCLUDES = ../../include/auth.h ../../include/badwords.h ../../include/channel.h \ + ../../include/class.h ../../include/common.h ../../include/config.h ../../include/dbuf.h \ + ../../include/dynconf.h ../../include/events.h ../../include/fdlist.h ../../include/h.h \ + ../../include/hash.h ../../include/inet.h ../../include/ircsprintf.h \ + ../../include/license.h ../../include/macros.h \ + ../../include/modules.h ../../include/modversion.h ../../include/msg.h \ + ../../include/numeric.h ../../include/proto.h ../../include/res.h \ + ../../include/resource.h ../../include/setup.h ../../include/sjoin.h \ + ../../include/sock.h ../../include/ssl.h ../../include/struct.h ../../include/sys.h \ + ../../include/threads.h ../../include/types.h ../../include/url.h \ + ../../include/version.h ../../include/whowas.h + +R_MODULES=\ + dccreject.so + +MODULES=$(R_MODULES) +MODULEFLAGS=@MODULEFLAGS@ +CC=@CC@ +RM=@RM@ + +all: build + +build: $(MODULES) + +custommodule: $(MODULEFILE).c + $(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \ + -o $(MODULEFILE).so $(MODULEFILE).c $(EXLIBS) + +clean: + $(RM) -f *.o *.so *~ core + +############################################################################# +# .so's section +############################################################################# + +dccreject.so: dccreject.c $(INCLUDES) + $(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \ + -o dccreject.so dccreject.c + diff --git a/src/modules/snomasks/dccreject.c b/src/modules/snomasks/dccreject.c new file mode 100644 index 000000000..37cde6a61 --- /dev/null +++ b/src/modules/snomasks/dccreject.c @@ -0,0 +1,70 @@ +/* + * 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(dccreject) + = { + "snomasks/dccreject", + "$Id$", + "Snomask +D", + "3.2-b8-1", + NULL + }; + +/* Global variables */ +long SNO_DCCREJECT = 0L; + +/* Forward declarations */ +int dccreject_dcc_denied(aClient *sptr, aClient *target, char *realfile, char *displayfile, ConfigItem_deny_dcc *dccdeny); + +DLLFUNC int MOD_TEST(dccreject)(ModuleInfo *modinfo) +{ + return MOD_SUCCESS; +} + +DLLFUNC int MOD_INIT(dccreject)(ModuleInfo *modinfo) +{ + SnomaskAdd(modinfo->handle, 'D', umode_allow_opers, &SNO_DCCREJECT); + + HookAddEx(modinfo->handle, HOOKTYPE_DCC_DENIED, dccreject_dcc_denied); + + MARK_AS_OFFICIAL_MODULE(modinfo); + return MOD_SUCCESS; +} + +DLLFUNC int MOD_LOAD(dccreject)(int module_load) +{ + return MOD_SUCCESS; +} + +DLLFUNC int MOD_UNLOAD(dccreject)(int module_unload) +{ + return MOD_SUCCESS; +} + +int dccreject_dcc_denied(aClient *sptr, aClient *target, char *realfile, char *displayfile, ConfigItem_deny_dcc *dccdeny) +{ + sendto_snomask_global(SNO_DCCREJECT, + "%s tried to send forbidden file %s (%s) to %s (is blocked now)", + sptr->name, displayfile, dccdeny->reason, target); + + return 0; +} diff --git a/src/modules/usermodes/Makefile.in b/src/modules/usermodes/Makefile.in index f8eafe751..9984c0788 100644 --- a/src/modules/usermodes/Makefile.in +++ b/src/modules/usermodes/Makefile.in @@ -1,6 +1,6 @@ #************************************************************************ #* IRC - Internet Relay Chat, src/modules/usermodes/Makefile -#* Copyright (C) Carsten V. Munk 2001 & The UnrealIRCd team +#* 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 diff --git a/src/umodes.c b/src/umodes.c index 7560610d6..c83c2bfbf 100644 --- a/src/umodes.c +++ b/src/umodes.c @@ -64,7 +64,6 @@ long UMODE_HIDE = 0L; /* Hide from Nukes */ long UMODE_NETADMIN = 0L; /* Network Admin */ long UMODE_COADMIN = 0L; /* Co Admin */ long UMODE_SECURE = 0L; /* User is a secure connect */ -long UMODE_VICTIM = 0L; /* Intentional Victim */ long UMODE_DEAF = 0L; /* Deaf */ long UMODE_HIDEOPER = 0L; /* Hide oper mode */ long UMODE_SETHOST = 0L; /* Used sethost */ @@ -132,7 +131,6 @@ void umode_init(void) UmodeAdd(NULL, 'N', UMODE_GLOBAL, umode_allow_opers, &UMODE_NETADMIN); UmodeAdd(NULL, 'C', UMODE_GLOBAL, umode_allow_opers, &UMODE_COADMIN); UmodeAdd(NULL, 'z', UMODE_GLOBAL, NULL, &UMODE_SECURE); - UmodeAdd(NULL, 'v', UMODE_GLOBAL, umode_allow_opers, &UMODE_VICTIM); UmodeAdd(NULL, 'd', UMODE_GLOBAL, NULL, &UMODE_DEAF); UmodeAdd(NULL, 'H', UMODE_GLOBAL, umode_allow_opers, &UMODE_HIDEOPER); UmodeAdd(NULL, 't', UMODE_GLOBAL, NULL, &UMODE_SETHOST);