1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-07-06 07:53:14 +02:00

Replace user mode +v ("victim", receive infected DCC notices) with snomask +D (modules/snomasks/dccreject).

This commit is contained in:
Bram Matthys
2015-06-21 19:48:13 +02:00
parent 7f5f26d0d8
commit c0f18b3e8e
16 changed files with 148 additions and 24 deletions
+2
View File
@@ -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@
Vendored
+4 -3
View File
@@ -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" ;;
+1
View File
@@ -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
+4
View File
@@ -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 */
-1
View File
@@ -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 */
+1
View File
@@ -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
-1
View File
@@ -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)
+1
View File
@@ -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
+1 -1
View File
@@ -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
+3 -13
View File
@@ -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;
}
}
+1 -1
View File
@@ -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);
+1 -1
View File
@@ -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);
+58
View File
@@ -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
+70
View File
@@ -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;
}
+1 -1
View File
@@ -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
-2
View File
@@ -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);