1
0
mirror of https://github.com/anope/anope.git synced 2026-07-10 16:03:15 +02:00

# BUILD : 1.7.14 (1099) # BUGS : # NOTES : removed all that clone stuff

git-svn-id: svn://svn.anope.org/anope/trunk@1099 31f1291d-b8d6-0310-a050-a5561fc1590b


git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@823 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
certus certus@31f1291d-b8d6-0310-a050-a5561fc1590b
2006-07-22 21:13:32 +00:00
parent fff701c65b
commit 570acfa25f
11 changed files with 8 additions and 238 deletions
+1
View File
@@ -7,6 +7,7 @@ Provided by Anope Dev. <dev@anope.org> - 2006
06/22 A Support startup flag. [ #00]
06/21 A Module version check. [ #00]
06/25 A Optional strict privmsg format. [ #00]
07/22 R Removed clone stuff. [ #00]
07/15 A Added BOT_LONG_IDENT for too long idents. [#538]
07/10 A Moved ns_noop into core and assigned an NI_ flag. [#423]
04/08 F Fixed Charybdis support on win32. [#487]
+1 -57
View File
@@ -130,7 +130,7 @@ BotCoreModules "bs_help bs_botlist bs_assign bs_set bs_kick bs_badwords bs_act b
# These modules will be loaded as part of OperServ's core.
# It is not recommended you change these settings unless you are
# sure you understand exactly what it is you are doing.
OperCoreModules "os_help os_global os_stats os_oper os_admin os_staff os_mode os_kick os_clearmodes os_killclones os_akill os_sgline os_sqline os_szline os_chanlist os_userlist os_logonnews os_randomnews os_opernews os_session os_noop os_jupe os_ignore os_set os_reload os_update os_restart os_quit os_shutdown os_defcon os_chankill os_svsnick os_oline os_umode os_modload os_modunload os_modlist os_modinfo"
OperCoreModules "os_help os_global os_stats os_oper os_admin os_staff os_mode os_kick os_clearmodes os_akill os_sgline os_sqline os_szline os_chanlist os_userlist os_logonnews os_randomnews os_opernews os_session os_noop os_jupe os_ignore os_set os_reload os_update os_restart os_quit os_shutdown os_defcon os_chankill os_svsnick os_oline os_umode os_modload os_modunload os_modlist os_modinfo"
# NickCoreModules <list> [RECOMMENDED]
# These modules will be loaded as part of NickServ's core.
@@ -1155,12 +1155,6 @@ SZLineExpiry 30d
# KillOnSQline
# KillClonesAkillExpire <time> [REQUIRED]
# Sets the expiry time for autokills added for hosts that have been
# killed using the KILLCLONES command.
KillClonesAkillExpire 30m
# DisableRaw [RECOMMENDED]
#
# Disables the highly destructive OperServ RAW command.
@@ -1244,10 +1238,6 @@ WallDrop
# services' performance. See the source and comments in sessions.c and the
# online help for more information about session limiting.
#
# Session limiting is meant to replace the CheckClones and KillClones
# code. It is therefore highly recommended that they are disabled when
# session limiting has been enabled.
#
# NOTE: This option is not available when STREAMLINED is defined in
# the Makefile.
@@ -1308,52 +1298,6 @@ MaxSessionKill 15
SessionAutoKillExpiry 30m
# CheckClones <minusers> <maxdelay> <warningdelay> [DEPRECATED]
# Causes Services to try and detect "clones" connecting to the network.
# A WALLOPS (or GOPER, if supported on the IRC server) will be sent if
# Services thinks it has found clones.
#
# This feature has been superseded by Session Limiting.
#
# <minusers> sets the minimum number of users which must successively
# connect to the network before Services will send a clone warning.
#
# <maxdelay> sets the maximum time that can elapse between successive
# users before Services decides they are not clones.
#
# <warningdelay> sets the minimum time between clone warnings for
# clones from the same host.
#
# NOTE: This option is not available when STREAMLINED is defined in
# the Makefile.
# CheckClones 5 10s 30s
# KillClones [DISCOURAGED] [DEPRECATED]
# Causes Services to kill users which trigger the clone warnings. (If
# CheckClones is disabled, this will have no effect.)
#
# This feature has been superceded by Session Limiting.
#
# BEWARE! The clone checking code is easily fooled; it can be
# triggered falsely under many conditions, for example:
#
# - Multiple users connecting from a shell machine.
#
# - A single user repeatedly connecting and disconnecting.
#
# Be very sure you know what you're doing before you even think about
# enabling this option, and remember that Services comes with no
# warranty.
#
# If that wasn't enough discouragement:
#
# ***** DO NOT ENABLE THIS OPTION! *****
#
# NOTE: This option is not available when STREAMLINED is defined in
# the Makefile.
#KillClones
# AddAkiller [OPTIONAL]
# Adds the nickname of the Operator issuing an AKILL to the kill reason.
-5
View File
@@ -33,11 +33,6 @@
/******* OperServ configuration *******/
/* How big a hostname list do we keep for clone detection? On large nets
* (over 500 simultaneous users or so), you may want to increase this if
* you want a good chance of catching clones. */
#define CLONE_DETECT_SIZE 16
/* Define this to enable OperServ's svs commands (superadmin only). */
#define USE_OSSVS
-13
View File
@@ -439,11 +439,6 @@ E int WallDrop;
E int WallForbid;
E int WallGetpass;
E int WallSetpass;
E int CheckClones;
E int CloneMinUsers;
E int CloneMaxDelay;
E int CloneWarningDelay;
E int KillClones;
E int AddAkiller;
E int parse_directive(Directive * d, char *dir, int ac, char *av[MAXPARAMS], int linenum, int reload, char *s);
@@ -477,9 +472,6 @@ E int NickServCoreNumber;
E char **ChanServCoreModules;
E int ChanServCoreNumber;
E int KillClonesAkillExpire;
E int LimitSessions;
E int DefSessionLimit;
E int ExceptionExpiry;
@@ -951,17 +943,12 @@ E int add_szline(User * u, char *mask, const char *by,
E void expire_szlines(void);
E int check_szline(char *nick, char *ip);
E void check_clones(User * user);
E Server *server_global(Server * s, char *msg);
E int OSOpersOnly;
E time_t DefContimer;
E void runDefCon(void);
E struct clone clonelist[CLONE_DETECT_SIZE];
E struct clone warnings[CLONE_DETECT_SIZE];
/**** process.c ****/
E int allow_ignore;
-10
View File
@@ -1031,16 +1031,6 @@ struct sxline_ {
time_t expires;
};
/*************************************************************************/
/*************************************************************************/
/* clone stuff structure */
struct clone {
char *host;
long time;
};
/************************************************************************/
-25
View File
@@ -255,15 +255,8 @@ int WallDrop;
int WallForbid;
int WallGetpass;
int WallSetpass;
int CheckClones;
int CloneMinUsers;
int CloneMaxDelay;
int CloneWarningDelay;
int KillClones;
int AddAkiller;
int KillClonesAkillExpire;
int LimitSessions;
int DefSessionLimit;
int ExceptionExpiry;
@@ -402,10 +395,6 @@ Directive directives[] = {
{PARAM_STRING, 0, &desc_ChanServ}}},
{"ChanServAlias", {{PARAM_STRING, 0, &s_ChanServAlias},
{PARAM_STRING, 0, &desc_ChanServAlias}}},
{"CheckClones", {{PARAM_SET, PARAM_FULLONLY, &CheckClones},
{PARAM_POSINT, 0, &CloneMinUsers},
{PARAM_TIME, 0, &CloneMaxDelay},
{PARAM_TIME, 0, &CloneWarningDelay}}},
{"CSAccessMax", {{PARAM_POSINT, PARAM_RELOAD, &CSAccessMax}}},
{"CSAutokickMax", {{PARAM_POSINT, PARAM_RELOAD, &CSAutokickMax}}},
{"CSAutokickReason",
@@ -479,12 +468,9 @@ Directive directives[] = {
{PARAM_STRING, 0, &desc_HelpServAlias}}},
{"KeepBackups", {{PARAM_INT, PARAM_RELOAD, &KeepBackups}}},
{"KeepLogs", {{PARAM_INT, PARAM_RELOAD, &KeepLogs}}},
{"KillClones", {{PARAM_SET, PARAM_FULLONLY, &KillClones}}},
{"KillonSGline", {{PARAM_SET, PARAM_RELOAD, &KillonSGline}}},
{"KillonSQline", {{PARAM_SET, PARAM_RELOAD, &KillonSQline}}},
{"AddAkiller", {{PARAM_SET, PARAM_RELOAD, &AddAkiller}}},
{"KillClonesAkillExpire",
{{PARAM_TIME, PARAM_RELOAD, &KillClonesAkillExpire}}},
{"LimitSessions", {{PARAM_SET, PARAM_FULLONLY, &LimitSessions}}},
{"LocalAddress", {{PARAM_STRING, 0, &LocalHost},
{PARAM_PORT, PARAM_OPTIONAL, &LocalPort}}},
@@ -1313,17 +1299,6 @@ int read_config(int reload)
if (MaxSessionKill && !SessionAutoKillExpiry)
SessionAutoKillExpiry = 30 * 60; /* 30 minutes */
if (!reload && CheckClones) {
printf
("Warning: You have enabled both session limiting (config "
"option: LimitSessions)\nand clone detection (config option: "
"CheckClones). These two features do not\nfunction correctly "
"when running together. Session limiting is preferred.\n\n");
#ifndef NOT_MAIN
alog("*** Warning: Both LimitSessions and CheckClones are enabled " "- this is bad! Check your config.");
#endif
}
}
if (s_BotServ) {
+1 -1
View File
@@ -1,6 +1,6 @@
include ../../Makefile.inc.win32
SRCS=bs_act.c bs_assign.c bs_badwords.c bs_bot.c bs_botlist.c bs_fantasy.c bs_fantasy_kick.c bs_fantasy_kickban.c bs_fantasy_owner.c bs_fantasy_seen.c bs_fantasy_unban.c bs_help.c bs_info.c bs_kick.c bs_say.c bs_set.c bs_unassign.c cs_access.c cs_akick.c cs_ban.c cs_clear.c cs_drop.c cs_forbid.c cs_getkey.c cs_getpass.c cs_help.c cs_identify.c cs_info.c cs_invite.c cs_kick.c cs_list.c cs_logout.c cs_modes.c cs_register.c cs_sendpass.c cs_set.c cs_status.c cs_suspend.c cs_topic.c cs_xop.c he_help.c hs_del.c hs_delall.c hs_group.c hs_help.c hs_list.c hs_off.c hs_on.c hs_set.c hs_setall.c ms_cancel.c ms_check.c ms_del.c ms_help.c ms_info.c ms_list.c ms_read.c ms_rsend.c ms_send.c ms_sendall.c ms_set.c ms_staff.c ns_access.c ns_alist.c ns_drop.c ns_forbid.c ns_getemail.c ns_getpass.c ns_ghost.c ns_group.c ns_help.c ns_identify.c ns_info.c ns_list.c ns_logout.c ns_recover.c ns_register.c ns_release.c ns_sendpass.c ns_set.c ns_saset.c ns_status.c ns_suspend.c ns_update.c os_admin.c os_akill.c os_chankill.c os_chanlist.c os_clearmodes.c os_defcon.c os_global.c os_help.c os_ignore.c os_jupe.c os_kick.c os_killclones.c \
SRCS=bs_act.c bs_assign.c bs_badwords.c bs_bot.c bs_botlist.c bs_fantasy.c bs_fantasy_kick.c bs_fantasy_kickban.c bs_fantasy_owner.c bs_fantasy_seen.c bs_fantasy_unban.c bs_help.c bs_info.c bs_kick.c bs_say.c bs_set.c bs_unassign.c cs_access.c cs_akick.c cs_ban.c cs_clear.c cs_drop.c cs_forbid.c cs_getkey.c cs_getpass.c cs_help.c cs_identify.c cs_info.c cs_invite.c cs_kick.c cs_list.c cs_logout.c cs_modes.c cs_register.c cs_sendpass.c cs_set.c cs_status.c cs_suspend.c cs_topic.c cs_xop.c he_help.c hs_del.c hs_delall.c hs_group.c hs_help.c hs_list.c hs_off.c hs_on.c hs_set.c hs_setall.c ms_cancel.c ms_check.c ms_del.c ms_help.c ms_info.c ms_list.c ms_read.c ms_rsend.c ms_send.c ms_sendall.c ms_set.c ms_staff.c ns_access.c ns_alist.c ns_drop.c ns_forbid.c ns_getemail.c ns_getpass.c ns_ghost.c ns_group.c ns_help.c ns_identify.c ns_info.c ns_list.c ns_logout.c ns_recover.c ns_register.c ns_release.c ns_sendpass.c ns_set.c ns_saset.c ns_status.c ns_suspend.c ns_update.c os_admin.c os_akill.c os_chankill.c os_chanlist.c os_clearmodes.c os_defcon.c os_global.c os_help.c os_ignore.c os_jupe.c os_kick.c \
os_logonnews.c os_mode.c os_modinfo.c os_modlist.c os_modload.c os_modunload.c os_noop.c os_oline.c os_oper.c os_opernews.c os_quit.c os_randomnews.c os_raw.c os_reload.c os_restart.c os_session.c os_set.c os_sgline.c os_shutdown.c os_sqline.c os_staff.c os_stats.c os_svsnick.c os_szline.c os_umode.c os_update.c os_userlist.c
OBJECTS= $(SRCS:.c=.dll)
CFLAGS=/LD /MD /D MODULE_COMPILE $(CFLAGS) /I"../../include"
-19
View File
@@ -21,11 +21,6 @@ int do_stats(User * u);
void get_operserv_stats(long *nrec, long *memuse);
void myOperServHelp(User * u);
#ifdef _WIN32
extern MDE struct clone clonelist[CLONE_DETECT_SIZE];
extern MDE struct clone warnings[CLONE_DETECT_SIZE];
#endif
/**
* Create the command, and tell anope about it.
* @param argc Argument count
@@ -391,20 +386,6 @@ void get_operserv_stats(long *nrec, long *memuse)
Akill *ak;
SXLine *sx;
if (CheckClones) {
mem = sizeof(struct clone) * CLONE_DETECT_SIZE * 2;
for (i = 0; i < CLONE_DETECT_SIZE; i++) {
if (clonelist[i].host) {
count++;
mem += strlen(clonelist[i].host) + 1;
}
if (warnings[i].host) {
count++;
mem += strlen(warnings[i].host) + 1;
}
}
}
count += akills.count;
mem += akills.capacity;
mem += akills.count * sizeof(Akill);
-102
View File
@@ -17,15 +17,6 @@
/*************************************************************************/
/* List of most recent users - statically initialized to zeros */
struct clone clonelist[CLONE_DETECT_SIZE];
/* Which hosts have we warned about, and when? This is used to keep us
* from sending out notices over and over for clones from the same host. */
struct clone warnings[CLONE_DETECT_SIZE];
/* List of Services administrators */
SList servadmins;
/* List of Services operators */
@@ -57,7 +48,6 @@ char *defconReverseModes(const char *modes);
#ifdef DEBUG_COMMANDS
static int send_clone_lists(User * u);
static int do_matchwild(User * u);
#endif
@@ -89,7 +79,6 @@ void moduleAddOperServCmds(void) {
#ifdef DEBUG_COMMANDS
c = createCommand("LISTTIMERS", send_timeout_list, is_services_root, -1,-1,-1,-1,-1); addCoreCommand(OPERSERV,c);
c = createCommand("MATCHWILD", do_matchwild, is_services_root, -1,-1,-1,-1,-1); addCoreCommand(OPERSERV,c);
c = createCommand("LISTCLONES", send_clone_lists, is_services_root, -1,-1,-1,-1,-1); addCoreCommand(OPERSERV,c);
#endif
}
@@ -619,97 +608,6 @@ int nick_is_services_oper(NickCore * nc)
return 0;
}
/*************************************************************************/
/**************************** Clone detection ****************************/
/*************************************************************************/
/* We just got a new user; does it look like a clone? If so, send out a
* wallops.
*/
void check_clones(User * user)
{
int i, clone_count;
long last_time;
if (!CheckClones)
return;
if (clonelist[0].host)
free(clonelist[0].host);
i = CLONE_DETECT_SIZE - 1;
memmove(clonelist, clonelist + 1, sizeof(struct clone) * i);
clonelist[i].host = sstrdup(common_get_vhost(user));
last_time = clonelist[i].time = time(NULL);
clone_count = 1;
while (--i >= 0 && clonelist[i].host) {
if (clonelist[i].time < last_time - CloneMaxDelay)
break;
if (stricmp(clonelist[i].host, common_get_vhost(user)) == 0) {
++clone_count;
last_time = clonelist[i].time;
if (clone_count >= CloneMinUsers)
break;
}
}
if (clone_count >= CloneMinUsers) {
/* Okay, we have clones. Check first to see if we already know
* about them. */
for (i = CLONE_DETECT_SIZE - 1; i >= 0 && warnings[i].host; --i) {
if (stricmp(warnings[i].host, common_get_vhost(user)) == 0)
break;
}
if (i < 0
|| warnings[i].time < user->my_signon - CloneWarningDelay) {
/* Send out the warning, and note it. */
anope_cmd_global(s_OperServ,
"\2WARNING\2 - possible clones detected from %s",
common_get_vhost(user));
alog("%s: possible clones detected from %s", s_OperServ,
user->host);
i = CLONE_DETECT_SIZE - 1;
if (warnings[0].host)
free(warnings[0].host);
memmove(warnings, warnings + 1, sizeof(struct clone) * i);
warnings[i].host = sstrdup(common_get_vhost(user));
warnings[i].time = clonelist[i].time;
if (KillClones)
kill_user(s_OperServ, user->nick, "Clone kill");
}
}
}
/*************************************************************************/
#ifdef DEBUG_COMMANDS
/* Send clone arrays to given nick. */
static int send_clone_lists(User * u)
{
int i;
if (!CheckClones) {
notice_user(s_OperServ, u, "CheckClones not enabled.");
return MOD_CONT;
}
notice_user(s_OperServ, u, "clonelist[]");
for (i = 0; i < CLONE_DETECT_SIZE; i++) {
if (clonelist[i].host)
notice_user(s_OperServ, u, " %10ld %s", clonelist[i].time,
clonelist[i].host ? clonelist[i].host : "(null)");
}
notice_user(s_OperServ, u, "warnings[]");
for (i = 0; i < CLONE_DETECT_SIZE; i++) {
if (clonelist[i].host)
notice_user(s_OperServ, u, " %10ld %s", warnings[i].time,
warnings[i].host ? warnings[i].host : "(null)");
}
return MOD_CONT;
}
#endif /* DEBUG_COMMANDS */
/*************************************************************************/
/*********************** OperServ command functions **********************/
-5
View File
@@ -620,11 +620,6 @@ User *do_nick(const char *source, char *nick, char *username, char *host,
}
user->vident = sstrdup(username);
if (CheckClones) {
/* Check to see if it looks like clones. */
check_clones(user);
}
if (svid == 0) {
display_news(user, NEWS_LOGON);
display_news(user, NEWS_RANDOM);
+5 -1
View File
@@ -9,10 +9,14 @@ VERSION_MAJOR="1"
VERSION_MINOR="7"
VERSION_PATCH="14"
VERSION_EXTRA=""
VERSION_BUILD="1098"
VERSION_BUILD="1099"
# $Log$
#
# BUILD : 1.7.14 (1099)
# BUGS :
# NOTES : removed all that clone stuff
#
# BUILD : 1.7.14 (1098)
# BUGS :
# NOTES : db-merger booboo