diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/config.c | 25 | ||||
-rw-r--r-- | src/core/Makefile.win32 | 2 | ||||
-rw-r--r-- | src/core/os_stats.c | 19 | ||||
-rw-r--r-- | src/operserv.c | 102 | ||||
-rw-r--r-- | src/users.c | 5 |
5 files changed, 1 insertions, 152 deletions
diff --git a/src/config.c b/src/config.c index a4f0533be..50ffab865 100644 --- a/src/config.c +++ b/src/config.c @@ -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) { diff --git a/src/core/Makefile.win32 b/src/core/Makefile.win32 index 3cda24070..82b471f67 100644 --- a/src/core/Makefile.win32 +++ b/src/core/Makefile.win32 @@ -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" diff --git a/src/core/os_stats.c b/src/core/os_stats.c index e359c35f2..ddd104e07 100644 --- a/src/core/os_stats.c +++ b/src/core/os_stats.c @@ -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); diff --git a/src/operserv.c b/src/operserv.c index 70c2b6ade..ba0e7d854 100644 --- a/src/operserv.c +++ b/src/operserv.c @@ -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 **********************/ diff --git a/src/users.c b/src/users.c index 1bdfd93dd..15c18775f 100644 --- a/src/users.c +++ b/src/users.c @@ -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); |