From f0e781287d8c6210e5fa26668208df7830061aa3 Mon Sep 17 00:00:00 2001 From: Bleep Date: Sun, 17 Sep 2000 06:49:55 +0000 Subject: [PATCH] Author: Bleep Log message: Merge in changes from .10 pl 12, fixup merge conflicts, temporarily back out IPcheck changes to get bug fixes from .10. Build and test, remake dependencies. git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@291 c9e4aea6-c8fd-4c43-8297-357d70d61c8c --- ChangeLog | 13 +- ChangeLog.10 | 45 ++- config/config-sh.in | 1 - doc/example.conf | 4 +- include/IPcheck.h | 24 +- include/msg.h | 3 + ircd/IPcheck.c | 687 +++++++++++++++++++++----------------------- ircd/Makefile.in | 393 ++++++++++++------------- ircd/channel.c | 2 +- ircd/ircd.c | 5 +- ircd/ircd_string.c | 2 +- ircd/list.c | 2 - ircd/m_names.c | 21 +- ircd/m_nick.c | 3 + ircd/numnicks.c | 4 +- ircd/parse.c | 13 + ircd/s_auth.c | 3 +- ircd/s_bsd.c | 49 ++-- ircd/s_conf.c | 2 +- ircd/s_misc.c | 17 +- ircd/s_serv.c | 82 +++--- ircd/s_user.c | 121 ++++---- ircd/table_gen.c | 2 +- ircd/uping.c | 1 - 24 files changed, 768 insertions(+), 731 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2d2a5b8..5c3942c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2000-09-17 Thomas Helvey + * ircd/*.c: merged in changes from 2.10.10.pl12, cleanup + merge conflicts. + * ircd/*.h: merged in changes from 2.10.10.pl12, cleanup + merge conflicts + 2000-09-16 Thomas Helvey * ircd/s_conf.c: add code for server struct * ircd/client.c: copy of class.c sort of, new file for client @@ -1330,10 +1336,3 @@ * Merge in u2_10_10_beta06 changes --Bleep * Start ircu2.10.11 development, beta branch u2_10_10 --Bleep #----------------------------------------------------------------------------- -# -# ChangeLog for ircu2.10.11 -# -# $Id: ChangeLog,v 1.164 2000-09-17 03:41:37 bleep Exp $ -# -# Insert new changes at beginning of the change list. -# diff --git a/ChangeLog.10 b/ChangeLog.10 index 2b08206..73ae3b3 100644 --- a/ChangeLog.10 +++ b/ChangeLog.10 @@ -1,10 +1,53 @@ # # ChangeLog for ircu2.10.10 # -# $Id: ChangeLog.10,v 1.7 2000-03-28 06:40:56 bleep Exp $ # # Insert new changes at beginning of the change list. # +--------------------------- Released 2.10.10.pl11.(release) +* Fixed G-lined (reason), thanks to dfx -- Isomer +* Added reason to the "G-lined (reason)" quit messages. -- Isomer +* Removed 'for nick[1.2.3.4]' from quit messages, they're redundant + and make hub hiding more reliable --Isomer +* ircd/s_user.c (hunt_server): add 'No such server' message back + --Isomer +* ircd/s_bsd.c: remove ALWAYSFLUSH - the problem wasn't ircu's fault + -- Isomer +* ircd/m_names.c (m_names): don't add a space if the user's a + zombie; fixes an overrun where we generate a huge number of spaces + in the names reply without length-checking them properly -- Kev +* added 'ALWAYSFLUSH', if you thought the furgeson flusher was bad... + --Isomer +* Fixed /USERHOST again. Horribly embarrased. Thanks again Liandrin + --Isomer +* Added extra field to /stats Y showing how many people are in that class. + Information was previously available via /trace, however tended to flood + you off if you weren't on a good connection. Requested by Mr_RIP + -- Isomer +* Fixed 'BADCHAN' resetting itself to 'Y', reported by Gator --Isomer +--------------------------- Released 2.10.10.pl10 +* Released 2.10.10.pl10 +* Backported /names optimisation from 2.10.11. + '/names 0' now returns verbose listing, '/names' simply returns + ENDOFNAMES. Disallow harmfull /names usage. --Gte +* Fixed ERR_NOSUCHNICK bug in userhost, thanks to Liandrin --Isomer +* Conceal more bugs in IPcheck --Isomer +* Add 'POST' as a unregistered command to disconnect people abusing web + proxies --Isomer. +* Conceal bugs in IPcheck --Isomer +* Fix for changing the wrong define --Isomer +* Fix for the easter buggy. --Isomer +* Fix for rpong --Run +* Fix for other IPcheck bug, thanks BLMet. --Bleep +* Fix for IPcheck bug, rewrite IPcheck from scratch (mostly), + add changes for new code to s_user.c, ircd.c --Bleep +* Shorten connection timeout for auth queries to 60 seconds + If connection is from localhost use the server alias for the + client host. --Bleep +* Fix for ident bug --Isomer +* Fix for rping/rpong --Gte +* Add m_pong to parser handler --Bleep +* Fix for EXTENDED_NUMERICS bug doh!!! --Bleep * Fix for Max Undernet Server bug --Bleep * Fix for PRIVMSG<->NOTICE translation from hubs --Bleep * Fix for Bogus protocol strings for P9 servers --Bleep diff --git a/config/config-sh.in b/config/config-sh.in index 1c26420..12444d8 100644 --- a/config/config-sh.in +++ b/config/config-sh.in @@ -233,7 +233,6 @@ comment 'Logging (filenames are either full paths or files within DPATH)' fi comment 'Bad Channel G-Lines allow operators to add channel masks to a list which prohibits local clients from being able joining channels which match the mask. Remote BadChan Glines allow Uworld to add or remove channels from the servers internal list of badchans' - BADCHAN=y bool 'Do you want to enable Bad Channel G-lines' BADCHAN y if [ "$BADCHAN" = "y" ]; then echo " " diff --git a/doc/example.conf b/doc/example.conf index 7c1be76..72f1a49 100644 --- a/doc/example.conf +++ b/doc/example.conf @@ -215,8 +215,8 @@ T:*.london.ac.uk:london.motd # it is not allowed to jupe others as well. U:Uworld.EU.undernet.org:EuWorld,E,protocol,StatServ,NoteServ,Undernet:* -U:Uworld2.undernet.org:UWorld2,ChanSvr,ChanSaver,ChanServ,COM1,COM2,COM3,COM4:* -U:Uworld.undernet.org:Uworld,X,W,NickSvr,NickSaver,NickServ,LPT1,LPT2,AUX:* +U:Uworld2.undernet.org:UWorld2,W,ChanSvr,ChanSaver,ChanServ,COM1,COM2,COM3,COM4:* +U:Uworld.undernet.org:Uworld,X,NickSvr,NickSaver,NickServ,LPT1,LPT2,AUX:* # # While running your server, you will most probably encounter individuals diff --git a/include/IPcheck.h b/include/IPcheck.h index 0c7f23f..a81747c 100644 --- a/include/IPcheck.h +++ b/include/IPcheck.h @@ -10,20 +10,22 @@ #include /* time_t, size_t */ #define INCLUDED_sys_types_h #endif +#ifndef INCLUDED_netinet_in_h +#include /* in_addr */ +#define INCLUDED_netinet_in_h +#endif struct Client; -/*---------------------------------------------------------------------------- +/* * Prototypes - *--------------------------------------------------------------------------*/ -extern void ip_registry_expire(void); -extern int ip_registry_check_local(unsigned int addr, time_t* next_target_out); -extern void ip_registry_add_local(unsigned int addr); -extern int ip_registry_remote_connect(struct Client *cptr); -extern void ip_registry_connect_succeeded(struct Client *cptr); -extern void ip_registry_local_disconnect(struct Client *cptr); -extern void ip_registry_remote_disconnect(struct Client *cptr); -extern void ip_registry_connect_succeeded(struct Client *cptr); -extern int ip_registry_count(unsigned int addr); + */ +extern int IPcheck_local_connect(struct in_addr ip, time_t* next_target_out); +extern void IPcheck_connect_fail(struct in_addr ip); +extern void IPcheck_connect_succeeded(struct Client *cptr); +extern int IPcheck_remote_connect(struct Client *cptr, int is_burst); +extern void IPcheck_disconnect(struct Client *cptr); +extern unsigned short IPcheck_nr(struct Client* cptr); +extern void IPcheck_expire(); #endif /* INCLUDED_ipcheck_h */ diff --git a/include/msg.h b/include/msg.h index 09c86db..df16388 100644 --- a/include/msg.h +++ b/include/msg.h @@ -322,6 +322,9 @@ struct Client; #define TOK_CLEARMODE "CM" #define CMD_CLEARMODE MSG_CLEARMODE, TOK_CLEARMODE +#define MSG_POST "POST" /* POST */ +#define TOK_POST "POST" + /* * Constants */ diff --git a/ircd/IPcheck.c b/ircd/IPcheck.c index f867f74..6c58f46 100644 --- a/ircd/IPcheck.c +++ b/ircd/IPcheck.c @@ -18,36 +18,22 @@ * * $Id$ * + * + * This file should be edited in a window with a width of 141 characters + * ick */ #include "IPcheck.h" #include "client.h" #include "ircd.h" -#include "numnicks.h" +#include "numnicks.h" /* NumNick, NumServ (GODMODE) */ #include "ircd_alloc.h" -#include "msg.h" -#include "s_bsd.h" -#include "s_debug.h" -#include "s_user.h" +#include "s_bsd.h" /* SetIPChecked */ +#include "s_debug.h" /* Debug */ +#include "s_user.h" /* TARGET_DELAY */ #include "send.h" #include -#include -#include -#include - -#if 0 -#warning Nick collisions are horribly broken in -#warning this version, and its known to core on -#warning a whim. If your even concidering -#warning running this on something resembling a -#warning production network, dont bother, its -#warning not worth your time. To those of you -#warning who grabbed the latest CVS version to -#warning bug test it, thanks, but I recommend -#warning you stick to previous versions for the -#warning time being. -#error --- Broken code --- -#endif + struct IPTargetEntry { int count; @@ -55,100 +41,64 @@ struct IPTargetEntry { }; struct IPRegistryEntry { - struct IPRegistryEntry *next; - struct IPTargetEntry *target; + struct IPRegistryEntry* next; + struct IPTargetEntry* target; unsigned int addr; - time_t last_connect; - unsigned char connected; + int last_connect; + unsigned short connected; unsigned char attempts; }; - /* * Hash table for IPv4 address registry * * Hash table size must be a power of 2 * Use 64K hash table to conserve memory */ -/*---------------------------------------------------------------------------- - * Compile-time Configuration - *--------------------------------------------------------------------------*/ #define IP_REGISTRY_TABLE_SIZE 0x10000 #define MASK_16 0xffff -/* We allow 6 connections in 60 seconds */ -#define IPCHECK_CLONE_LIMIT 6 -#define IPCHECK_CLONE_PERIOD 60 -#define IPCHECK_CLONE_DELAY 600 - - -/*---------------------------------------------------------------------------- - * Handy Macros - *--------------------------------------------------------------------------*/ -#define NOW (CurrentTime) -#define CONNECTED_SINCE(x) (NOW - (x->last_connect)) +#define NOW ((unsigned short)(CurrentTime & MASK_16)) +#define CONNECTED_SINCE(x) (NOW - (x)) +#define IPCHECK_CLONE_LIMIT 4 +#define IPCHECK_CLONE_PERIOD 40 +#define IPCHECK_CLONE_DELAY 600 -/*---------------------------------------------------------------------------- - * Global Data (ugly!) - *--------------------------------------------------------------------------*/ -static struct IPRegistryEntry *hashTable[IP_REGISTRY_TABLE_SIZE]; -static struct IPRegistryEntry *freeList = 0; +static struct IPRegistryEntry* hashTable[IP_REGISTRY_TABLE_SIZE]; +static struct IPRegistryEntry* freeList = 0; -/*---------------------------------------------------------------------------- - * ip_registry_hash: Create a hash key for an IP registry entry and return - * the value. (Is unsigned int really a good type to give - * to the IP argument? Ugly. This should probably be a - * struct in_addr. This is asking for trouble. --ZS) - *--------------------------------------------------------------------------*/ static unsigned int ip_registry_hash(unsigned int ip) { return ((ip >> 16) ^ ip) & (IP_REGISTRY_TABLE_SIZE - 1); } - -/*---------------------------------------------------------------------------- - * ip_registry_find: Find a given IP registry entry and return it. - *--------------------------------------------------------------------------*/ -static struct IPRegistryEntry *ip_registry_find(unsigned int ip) +static struct IPRegistryEntry* ip_registry_find(unsigned int ip) { - struct IPRegistryEntry *entry = 0; - - for (entry = hashTable[ip_registry_hash(ip)]; entry; entry = entry->next) { + struct IPRegistryEntry* entry = hashTable[ip_registry_hash(ip)]; + for ( ; entry; entry = entry->next) { if (entry->addr == ip) - return entry; + break; } - - return NULL; + return entry; } - -/*---------------------------------------------------------------------------- - * ip_registry_add: Add an entry to the IP registry - *--------------------------------------------------------------------------*/ -static void ip_registry_add(struct IPRegistryEntry *entry) +static void ip_registry_add(struct IPRegistryEntry* entry) { unsigned int bucket = ip_registry_hash(entry->addr); - entry->next = hashTable[bucket]; hashTable[bucket] = entry; } - -/*---------------------------------------------------------------------------- - * ip_registry_remove: Remove an entry from the IP registry - *--------------------------------------------------------------------------*/ -static void ip_registry_remove(struct IPRegistryEntry* entry) +static void ip_registry_remove(struct IPRegistryEntry* entry) { unsigned int bucket = ip_registry_hash(entry->addr); - if (hashTable[bucket] == entry) hashTable[bucket] = entry->next; else { - struct IPRegistryEntry *prev; - - for (prev = hashTable[bucket]; prev; prev = prev->next) { + struct IPRegistryEntry* prev = hashTable[bucket]; + for ( ; prev; prev = prev->next) { if (prev->next == entry) { prev->next = entry->next; break; @@ -157,108 +107,73 @@ static void ip_registry_remove(struct IPRegistryEntry* entry) } } - -/*---------------------------------------------------------------------------- - * ip_registry_new_entry(): Creates and initializes an IP Registry entry. - * NOW ALSO ADDS IT TO THE LIST! --ZS - *--------------------------------------------------------------------------*/ -static struct IPRegistryEntry *ip_registry_new_entry(unsigned int addr, int attempt) +static struct IPRegistryEntry* ip_registry_new_entry() { struct IPRegistryEntry* entry = freeList; - if (entry) freeList = entry->next; else - entry = (struct IPRegistryEntry *)MyMalloc(sizeof(struct IPRegistryEntry)); + entry = (struct IPRegistryEntry*) MyMalloc(sizeof(struct IPRegistryEntry)); assert(0 != entry); - memset(entry, 0, sizeof(struct IPRegistryEntry)); entry->last_connect = NOW; /* Seconds since last connect attempt */ entry->connected = 1; /* connected clients for this IP */ - entry->attempts = attempt; /* Number attempts for this IP */ - entry->addr = addr; /* Entry's IP Address */ - - ip_registry_add(entry); - + entry->attempts = 1; /* Number attempts for this IP */ return entry; } - -/*---------------------------------------------------------------------------- - * ip_registry_delete_entry: Frees an entry and adds the structure to a list - * of free structures. (We should probably reclaim - * the freelist every once in a while! This is - * potentially a way to DoS the server... -ZS) - *--------------------------------------------------------------------------*/ -static void ip_registry_delete_entry(struct IPRegistryEntry *entry) +static void ip_registry_delete_entry(struct IPRegistryEntry* entry) { if (entry->target) MyFree(entry->target); - entry->next = freeList; freeList = entry; } - -/*---------------------------------------------------------------------------- - * ip_registry_update_free_targets: - *--------------------------------------------------------------------------*/ -static unsigned int ip_registry_update_free_targets(struct IPRegistryEntry *entry) +static unsigned int ip_registry_update_free_targets(struct IPRegistryEntry* entry) { unsigned int free_targets = STARTTARGETS; if (entry->target) { - free_targets = (entry->target->count + - (CONNECTED_SINCE(entry) / TARGET_DELAY)); - + free_targets = entry->target->count + (CONNECTED_SINCE(entry->last_connect) / TARGET_DELAY); if (free_targets > STARTTARGETS) free_targets = STARTTARGETS; - entry->target->count = free_targets; } - return free_targets; } - -/*---------------------------------------------------------------------------- - * ip_registry_expire_entry: expire an IP entry if it needs to be. If an - * entry isn't expired, then also check the target - * list to see if it needs to be expired. - *--------------------------------------------------------------------------*/ -static void ip_registry_expire_entry(struct IPRegistryEntry *entry) +static void ip_registry_expire_entry(struct IPRegistryEntry* entry) { /* * Don't touch this number, it has statistical significance * XXX - blah blah blah - * ZS - Just -what- statistical significance does it -have-? - * Iso - Noone knows, we've just been told not to touch it. */ - if (CONNECTED_SINCE(entry) > 120 && 0 != entry->target) { - MyFree(entry->target); - entry->target = 0; - } - if (CONNECTED_SINCE(entry) > 600) { + if (CONNECTED_SINCE(entry->last_connect) > 600) { + /* + * expired + */ ip_registry_remove(entry); ip_registry_delete_entry(entry); } + else if (CONNECTED_SINCE(entry->last_connect) > 120 && 0 != entry->target) { + /* + * Expire storage of targets + */ + MyFree(entry->target); + entry->target = 0; + } } - -/*---------------------------------------------------------------------------- - * ip_registry_expire: Expire all of the needed entries in the hash table - *--------------------------------------------------------------------------*/ -void ip_registry_expire(void) +/* + * ip_registry_expire + */ +static void ip_registry_expire() { - struct IPRegistryEntry *entry; - struct IPRegistryEntry *entry_next; - static time_t next_expire = 0; int i; - - /* Only do this if we're ready to */ - if (next_expire >= CurrentTime) - return; + struct IPRegistryEntry* entry; + struct IPRegistryEntry* entry_next; for (i = 0; i < IP_REGISTRY_TABLE_SIZE; ++i) { for (entry = hashTable[i]; entry; entry = entry_next) { @@ -267,12 +182,10 @@ void ip_registry_expire(void) ip_registry_expire_entry(entry); } } - - next_expire = CurrentTime + 60; } - -/*---------------------------------------------------------------------------- +/* + * IPcheck_local_connect * * Event: * A new connection was accept()-ed with IP number `cptr->ip.s_addr'. @@ -285,10 +198,9 @@ void ip_registry_expire(void) * * Throttling: * - * A connection should be rejected when a connection from the same IP - * number was received IPCHECK_CLONE_LIMIT times before this connect - * attempt, with reconnect intervals of IPCHECK_CLONE_PERIOD seconds - * or less. + * A connection should be rejected when a connection from the same IP number was + * received IPCHECK_CLONE_LIMIT times before this connect attempt, with + * reconnect intervals of IPCHECK_CLONE_PERIOD seconds or less. * * Free target inheritance: * @@ -297,301 +209,356 @@ void ip_registry_expire(void) * structure, or left at STARTTARGETS. This can be done by changing * cptr->nexttarget to be `now - (TARGET_DELAY * (FREE_TARGETS - 1))', * where FREE_TARGETS may range from 0 till STARTTARGETS. - *--------------------------------------------------------------------------*/ -int ip_registry_check_local(unsigned int addr, time_t *next_target_out) + */ +int ip_registry_check_local(unsigned int addr, time_t* next_target_out) { - struct IPRegistryEntry *entry = ip_registry_find(addr); + struct IPRegistryEntry* entry = ip_registry_find(addr); unsigned int free_targets = STARTTARGETS; - assert(0 != next_target_out); - - /* If they've never connected before, let them on */ if (0 == entry) { - Debug((DEBUG_DEBUG,"IPcheck: Local user allowed - unseen")); - entry = ip_registry_new_entry(addr, 1); + entry = ip_registry_new_entry(); + entry->addr = addr; /* The IP number of registry entry */ + ip_registry_add(entry); return 1; } - - /* Keep track of how many people have connected */ - entry->connected++; - - /* Do not allow more than 250 connects from a single IP, EVER. */ - if (250 <= entry->connected) { - Debug((DEBUG_DEBUG,"IPcheck: Local user disallowed - Too many connections")); - entry->connected--; + /* Note that this also connects server connects. + * It is hard and not interesting, to change that. + * + * Don't allow more then 255 connects from one IP number, ever + */ + if (0 == ++entry->connected) return 0; - } - /* If our threshhold has elapsed, reset the counter so we don't throttle, - * IPCHECK_CLONE_LIMIT connections every IPCHECK_CLONE_PERIOD - */ - if (CONNECTED_SINCE(entry) > IPCHECK_CLONE_PERIOD) { + if (CONNECTED_SINCE(entry->last_connect) > IPCHECK_CLONE_PERIOD) entry->attempts = 0; - entry->last_connect = NOW; - } - - /* Count the number of recent attempts */ - entry->attempts++; - - if (250 <= entry->attempts) - --entry->attempts; /* Disallow overflow */ - free_targets = ip_registry_update_free_targets(entry); + entry->last_connect = NOW; + + if (0 == ++entry->attempts) /* Check for overflow */ + --entry->attempts; - /* Have they connected less than IPCHECK_CLONE_LIMIT times && next_target_out */ - if (entry->attempts < IPCHECK_CLONE_LIMIT && next_target_out) { + if (entry->attempts < IPCHECK_CLONE_LIMIT) { + if (next_target_out) *next_target_out = CurrentTime - (TARGET_DELAY * free_targets - 1); - entry->last_connect = NOW; - Debug((DEBUG_DEBUG,"IPcheck: Local user allowed")); - return 1; } - - /* If the server is younger than IPCHECK_CLONE_DELAY then the person - * is allowed on. - */ - if ((CurrentTime - me.since) < IPCHECK_CLONE_DELAY) { - Debug((DEBUG_DEBUG,"IPcheck: Local user allowed during server startup")); + else if ((CurrentTime - me.since) > IPCHECK_CLONE_DELAY) { + /* + * Don't refuse connection when we just rebooted the server + */ +#ifdef NOTHROTTLE return 1; +#else + --entry->connected; + return 0; +#endif } - - /* Otherwise they're throttled */ - entry->connected--; - Debug((DEBUG_DEBUG,"IPcheck: Throttling local user")); - return 0; + return 1; } /* - * Add someone to the ip registry without throttling them. - * This is used for server connections. + * IPcheck_remote_connect + * + * Event: + * A remote client connected to Undernet, with IP number `cptr->ip.s_addr' + * and hostname `hostname'. + * + * Action: + * Update the IPcheck registry. + * Return 0 on failure, 1 on success. */ -void ip_registry_add_local(unsigned int addr) +int ip_registry_check_remote(struct Client* cptr, int is_burst) { - struct IPRegistryEntry *entry = ip_registry_find(addr); - - /* If they've never connected before, let them on */ + struct IPRegistryEntry* entry = ip_registry_find(cptr->ip.s_addr); + + /* + * Mark that we did add/update an IPregistry entry + */ + SetIPChecked(cptr); if (0 == entry) { - Debug((DEBUG_DEBUG,"IPcheck: Local user allowed - unseen")); - entry = ip_registry_new_entry(addr, 1); - return; + entry = ip_registry_new_entry(); + entry->addr = cptr->ip.s_addr; + if (is_burst) + entry->attempts = 0; + ip_registry_add(entry); } - - /* Keep track of how many people have connected */ - entry->connected++; - - assert(250 <= entry->connected); - - return; + else { + if (0 == ++entry->connected) { + /* + * Don't allow more then 255 connects from one IP number, ever + */ + return 0; + } + if (CONNECTED_SINCE(entry->last_connect) > IPCHECK_CLONE_PERIOD) + entry->attempts = 0; + if (!is_burst) { + if (0 == ++entry->attempts) { + /* + * Check for overflow + */ + --entry->attempts; + } + ip_registry_update_free_targets(entry); + entry->last_connect = NOW; + } + } + return 1; } -/*---------------------------------------------------------------------------- - * ip_registry_remote_connect +/* + * IPcheck_connect_fail * - * Does anything that needs to be done once we actually have a client - * structure to play with on a remote connection. - * returns: - * 1 - allowed to connect - * 0 - disallowed. - *--------------------------------------------------------------------------*/ -int ip_registry_remote_connect(struct Client *cptr) + * Event: + * This local client failed to connect due to legal reasons. + * + * Action: + * Neutralize the effect of calling IPcheck_local_connect, in such + * a way that the client won't be penalized when trying to reconnect + * again. + */ +void ip_registry_connect_fail(unsigned int addr) { - struct IPRegistryEntry *entry = ip_registry_find(cptr->ip.s_addr); - assert(0 != cptr); - - /* If they've never connected before, let them on */ - if (0 == entry) { - entry = ip_registry_new_entry(cptr->ip.s_addr, 1); - SetIPChecked(cptr); - Debug((DEBUG_DEBUG,"IPcheck: First remote connection. connected=%i",entry->connected)); - return 1; - } - - /* Keep track of how many people have connected */ - entry->connected++; - SetIPChecked(cptr); - - /* Do not allow more than 250 connections from one IP. - * This can happen by having 128 clients on one server, and 128 on another - * and then the servers joining after a netsplit - */ - if (250 <= entry->connected) { - sendto_ops("IPcheck Ghost! [%s]",inet_ntoa(cptr->ip)); - Debug((DEBUG_DEBUG,"IPcheck: Too many connected from IP: %i",entry->connected)); - return 0; - } - - Debug((DEBUG_DEBUG,"IPcheck: %i people connected",entry->connected)); - - /* They are allowed to connect */ - return 1; + struct IPRegistryEntry* entry = ip_registry_find(addr); + if (entry) + --entry->attempts; } -/*---------------------------------------------------------------------------- +/* * IPcheck_connect_succeeded * * Event: * A client succeeded to finish the registration. * * Finish IPcheck registration of a successfully, locally connected client. - *--------------------------------------------------------------------------*/ + */ void ip_registry_connect_succeeded(struct Client *cptr) { + const char* tr = ""; unsigned int free_targets = STARTTARGETS; - struct IPRegistryEntry *entry; - - assert(cptr); - - entry = ip_registry_find(cptr->ip.s_addr); - - - assert(entry); + struct IPRegistryEntry* entry = ip_registry_find(cptr->ip.s_addr); + if (!entry) { + Debug((DEBUG_ERROR, "Missing registry entry for: %s", cptr->sock_ip)); + return; + } if (entry->target) { memcpy(cptr->targets, entry->target->targets, MAXTARGETS); free_targets = entry->target->count; + tr = " tr"; } - - sendcmdto_one(&me, CMD_NOTICE, cptr, "%C :connected %u attempts %u/%u free targets %u/%u%s" - " IPcheck: %s", - cptr, entry->connected, entry->attempts, IPCHECK_CLONE_LIMIT, - free_targets, STARTTARGETS, - ((entry->target) ? " [Inherited Targets]" : ""), - ((CurrentTime - me.since) < IPCHECK_CLONE_DELAY) ? "Disabled" : "Enabled"); - - SetIPChecked(cptr); + sendto_one(cptr, ":%s NOTICE %s :on %u ca %u(%u) ft %u(%u)%s", + me.name, cptr->name, entry->connected, entry->attempts, + IPCHECK_CLONE_LIMIT, free_targets, STARTTARGETS, tr); } - -/*---------------------------------------------------------------------------- +/* * IPcheck_disconnect * * Event: - * A local client disconnected. + * A local client disconnected or a remote client left Undernet. * * Action: * Update the IPcheck registry. * Remove all expired IPregistry structures from the hash bucket * that belongs to this clients IP number. - *--------------------------------------------------------------------------*/ -void ip_registry_local_disconnect(struct Client *cptr) + */ +void ip_registry_disconnect(struct Client *cptr) { - struct IPRegistryEntry *entry; - unsigned int free_targets; - - assert(0 != cptr); - - entry = ip_registry_find(cptr->ip.s_addr); - - Debug((DEBUG_DEBUG,"IPcheck: Local Disconnect")); - - assert(IsIPChecked(cptr)); - - assert(entry); - - assert(entry->connected > 0); - - if (entry->connected > 0) { - entry->connected--; + struct IPRegistryEntry* entry = ip_registry_find(cptr->ip.s_addr); + if (0 == entry) { + /* + * trying to find an entry for a server causes this to happen, + * servers should never have FLAGS_IPCHECK set + */ + return; } - /* - * If this was the last one, set `last_connect' to disconnect time - * (used for expiration) Note that we reset attempts here as well if our - * threshhold hasn't been crossed. + * If this was the last one, set `last_connect' to disconnect time (used for expiration) */ - if (0 == entry->connected) { + if (0 == --entry->connected) { + if (CONNECTED_SINCE(entry->last_connect) > IPCHECK_CLONE_LIMIT * IPCHECK_CLONE_PERIOD) { + /* + * Otherwise we'd penetalize for this old value if the client reconnects within 20 seconds + */ + entry->attempts = 0; + } ip_registry_update_free_targets(entry); entry->last_connect = NOW; } - - assert(MyConnect(cptr)); - - if (0 == entry->target) { - entry->target = (struct IPTargetEntry *)MyMalloc(sizeof(struct IPTargetEntry)); + if (MyConnect(cptr)) { + unsigned int free_targets; + /* + * Copy the clients targets + */ + if (0 == entry->target) { + entry->target = (struct IPTargetEntry*) MyMalloc(sizeof(struct IPTargetEntry)); + entry->target->count = STARTTARGETS; + } assert(0 != entry->target); - entry->target->count = STARTTARGETS; - } - memcpy(entry->target->targets, cptr->targets, MAXTARGETS); - /* - * This calculation can be pretty unfair towards large multi-user hosts, - * but there is "nothing" we can do without also allowing spam bots to - * send more messages or by drastically increasing the ammount of memory - * used in the IPregistry. - * - * The problem is that when a client disconnects, leaving no free targets, - * then the next client from that IP number has to pay for it (getting no - * free targets). But ALSO the next client, and the next client, and the - * next client etc - until another client disconnects that DOES leave free - * targets. The reason for this is that if there are 10 SPAM bots, and - * they all disconnect at once, then they ALL should get no free targets - * when reconnecting. We'd need to store an entry per client (instead of - * per IP number) to avoid this. - */ - if (cptr->nexttarget < CurrentTime) - free_targets = (CurrentTime - cptr->nexttarget) / TARGET_DELAY + 1; - else - free_targets = 0; - - /* Add bonus, if you've been connected for more than 10 minutes you - * get a free target every TARGET_DELAY seconds. - * this is pretty fuzzy, but it will help in some cases. - */ - if ((CurrentTime - cptr->firsttime) > 600) - free_targets += (CurrentTime - cptr->firsttime - 600) / TARGET_DELAY; + memcpy(entry->target->targets, cptr->targets, MAXTARGETS); + /* + * This calculation can be pretty unfair towards large multi-user hosts, but + * there is "nothing" we can do without also allowing spam bots to send more + * messages or by drastically increasing the ammount of memory used in the IPregistry. + * + * The problem is that when a client disconnects, leaving no free targets, then + * the next client from that IP number has to pay for it (getting no free targets). + * But ALSO the next client, and the next client, and the next client etc - until + * another client disconnects that DOES leave free targets. The reason for this + * is that if there are 10 SPAM bots, and they all disconnect at once, then they + * ALL should get no free targets when reconnecting. We'd need to store an entry + * per client (instead of per IP number) to avoid this. + */ + if (cptr->nexttarget < CurrentTime) { + /* + * Number of free targets + */ + free_targets = (CurrentTime - cptr->nexttarget) / TARGET_DELAY + 1; + } + else + free_targets = 0; + /* + * Add bonus, this is pretty fuzzy, but it will help in some cases. + */ + if ((CurrentTime - cptr->firsttime) > 600) + /* + * Was longer then 10 minutes online? + */ + free_targets += (CurrentTime - cptr->firsttime - 600) / TARGET_DELAY; + /* + * Finally, store smallest value for Judgement Day + */ + if (free_targets < entry->target->count) + entry->target->count = free_targets; + } +} - /* Finally, store smallest value for Judgement Day */ - if (free_targets < entry->target->count) - entry->target->count = free_targets; - +/* + * IPcheck_nr + * + * Returns number of clients with the same IP number + */ +int ip_registry_count(unsigned int addr) +{ + struct IPRegistryEntry* entry = ip_registry_find(addr); + return (entry) ? entry->connected : 0; } -/*---------------------------------------------------------------------------- - * ip_registry_remote_disconnect +/* + * IPcheck_local_connect * * Event: - * A remote client disconnected. + * A new connection was accept()-ed with IP number `cptr->ip.s_addr'. * * Action: * Update the IPcheck registry. - * Remove all expired IPregistry structures from the hash bucket - * that belongs to this clients IP number. - *--------------------------------------------------------------------------*/ -void ip_registry_remote_disconnect(struct Client *cptr) + * Return: + * 1 : You're allowed to connect. + * 0 : You're not allowed to connect. + * + * Throttling: + * + * A connection should be rejected when a connection from the same IP number was + * received IPCHECK_CLONE_LIMIT times before this connect attempt, with + * reconnect intervals of IPCHECK_CLONE_PERIOD seconds or less. + * + * Free target inheritance: + * + * When the client is accepted, then the number of Free Targets + * of the cptr is set to the value stored in the found IPregistry + * structure, or left at STARTTARGETS. This can be done by changing + * cptr->nexttarget to be `now - (TARGET_DELAY * (FREE_TARGETS - 1))', + * where FREE_TARGETS may range from 0 till STARTTARGETS. + */ +int IPcheck_local_connect(struct in_addr a, time_t* next_target_out) { - struct IPRegistryEntry *entry; + assert(0 != next_target_out); + return ip_registry_check_local(a.s_addr, next_target_out); +} +/* + * IPcheck_remote_connect + * + * Event: + * A remote client connected to Undernet, with IP number `cptr->ip.s_addr' + * and hostname `hostname'. + * + * Action: + * Update the IPcheck registry. + * Return 0 on failure, 1 on success. + */ +int IPcheck_remote_connect(struct Client *cptr, int is_burst) +{ assert(0 != cptr); + return ip_registry_check_remote(cptr, is_burst); +} - entry = ip_registry_find(cptr->ip.s_addr); - - assert(entry); - - assert(entry->connected > 0); - Debug((DEBUG_DEBUG,"IPcheck: Remote Disconnect")); +/* + * IPcheck_connect_fail + * + * Event: + * This local client failed to connect due to legal reasons. + * + * Action: + * Neutralize the effect of calling IPcheck_local_connect, in such + * a way that the client won't be penalized when trying to reconnect + * again. + */ +void IPcheck_connect_fail(struct in_addr a) +{ + ip_registry_connect_fail(a.s_addr); +} - if (entry->connected > 0) { - entry->connected--; - } +/* + * IPcheck_connect_succeeded + * + * Event: + * A client succeeded to finish the registration. + * + * Finish IPcheck registration of a successfully, locally connected client. + */ +void IPcheck_connect_succeeded(struct Client *cptr) +{ + assert(0 != cptr); + ip_registry_connect_succeeded(cptr); +} - /* - * If this was the last one, set `last_connect' to disconnect time - * (used for expiration) Note that we reset attempts here as well if our - * threshhold hasn't been crossed. - */ - if (0 == entry->connected) { - ip_registry_update_free_targets(entry); - entry->last_connect=NOW; - } +/* + * IPcheck_disconnect + * + * Event: + * A local client disconnected or a remote client left Undernet. + * + * Action: + * Update the IPcheck registry. + * Remove all expired IPregistry structures from the hash bucket + * that belongs to this clients IP number. + */ +void IPcheck_disconnect(struct Client *cptr) +{ + assert(0 != cptr); + ip_registry_disconnect(cptr); } -/*---------------------------------------------------------------------------- +/* * IPcheck_nr * * Returns number of clients with the same IP number - *--------------------------------------------------------------------------*/ -int ip_registry_count(unsigned int addr) + */ +unsigned short IPcheck_nr(struct Client *cptr) { - struct IPRegistryEntry *entry = ip_registry_find(addr); - return (entry) ? entry->connected : 0; + assert(0 != cptr); + return ip_registry_count(cptr->ip.s_addr); } + +void IPcheck_expire() +{ + static time_t next_expire = 0; + if (next_expire < CurrentTime) { + ip_registry_expire(); + next_expire = CurrentTime + 60; + } +} + + diff --git a/ircd/Makefile.in b/ircd/Makefile.in index 76992b4..032d7a5 100644 --- a/ircd/Makefile.in +++ b/ircd/Makefile.in @@ -67,6 +67,7 @@ SRC = \ IPcheck.c \ channel.c \ class.c \ + client.c \ crule.c \ dbuf.c \ fda.c \ @@ -286,11 +287,11 @@ stamp-m: # DO NOT DELETE THIS LINE -- make depend depends on it. IPcheck.o: IPcheck.c ../include/IPcheck.h ../include/client.h \ - ../include/dbuf.h ../include/ircd_defs.h ../include/ircd_handler.h \ + ../include/ircd_defs.h ../include/dbuf.h ../include/ircd_handler.h \ ../include/ircd.h ../config/config.h ../config/setup.h \ ../include/struct.h ../include/numnicks.h ../include/ircd_alloc.h \ - ../include/fda.h ../include/msg.h ../include/s_bsd.h \ - ../include/s_debug.h ../include/s_user.h ../include/send.h + ../include/fda.h ../include/s_bsd.h ../include/s_debug.h \ + ../include/s_user.h ../include/send.h channel.o: channel.c ../include/channel.h ../config/config.h \ ../config/setup.h ../include/ircd_defs.h ../include/client.h \ ../include/dbuf.h ../include/ircd_handler.h ../include/hash.h \ @@ -303,13 +304,13 @@ channel.o: channel.c ../include/channel.h ../config/config.h \ ../include/s_user.h ../include/send.h ../include/sprintf_irc.h \ ../include/support.h ../include/sys.h ../include/whowas.h class.o: class.c ../include/class.h ../include/client.h \ - ../include/dbuf.h ../include/ircd_defs.h ../include/ircd_handler.h \ + ../include/ircd_defs.h ../include/dbuf.h ../include/ircd_handler.h \ ../include/ircd.h ../config/config.h ../config/setup.h \ ../include/struct.h ../include/ircd_reply.h ../include/list.h \ ../include/numeric.h ../include/s_conf.h ../include/s_debug.h \ ../include/send.h crule.o: crule.c ../include/crule.h ../include/client.h \ - ../include/dbuf.h ../include/ircd_defs.h ../include/ircd_handler.h \ + ../include/ircd_defs.h ../include/dbuf.h ../include/ircd_handler.h \ ../include/ircd.h ../config/config.h ../config/setup.h \ ../include/struct.h ../include/ircd_alloc.h ../include/fda.h \ ../include/ircd_chattr.h ../include/ircd_string.h ../include/match.h \ @@ -321,20 +322,20 @@ fda.o: fda.c fileio.o: fileio.c ../include/fileio.h ../include/ircd_alloc.h \ ../include/fda.h gline.o: gline.c ../include/gline.h ../config/config.h \ - ../config/setup.h ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h ../include/ircd.h \ + ../config/setup.h ../include/client.h ../include/ircd_defs.h \ + ../include/dbuf.h ../include/ircd_handler.h ../include/ircd.h \ ../include/struct.h ../include/ircd_alloc.h ../include/fda.h \ ../include/ircd_reply.h ../include/ircd_string.h \ ../include/ircd_chattr.h ../include/match.h ../include/numeric.h \ - ../include/s_bsd.h ../include/s_misc.h ../include/send.h \ - ../include/support.h ../include/msg.h ../include/numnicks.h \ - ../include/sys.h -hash.o: hash.c ../include/hash.h ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h ../include/channel.h \ - ../config/config.h ../config/setup.h ../include/ircd_chattr.h \ - ../include/ircd_string.h ../include/ircd.h ../include/struct.h \ - ../include/msg.h ../include/send.h ../include/support.h \ - ../include/sys.h + ../include/s_bsd.h ../include/s_debug.h ../include/s_misc.h \ + ../include/send.h ../include/support.h ../include/msg.h \ + ../include/numnicks.h ../include/sys.h +hash.o: hash.c ../include/hash.h ../include/client.h \ + ../include/ircd_defs.h ../include/dbuf.h ../include/ircd_handler.h \ + ../include/channel.h ../config/config.h ../config/setup.h \ + ../include/ircd_chattr.h ../include/ircd_string.h ../include/ircd.h \ + ../include/struct.h ../include/msg.h ../include/send.h \ + ../include/support.h ../include/sys.h ircd.o: ircd.c ../include/ircd.h ../config/config.h ../config/setup.h \ ../include/struct.h ../include/ircd_defs.h ../include/IPcheck.h \ ../include/class.h ../include/client.h ../include/dbuf.h \ @@ -352,7 +353,7 @@ ircd_alloc.o: ircd_alloc.c ../include/ircd_alloc.h ../include/fda.h \ ../include/ircd_string.h ../config/config.h ../config/setup.h \ ../include/ircd_chattr.h ../include/s_debug.h ../include/ircd_defs.h ircd_log.o: ircd_log.c ../include/ircd_log.h ../include/client.h \ - ../include/dbuf.h ../include/ircd_defs.h ../include/ircd_handler.h \ + ../include/ircd_defs.h ../include/dbuf.h ../include/ircd_handler.h \ ../config/config.h ../config/setup.h ../include/ircd_string.h \ ../include/ircd_chattr.h ../include/s_debug.h ../include/struct.h ircd_osdep.o: ircd_osdep.c ../include/ircd_osdep.h @@ -365,23 +366,23 @@ ircd_relay.o: ircd_relay.c ../include/ircd_relay.h \ ../include/numeric.h ../include/numnicks.h ../include/s_debug.h \ ../include/s_misc.h ../include/s_user.h ../include/send.h ircd_reply.o: ircd_reply.c ../include/ircd_reply.h ../include/client.h \ - ../include/dbuf.h ../include/ircd_defs.h ../include/ircd_handler.h \ + ../include/ircd_defs.h ../include/dbuf.h ../include/ircd_handler.h \ ../include/ircd.h ../config/config.h ../config/setup.h \ ../include/struct.h ../include/ircd_snprintf.h ../include/numeric.h \ ../include/s_conf.h ../include/s_debug.h ../include/send.h ircd_signal.o: ircd_signal.c ../include/ircd_signal.h \ ../include/ircd.h ../config/config.h ../config/setup.h \ ../include/struct.h ../include/ircd_defs.h -ircd_snprintf.o: ircd_snprintf.c ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h ../include/channel.h \ - ../config/config.h ../config/setup.h ../include/ircd_snprintf.h \ - ../include/struct.h +ircd_snprintf.o: ircd_snprintf.c ../include/client.h \ + ../include/ircd_defs.h ../include/dbuf.h ../include/ircd_handler.h \ + ../include/channel.h ../config/config.h ../config/setup.h \ + ../include/ircd_snprintf.h ../include/struct.h ircd_string.o: ircd_string.c ../include/ircd_string.h \ ../config/config.h ../config/setup.h ../include/ircd_chattr.h \ - ../include/ircd_defs.h chattr.tab.c + ../include/ircd_defs.h ../include/ircd_log.h chattr.tab.c ircd_xopen.o: ircd_xopen.c ../include/ircd_xopen.h jupe.o: jupe.c ../include/jupe.h ../config/config.h ../config/setup.h \ - ../include/client.h ../include/dbuf.h ../include/ircd_defs.h \ + ../include/client.h ../include/ircd_defs.h ../include/dbuf.h \ ../include/ircd_handler.h ../include/hash.h ../include/ircd.h \ ../include/struct.h ../include/ircd_alloc.h ../include/fda.h \ ../include/ircd_reply.h ../include/ircd_string.h \ @@ -390,7 +391,7 @@ jupe.o: jupe.c ../include/jupe.h ../config/config.h ../config/setup.h \ ../include/s_misc.h ../include/send.h ../include/support.h \ ../include/sys.h list.o: list.c ../include/list.h ../include/class.h \ - ../include/client.h ../include/dbuf.h ../include/ircd_defs.h \ + ../include/client.h ../include/ircd_defs.h ../include/dbuf.h \ ../include/ircd_handler.h ../include/ircd.h ../config/config.h \ ../config/setup.h ../include/struct.h ../include/ircd_alloc.h \ ../include/fda.h ../include/ircd_reply.h ../include/ircd_string.h \ @@ -408,12 +409,12 @@ listener.o: listener.c ../include/listener.h ../include/ircd_defs.h \ ../include/numeric.h ../include/s_bsd.h ../include/s_conf.h \ ../include/s_misc.h ../include/send.h ../include/sprintf_irc.h \ ../include/sys.h -m_admin.o: m_admin.c ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h \ - ../include/ircd_reply.h ../include/msg.h ../include/numeric.h \ - ../include/numnicks.h ../include/s_conf.h ../include/s_user.h -m_away.o: m_away.c ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h ../include/ircd.h \ +m_admin.o: m_admin.c ../include/client.h ../include/ircd_defs.h \ + ../include/dbuf.h ../include/ircd_handler.h ../include/ircd_reply.h \ + ../include/msg.h ../include/numeric.h ../include/numnicks.h \ + ../include/s_conf.h ../include/s_user.h +m_away.o: m_away.c ../include/client.h ../include/ircd_defs.h \ + ../include/dbuf.h ../include/ircd_handler.h ../include/ircd.h \ ../config/config.h ../config/setup.h ../include/struct.h \ ../include/ircd_reply.h ../include/ircd_string.h \ ../include/ircd_chattr.h ../include/msg.h ../include/numeric.h \ @@ -427,21 +428,21 @@ m_burst.o: m_burst.c ../include/channel.h ../config/config.h \ ../include/msg.h ../include/numeric.h ../include/numnicks.h \ ../include/s_conf.h ../include/s_misc.h ../include/send.h \ ../include/support.h -m_clearmode.o: m_clearmode.c ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h ../include/channel.h \ - ../config/config.h ../config/setup.h ../include/hash.h \ - ../include/ircd.h ../include/struct.h ../include/ircd_alloc.h \ - ../include/fda.h ../include/ircd_reply.h ../include/ircd_string.h \ - ../include/ircd_chattr.h ../include/list.h ../include/msg.h \ - ../include/numeric.h ../include/numnicks.h ../include/send.h \ - ../include/support.h -m_close.o: m_close.c ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h ../include/ircd.h \ +m_clearmode.o: m_clearmode.c ../include/client.h \ + ../include/ircd_defs.h ../include/dbuf.h ../include/ircd_handler.h \ + ../include/channel.h ../config/config.h ../config/setup.h \ + ../include/hash.h ../include/ircd.h ../include/struct.h \ + ../include/ircd_alloc.h ../include/fda.h ../include/ircd_reply.h \ + ../include/ircd_string.h ../include/ircd_chattr.h ../include/list.h \ + ../include/msg.h ../include/numeric.h ../include/numnicks.h \ + ../include/send.h ../include/support.h +m_close.o: m_close.c ../include/client.h ../include/ircd_defs.h \ + ../include/dbuf.h ../include/ircd_handler.h ../include/ircd.h \ ../config/config.h ../config/setup.h ../include/struct.h \ ../include/ircd_reply.h ../include/numeric.h ../include/s_bsd.h \ ../include/send.h -m_connect.o: m_connect.c ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h ../include/crule.h \ +m_connect.o: m_connect.c ../include/client.h ../include/ircd_defs.h \ + ../include/dbuf.h ../include/ircd_handler.h ../include/crule.h \ ../include/hash.h ../include/ircd.h ../config/config.h \ ../config/setup.h ../include/struct.h ../include/ircd_log.h \ ../include/ircd_reply.h ../include/ircd_string.h \ @@ -449,10 +450,10 @@ m_connect.o: m_connect.c ../include/client.h ../include/dbuf.h \ ../include/msg.h ../include/numeric.h ../include/numnicks.h \ ../include/s_bsd.h ../include/s_conf.h ../include/s_user.h \ ../include/send.h -m_cprivmsg.o: m_cprivmsg.c ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h \ - ../include/ircd_reply.h ../include/ircd_string.h ../config/config.h \ - ../config/setup.h ../include/ircd_chattr.h ../include/s_user.h +m_cprivmsg.o: m_cprivmsg.c ../include/client.h ../include/ircd_defs.h \ + ../include/dbuf.h ../include/ircd_handler.h ../include/ircd_reply.h \ + ../include/ircd_string.h ../config/config.h ../config/setup.h \ + ../include/ircd_chattr.h ../include/s_user.h m_create.o: m_create.c ../include/channel.h ../config/config.h \ ../config/setup.h ../include/ircd_defs.h ../include/client.h \ ../include/dbuf.h ../include/ircd_handler.h ../include/hash.h \ @@ -460,26 +461,26 @@ m_create.o: m_create.c ../include/channel.h ../config/config.h \ ../include/ircd_string.h ../include/ircd_chattr.h ../include/msg.h \ ../include/numeric.h ../include/numnicks.h ../include/s_debug.h \ ../include/send.h -m_defaults.o: m_defaults.c ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h ../include/ircd.h \ +m_defaults.o: m_defaults.c ../include/client.h ../include/ircd_defs.h \ + ../include/dbuf.h ../include/ircd_handler.h ../include/ircd.h \ ../config/config.h ../config/setup.h ../include/struct.h \ ../include/ircd_reply.h ../include/numeric.h ../include/numnicks.h \ ../include/send.h ../include/supported.h ../include/channel.h \ ../include/version.h -m_destruct.o: m_destruct.c ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h ../include/hash.h \ +m_destruct.o: m_destruct.c ../include/client.h ../include/ircd_defs.h \ + ../include/dbuf.h ../include/ircd_handler.h ../include/hash.h \ ../include/ircd.h ../config/config.h ../config/setup.h \ ../include/struct.h ../include/ircd_reply.h ../include/ircd_string.h \ ../include/ircd_chattr.h ../include/msg.h ../include/numeric.h \ ../include/numnicks.h ../include/send.h -m_desynch.o: m_desynch.c ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h ../include/hash.h \ +m_desynch.o: m_desynch.c ../include/client.h ../include/ircd_defs.h \ + ../include/dbuf.h ../include/ircd_handler.h ../include/hash.h \ ../include/ircd.h ../config/config.h ../config/setup.h \ ../include/struct.h ../include/ircd_reply.h ../include/ircd_string.h \ ../include/ircd_chattr.h ../include/msg.h ../include/numeric.h \ ../include/numnicks.h ../include/s_bsd.h ../include/send.h -m_die.o: m_die.c ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h ../include/ircd.h \ +m_die.o: m_die.c ../include/client.h ../include/ircd_defs.h \ + ../include/dbuf.h ../include/ircd_handler.h ../include/ircd.h \ ../config/config.h ../config/setup.h ../include/struct.h \ ../include/ircd_reply.h ../include/ircd_string.h \ ../include/ircd_chattr.h ../include/msg.h ../include/numeric.h \ @@ -490,29 +491,29 @@ m_endburst.o: m_endburst.c ../include/channel.h ../config/config.h \ ../include/ircd.h ../include/struct.h ../include/ircd_reply.h \ ../include/ircd_string.h ../include/ircd_chattr.h ../include/msg.h \ ../include/numeric.h ../include/numnicks.h ../include/send.h -m_error.o: m_error.c ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h ../include/hash.h \ +m_error.o: m_error.c ../include/client.h ../include/ircd_defs.h \ + ../include/dbuf.h ../include/ircd_handler.h ../include/hash.h \ ../include/ircd.h ../config/config.h ../config/setup.h \ ../include/struct.h ../include/ircd_alloc.h ../include/fda.h \ ../include/ircd_reply.h ../include/ircd_string.h \ ../include/ircd_chattr.h ../include/numeric.h ../include/numnicks.h \ ../include/s_debug.h ../include/s_misc.h ../include/send.h -m_gline.o: m_gline.c ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h ../include/gline.h \ +m_gline.o: m_gline.c ../include/client.h ../include/ircd_defs.h \ + ../include/dbuf.h ../include/ircd_handler.h ../include/gline.h \ ../config/config.h ../config/setup.h ../include/hash.h \ ../include/ircd.h ../include/struct.h ../include/ircd_reply.h \ ../include/ircd_string.h ../include/ircd_chattr.h ../include/match.h \ ../include/msg.h ../include/numeric.h ../include/numnicks.h \ ../include/s_conf.h ../include/s_misc.h ../include/send.h \ ../include/support.h -m_help.o: m_help.c ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h ../include/hash.h \ +m_help.o: m_help.c ../include/client.h ../include/ircd_defs.h \ + ../include/dbuf.h ../include/ircd_handler.h ../include/hash.h \ ../include/ircd.h ../config/config.h ../config/setup.h \ ../include/struct.h ../include/ircd_reply.h ../include/ircd_string.h \ ../include/ircd_chattr.h ../include/msg.h ../include/numeric.h \ ../include/numnicks.h ../include/send.h -m_info.o: m_info.c ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h ../include/ircd.h \ +m_info.o: m_info.c ../include/client.h ../include/ircd_defs.h \ + ../include/dbuf.h ../include/ircd_handler.h ../include/ircd.h \ ../config/config.h ../config/setup.h ../include/struct.h \ ../include/ircd_reply.h ../include/ircd_string.h \ ../include/ircd_chattr.h ../include/msg.h ../include/numeric.h \ @@ -525,8 +526,8 @@ m_invite.o: m_invite.c ../include/channel.h ../config/config.h \ ../include/ircd_string.h ../include/ircd_chattr.h ../include/list.h \ ../include/msg.h ../include/numeric.h ../include/numnicks.h \ ../include/s_user.h ../include/send.h -m_ison.o: m_ison.c ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h ../include/hash.h \ +m_ison.o: m_ison.c ../include/client.h ../include/ircd_defs.h \ + ../include/dbuf.h ../include/ircd_handler.h ../include/hash.h \ ../include/ircd.h ../config/config.h ../config/setup.h \ ../include/struct.h ../include/ircd_reply.h ../include/ircd_string.h \ ../include/ircd_chattr.h ../include/numeric.h ../include/send.h @@ -538,8 +539,8 @@ m_join.o: m_join.c ../include/channel.h ../config/config.h \ ../include/ircd_string.h ../include/msg.h ../include/numeric.h \ ../include/numnicks.h ../include/s_debug.h ../include/s_user.h \ ../include/send.h ../include/handlers.h -m_jupe.o: m_jupe.c ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h ../include/jupe.h \ +m_jupe.o: m_jupe.c ../include/client.h ../include/ircd_defs.h \ + ../include/dbuf.h ../include/ircd_handler.h ../include/jupe.h \ ../config/config.h ../config/setup.h ../include/hash.h \ ../include/ircd.h ../include/struct.h ../include/ircd_reply.h \ ../include/ircd_string.h ../include/ircd_chattr.h ../include/match.h \ @@ -552,15 +553,15 @@ m_kick.o: m_kick.c ../include/channel.h ../config/config.h \ ../include/ircd.h ../include/struct.h ../include/ircd_reply.h \ ../include/ircd_string.h ../include/ircd_chattr.h ../include/msg.h \ ../include/numeric.h ../include/numnicks.h ../include/send.h -m_kill.o: m_kill.c ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h ../include/hash.h \ +m_kill.o: m_kill.c ../include/client.h ../include/ircd_defs.h \ + ../include/dbuf.h ../include/ircd_handler.h ../include/hash.h \ ../include/ircd.h ../config/config.h ../config/setup.h \ ../include/struct.h ../include/ircd_log.h ../include/ircd_reply.h \ ../include/ircd_string.h ../include/ircd_chattr.h ../include/msg.h \ ../include/numeric.h ../include/numnicks.h ../include/s_misc.h \ ../include/send.h ../include/whowas.h -m_links.o: m_links.c ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h ../include/ircd.h \ +m_links.o: m_links.c ../include/client.h ../include/ircd_defs.h \ + ../include/dbuf.h ../include/ircd_handler.h ../include/ircd.h \ ../config/config.h ../config/setup.h ../include/struct.h \ ../include/ircd_reply.h ../include/ircd_string.h \ ../include/ircd_chattr.h ../include/match.h ../include/msg.h \ @@ -573,15 +574,15 @@ m_list.o: m_list.c ../include/channel.h ../config/config.h \ ../include/fda.h ../include/ircd_chattr.h ../include/ircd_reply.h \ ../include/ircd_string.h ../include/msg.h ../include/numeric.h \ ../include/numnicks.h ../include/send.h -m_lusers.o: m_lusers.c ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h ../include/ircd.h \ +m_lusers.o: m_lusers.c ../include/client.h ../include/ircd_defs.h \ + ../include/dbuf.h ../include/ircd_handler.h ../include/ircd.h \ ../config/config.h ../config/setup.h ../include/struct.h \ ../include/ircd_reply.h ../include/ircd_string.h \ ../include/ircd_chattr.h ../include/msg.h ../include/numeric.h \ ../include/numnicks.h ../include/querycmds.h ../include/s_user.h \ ../include/s_serv.h ../include/send.h -m_map.o: m_map.c ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h ../include/ircd.h \ +m_map.o: m_map.c ../include/client.h ../include/ircd_defs.h \ + ../include/dbuf.h ../include/ircd_handler.h ../include/ircd.h \ ../config/config.h ../config/setup.h ../include/struct.h \ ../include/ircd_reply.h ../include/ircd_string.h \ ../include/ircd_chattr.h ../include/map.h ../include/numeric.h \ @@ -594,8 +595,8 @@ m_mode.o: m_mode.c ../include/handlers.h ../include/channel.h \ ../include/ircd_chattr.h ../include/msg.h ../include/numeric.h \ ../include/numnicks.h ../include/s_conf.h ../include/s_debug.h \ ../include/s_user.h ../include/send.h -m_motd.o: m_motd.c ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h ../include/ircd.h \ +m_motd.o: m_motd.c ../include/client.h ../include/ircd_defs.h \ + ../include/dbuf.h ../include/ircd_handler.h ../include/ircd.h \ ../config/config.h ../config/setup.h ../include/struct.h \ ../include/ircd_reply.h ../include/ircd_string.h \ ../include/ircd_chattr.h ../include/match.h ../include/msg.h \ @@ -609,28 +610,29 @@ m_names.o: m_names.c ../include/channel.h ../config/config.h \ ../include/numeric.h ../include/numnicks.h ../include/s_user.h \ ../include/send.h m_nick.o: m_nick.c ../include/IPcheck.h ../include/client.h \ - ../include/dbuf.h ../include/ircd_defs.h ../include/ircd_handler.h \ + ../include/ircd_defs.h ../include/dbuf.h ../include/ircd_handler.h \ ../include/hash.h ../include/ircd.h ../config/config.h \ ../config/setup.h ../include/struct.h ../include/ircd_chattr.h \ ../include/ircd_reply.h ../include/ircd_string.h ../include/msg.h \ ../include/numeric.h ../include/numnicks.h ../include/s_debug.h \ ../include/s_misc.h ../include/s_user.h ../include/send.h -m_notice.o: m_notice.c ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h \ - ../include/ircd_chattr.h ../include/ircd_relay.h \ - ../include/ircd_reply.h ../include/ircd_string.h ../config/config.h \ - ../config/setup.h ../include/match.h ../include/msg.h \ - ../include/numeric.h ../include/send.h ../include/handlers.h -m_oper.o: m_oper.c ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h ../include/hash.h \ +m_notice.o: m_notice.c ../include/client.h ../include/ircd_defs.h \ + ../include/dbuf.h ../include/ircd_handler.h ../include/ircd_chattr.h \ + ../include/ircd_relay.h ../include/ircd_reply.h \ + ../include/ircd_string.h ../config/config.h ../config/setup.h \ + ../include/match.h ../include/msg.h ../include/numeric.h \ + ../include/send.h ../include/handlers.h +m_oper.o: m_oper.c ../include/client.h ../include/ircd_defs.h \ + ../include/dbuf.h ../include/ircd_handler.h ../include/hash.h \ ../include/ircd.h ../config/config.h ../config/setup.h \ ../include/struct.h ../include/ircd_log.h ../include/ircd_reply.h \ ../include/ircd_string.h ../include/ircd_chattr.h \ ../include/ircd_xopen.h ../include/msg.h ../include/numeric.h \ ../include/numnicks.h ../include/querycmds.h ../include/s_conf.h \ - ../include/s_debug.h ../include/s_user.h ../include/send.h -m_opmode.o: m_opmode.c ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h ../include/channel.h \ + ../include/s_debug.h ../include/s_user.h ../include/s_misc.h \ + ../include/send.h ../include/support.h +m_opmode.o: m_opmode.c ../include/client.h ../include/ircd_defs.h \ + ../include/dbuf.h ../include/ircd_handler.h ../include/channel.h \ ../config/config.h ../config/setup.h ../include/hash.h \ ../include/ircd.h ../include/struct.h ../include/ircd_reply.h \ ../include/ircd_string.h ../include/ircd_chattr.h ../include/msg.h \ @@ -641,30 +643,30 @@ m_part.o: m_part.c ../include/channel.h ../config/config.h \ ../include/ircd.h ../include/struct.h ../include/ircd_reply.h \ ../include/ircd_string.h ../include/ircd_chattr.h \ ../include/numeric.h ../include/numnicks.h ../include/send.h -m_pass.o: m_pass.c ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h \ - ../include/ircd_reply.h ../include/ircd_string.h ../config/config.h \ - ../config/setup.h ../include/ircd_chattr.h ../include/send.h -m_ping.o: m_ping.c ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h ../include/hash.h \ +m_pass.o: m_pass.c ../include/client.h ../include/ircd_defs.h \ + ../include/dbuf.h ../include/ircd_handler.h ../include/ircd_reply.h \ + ../include/ircd_string.h ../config/config.h ../config/setup.h \ + ../include/ircd_chattr.h ../include/send.h +m_ping.o: m_ping.c ../include/client.h ../include/ircd_defs.h \ + ../include/dbuf.h ../include/ircd_handler.h ../include/hash.h \ ../include/ircd_reply.h ../include/ircd_string.h ../config/config.h \ ../config/setup.h ../include/ircd_chattr.h ../include/ircd.h \ ../include/struct.h ../include/msg.h ../include/numeric.h \ ../include/numnicks.h ../include/s_debug.h ../include/send.h -m_pong.o: m_pong.c ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h ../include/hash.h \ +m_pong.o: m_pong.c ../include/client.h ../include/ircd_defs.h \ + ../include/dbuf.h ../include/ircd_handler.h ../include/hash.h \ ../include/ircd.h ../config/config.h ../config/setup.h \ ../include/struct.h ../include/ircd_reply.h ../include/ircd_string.h \ ../include/ircd_chattr.h ../include/msg.h ../include/numeric.h \ ../include/numnicks.h ../include/s_user.h ../include/send.h -m_privmsg.o: m_privmsg.c ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h ../include/ircd.h \ +m_privmsg.o: m_privmsg.c ../include/client.h ../include/ircd_defs.h \ + ../include/dbuf.h ../include/ircd_handler.h ../include/ircd.h \ ../config/config.h ../config/setup.h ../include/struct.h \ ../include/ircd_chattr.h ../include/ircd_relay.h \ ../include/ircd_reply.h ../include/ircd_string.h ../include/match.h \ ../include/msg.h ../include/numeric.h ../include/send.h -m_proto.o: m_proto.c ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h ../include/ircd.h \ +m_proto.o: m_proto.c ../include/client.h ../include/ircd_defs.h \ + ../include/dbuf.h ../include/ircd_handler.h ../include/ircd.h \ ../config/config.h ../config/setup.h ../include/struct.h \ ../include/ircd_alloc.h ../include/fda.h ../include/ircd_chattr.h \ ../include/ircd_reply.h ../include/ircd_string.h ../include/numeric.h \ @@ -675,43 +677,43 @@ m_quit.o: m_quit.c ../include/channel.h ../config/config.h \ ../config/setup.h ../include/ircd_defs.h ../include/client.h \ ../include/dbuf.h ../include/ircd_handler.h ../include/ircd_string.h \ ../include/ircd_chattr.h ../include/struct.h ../include/s_misc.h -m_rehash.o: m_rehash.c ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h ../include/ircd.h \ +m_rehash.o: m_rehash.c ../include/client.h ../include/ircd_defs.h \ + ../include/dbuf.h ../include/ircd_handler.h ../include/ircd.h \ ../config/config.h ../config/setup.h ../include/struct.h \ ../include/ircd_log.h ../include/ircd_reply.h \ ../include/ircd_string.h ../include/ircd_chattr.h \ ../include/numeric.h ../include/s_conf.h ../include/send.h -m_restart.o: m_restart.c ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h ../include/ircd.h \ +m_restart.o: m_restart.c ../include/client.h ../include/ircd_defs.h \ + ../include/dbuf.h ../include/ircd_handler.h ../include/ircd.h \ ../config/config.h ../config/setup.h ../include/struct.h \ ../include/ircd_log.h ../include/ircd_reply.h \ ../include/ircd_string.h ../include/ircd_chattr.h \ ../include/numeric.h ../include/numnicks.h ../include/send.h -m_rping.o: m_rping.c ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h ../include/hash.h \ +m_rping.o: m_rping.c ../include/client.h ../include/ircd_defs.h \ + ../include/dbuf.h ../include/ircd_handler.h ../include/hash.h \ ../include/ircd.h ../config/config.h ../config/setup.h \ ../include/struct.h ../include/ircd_reply.h ../include/ircd_string.h \ ../include/ircd_chattr.h ../include/msg.h ../include/numeric.h \ ../include/numnicks.h ../include/opercmds.h ../include/s_user.h \ ../include/send.h -m_rpong.o: m_rpong.c ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h ../include/hash.h \ +m_rpong.o: m_rpong.c ../include/client.h ../include/ircd_defs.h \ + ../include/dbuf.h ../include/ircd_handler.h ../include/hash.h \ ../include/ircd.h ../config/config.h ../config/setup.h \ ../include/struct.h ../include/ircd_reply.h ../include/ircd_string.h \ ../include/ircd_chattr.h ../include/msg.h ../include/numeric.h \ ../include/numnicks.h ../include/opercmds.h ../include/send.h -m_server.o: m_server.c ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h ../include/crule.h \ - ../include/hash.h ../include/ircd.h ../config/config.h \ - ../config/setup.h ../include/struct.h ../include/ircd_log.h \ - ../include/ircd_reply.h ../include/ircd_string.h \ - ../include/ircd_chattr.h ../include/jupe.h ../include/list.h \ - ../include/match.h ../include/msg.h ../include/numeric.h \ - ../include/numnicks.h ../include/querycmds.h ../include/s_bsd.h \ - ../include/s_conf.h ../include/s_debug.h ../include/s_misc.h \ - ../include/s_serv.h ../include/send.h ../include/userload.h -m_settime.o: m_settime.c ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h ../include/hash.h \ +m_server.o: m_server.c ../include/client.h ../include/ircd_defs.h \ + ../include/dbuf.h ../include/ircd_handler.h ../include/hash.h \ + ../include/ircd.h ../config/config.h ../config/setup.h \ + ../include/struct.h ../include/ircd_log.h ../include/ircd_reply.h \ + ../include/ircd_string.h ../include/ircd_chattr.h ../include/jupe.h \ + ../include/list.h ../include/match.h ../include/msg.h \ + ../include/numeric.h ../include/numnicks.h ../include/querycmds.h \ + ../include/s_bsd.h ../include/s_conf.h ../include/s_debug.h \ + ../include/s_misc.h ../include/s_serv.h ../include/send.h \ + ../include/userload.h +m_settime.o: m_settime.c ../include/client.h ../include/ircd_defs.h \ + ../include/dbuf.h ../include/ircd_handler.h ../include/hash.h \ ../include/ircd.h ../config/config.h ../config/setup.h \ ../include/struct.h ../include/ircd_reply.h ../include/ircd_string.h \ ../include/ircd_chattr.h ../include/list.h ../include/msg.h \ @@ -724,8 +726,8 @@ m_silence.o: m_silence.c ../include/channel.h ../config/config.h \ ../include/ircd_string.h ../include/ircd_chattr.h ../include/list.h \ ../include/msg.h ../include/numeric.h ../include/numnicks.h \ ../include/s_user.h ../include/send.h -m_squit.o: m_squit.c ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h ../include/hash.h \ +m_squit.o: m_squit.c ../include/client.h ../include/ircd_defs.h \ + ../include/dbuf.h ../include/ircd_handler.h ../include/hash.h \ ../include/ircd.h ../config/config.h ../config/setup.h \ ../include/struct.h ../include/ircd_chattr.h ../include/ircd_reply.h \ ../include/ircd_string.h ../include/numeric.h ../include/numnicks.h \ @@ -743,8 +745,8 @@ m_stats.o: m_stats.c ../include/s_stats.h ../include/channel.h \ ../include/s_conf.h ../include/s_debug.h ../include/s_misc.h \ ../include/s_serv.h ../include/s_user.h ../include/send.h \ ../include/userload.h -m_time.o: m_time.c ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h ../include/ircd.h \ +m_time.o: m_time.c ../include/client.h ../include/ircd_defs.h \ + ../include/dbuf.h ../include/ircd_handler.h ../include/ircd.h \ ../config/config.h ../config/setup.h ../include/struct.h \ ../include/ircd_reply.h ../include/ircd_string.h \ ../include/ircd_chattr.h ../include/msg.h ../include/numeric.h \ @@ -757,39 +759,39 @@ m_topic.o: m_topic.c ../include/channel.h ../config/config.h \ ../include/ircd_string.h ../include/ircd_chattr.h ../include/msg.h \ ../include/numeric.h ../include/numnicks.h ../include/send.h m_trace.o: m_trace.c ../include/class.h ../include/client.h \ - ../include/dbuf.h ../include/ircd_defs.h ../include/ircd_handler.h \ + ../include/ircd_defs.h ../include/dbuf.h ../include/ircd_handler.h \ ../include/hash.h ../include/ircd.h ../config/config.h \ ../config/setup.h ../include/struct.h ../include/ircd_reply.h \ ../include/ircd_string.h ../include/ircd_chattr.h ../include/match.h \ ../include/msg.h ../include/numeric.h ../include/numnicks.h \ ../include/s_bsd.h ../include/s_conf.h ../include/s_user.h \ ../include/send.h ../include/version.h -m_uping.o: m_uping.c ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h ../include/hash.h \ +m_uping.o: m_uping.c ../include/client.h ../include/ircd_defs.h \ + ../include/dbuf.h ../include/ircd_handler.h ../include/hash.h \ ../include/ircd.h ../config/config.h ../config/setup.h \ ../include/struct.h ../include/ircd_reply.h ../include/ircd_string.h \ ../include/ircd_chattr.h ../include/match.h ../include/msg.h \ ../include/numeric.h ../include/numnicks.h ../include/s_conf.h \ ../include/s_user.h ../include/send.h ../include/uping.h -m_user.o: m_user.c ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h ../include/ircd.h \ +m_user.o: m_user.c ../include/client.h ../include/ircd_defs.h \ + ../include/dbuf.h ../include/ircd_handler.h ../include/ircd.h \ ../config/config.h ../config/setup.h ../include/struct.h \ ../include/ircd_chattr.h ../include/ircd_reply.h \ ../include/ircd_string.h ../include/numeric.h ../include/numnicks.h \ ../include/s_debug.h ../include/s_misc.h ../include/s_user.h \ ../include/send.h -m_userhost.o: m_userhost.c ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h \ - ../include/ircd_reply.h ../include/ircd_string.h ../config/config.h \ - ../config/setup.h ../include/ircd_chattr.h ../include/numeric.h \ - ../include/s_user.h ../include/struct.h -m_userip.o: m_userip.c ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h \ - ../include/ircd_reply.h ../include/ircd_string.h ../config/config.h \ - ../config/setup.h ../include/ircd_chattr.h ../include/numeric.h \ - ../include/s_user.h ../include/struct.h -m_version.o: m_version.c ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h ../include/hash.h \ +m_userhost.o: m_userhost.c ../include/client.h ../include/ircd_defs.h \ + ../include/dbuf.h ../include/ircd_handler.h ../include/ircd_reply.h \ + ../include/ircd_string.h ../config/config.h ../config/setup.h \ + ../include/ircd_chattr.h ../include/numeric.h ../include/s_user.h \ + ../include/struct.h +m_userip.o: m_userip.c ../include/client.h ../include/ircd_defs.h \ + ../include/dbuf.h ../include/ircd_handler.h ../include/ircd_reply.h \ + ../include/ircd_string.h ../config/config.h ../config/setup.h \ + ../include/ircd_chattr.h ../include/numeric.h ../include/s_user.h \ + ../include/struct.h +m_version.o: m_version.c ../include/client.h ../include/ircd_defs.h \ + ../include/dbuf.h ../include/ircd_handler.h ../include/hash.h \ ../include/ircd.h ../config/config.h ../config/setup.h \ ../include/struct.h ../include/ircd_reply.h ../include/ircd_string.h \ ../include/ircd_chattr.h ../include/msg.h ../include/numeric.h \ @@ -803,11 +805,11 @@ m_wallchops.o: m_wallchops.c ../include/channel.h ../config/config.h \ ../include/ircd_string.h ../include/ircd_chattr.h ../include/msg.h \ ../include/numeric.h ../include/numnicks.h ../include/s_user.h \ ../include/send.h -m_wallops.o: m_wallops.c ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h \ - ../include/ircd_reply.h ../include/ircd_string.h ../config/config.h \ - ../config/setup.h ../include/ircd_chattr.h ../include/msg.h \ - ../include/numeric.h ../include/send.h +m_wallops.o: m_wallops.c ../include/client.h ../include/ircd_defs.h \ + ../include/dbuf.h ../include/ircd_handler.h ../include/ircd_reply.h \ + ../include/ircd_string.h ../config/config.h ../config/setup.h \ + ../include/ircd_chattr.h ../include/msg.h ../include/numeric.h \ + ../include/send.h m_who.o: m_who.c ../include/channel.h ../config/config.h \ ../config/setup.h ../include/ircd_defs.h ../include/client.h \ ../include/dbuf.h ../include/ircd_handler.h ../include/hash.h \ @@ -823,41 +825,41 @@ m_whois.o: m_whois.c ../include/channel.h ../config/config.h \ ../include/ircd_string.h ../include/ircd_chattr.h ../include/match.h \ ../include/msg.h ../include/numeric.h ../include/numnicks.h \ ../include/s_user.h ../include/send.h ../include/whocmds.h -m_whowas.o: m_whowas.c ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h ../include/hash.h \ +m_whowas.o: m_whowas.c ../include/client.h ../include/ircd_defs.h \ + ../include/dbuf.h ../include/ircd_handler.h ../include/hash.h \ ../include/ircd.h ../config/config.h ../config/setup.h \ ../include/struct.h ../include/ircd_reply.h ../include/ircd_string.h \ ../include/ircd_chattr.h ../include/msg.h ../include/numeric.h \ ../include/numnicks.h ../include/s_user.h ../include/s_misc.h \ ../include/send.h ../include/whowas.h -map.o: map.c ../include/map.h ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h ../include/ircd.h \ - ../config/config.h ../config/setup.h ../include/struct.h \ - ../include/ircd_reply.h ../include/list.h ../include/match.h \ - ../include/numeric.h ../include/numnicks.h ../include/querycmds.h \ - ../include/send.h +map.o: map.c ../include/map.h ../include/client.h \ + ../include/ircd_defs.h ../include/dbuf.h ../include/ircd_handler.h \ + ../include/ircd.h ../config/config.h ../config/setup.h \ + ../include/struct.h ../include/ircd_reply.h ../include/list.h \ + ../include/match.h ../include/numeric.h ../include/numnicks.h \ + ../include/querycmds.h ../include/send.h match.o: match.c ../include/match.h ../include/ircd_chattr.h numnicks.o: numnicks.c ../include/numnicks.h ../include/client.h \ - ../include/dbuf.h ../include/ircd_defs.h ../include/ircd_handler.h \ + ../include/ircd_defs.h ../include/dbuf.h ../include/ircd_handler.h \ ../include/ircd.h ../config/config.h ../config/setup.h \ ../include/struct.h ../include/ircd_alloc.h ../include/fda.h \ ../include/ircd_string.h ../include/ircd_chattr.h ../include/match.h \ ../include/s_bsd.h ../include/s_debug.h ../include/s_misc.h opercmds.o: opercmds.c ../include/opercmds.h ../include/class.h \ - ../include/client.h ../include/dbuf.h ../include/ircd_defs.h \ - ../include/ircd_handler.h ../include/crule.h ../include/ircd.h \ - ../config/config.h ../config/setup.h ../include/struct.h \ - ../include/ircd_chattr.h ../include/ircd_reply.h \ - ../include/ircd_string.h ../include/listener.h ../include/match.h \ - ../include/msg.h ../include/numeric.h ../include/numnicks.h \ - ../include/s_conf.h ../include/send.h + ../include/client.h ../include/ircd_defs.h ../include/dbuf.h \ + ../include/ircd_handler.h ../include/ircd.h ../config/config.h \ + ../config/setup.h ../include/struct.h ../include/ircd_chattr.h \ + ../include/ircd_reply.h ../include/ircd_string.h \ + ../include/listener.h ../include/match.h ../include/msg.h \ + ../include/numeric.h ../include/numnicks.h ../include/s_conf.h \ + ../include/send.h packet.o: packet.c ../include/packet.h ../include/client.h \ - ../include/dbuf.h ../include/ircd_defs.h ../include/ircd_handler.h \ + ../include/ircd_defs.h ../include/dbuf.h ../include/ircd_handler.h \ ../include/ircd.h ../config/config.h ../config/setup.h \ ../include/struct.h ../include/ircd_chattr.h ../include/parse.h \ ../include/s_bsd.h ../include/s_misc.h ../include/send.h parse.o: parse.c ../include/parse.h ../include/client.h \ - ../include/dbuf.h ../include/ircd_defs.h ../include/ircd_handler.h \ + ../include/ircd_defs.h ../include/dbuf.h ../include/ircd_handler.h \ ../include/channel.h ../config/config.h ../config/setup.h \ ../include/handlers.h ../include/hash.h ../include/ircd.h \ ../include/struct.h ../include/ircd_alloc.h ../include/fda.h \ @@ -871,18 +873,18 @@ parse.o: parse.c ../include/parse.h ../include/client.h \ querycmds.o: querycmds.c ../include/querycmds.h random.o: random.c ../include/random.h ../config/config.h \ ../config/setup.h -res.o: res.c ../include/res.h ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h ../include/ircd.h \ - ../config/config.h ../config/setup.h ../include/struct.h \ - ../include/ircd_alloc.h ../include/fda.h ../include/ircd_log.h \ - ../include/ircd_osdep.h ../include/ircd_reply.h \ +res.o: res.c ../include/res.h ../include/client.h \ + ../include/ircd_defs.h ../include/dbuf.h ../include/ircd_handler.h \ + ../include/ircd.h ../config/config.h ../config/setup.h \ + ../include/struct.h ../include/ircd_alloc.h ../include/fda.h \ + ../include/ircd_log.h ../include/ircd_osdep.h ../include/ircd_reply.h \ ../include/ircd_string.h ../include/ircd_chattr.h ../include/msg.h \ ../include/numeric.h ../include/s_bsd.h ../include/s_debug.h \ ../include/s_misc.h ../include/send.h ../include/sprintf_irc.h \ ../include/support.h ../include/sys.h s_auth.o: s_auth.c ../include/s_auth.h ../config/config.h \ - ../config/setup.h ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h ../include/IPcheck.h \ + ../config/setup.h ../include/client.h ../include/ircd_defs.h \ + ../include/dbuf.h ../include/ircd_handler.h ../include/IPcheck.h \ ../include/ircd.h ../include/struct.h ../include/ircd_alloc.h \ ../include/fda.h ../include/ircd_chattr.h ../include/ircd_log.h \ ../include/ircd_osdep.h ../include/ircd_string.h ../include/list.h \ @@ -890,8 +892,8 @@ s_auth.o: s_auth.c ../include/s_auth.h ../config/config.h \ ../include/s_bsd.h ../include/s_debug.h ../include/s_misc.h \ ../include/send.h ../include/sprintf_irc.h ../include/sys.h s_bsd.o: s_bsd.c ../include/s_bsd.h ../config/config.h \ - ../config/setup.h ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h ../include/IPcheck.h \ + ../config/setup.h ../include/client.h ../include/ircd_defs.h \ + ../include/dbuf.h ../include/ircd_handler.h ../include/IPcheck.h \ ../include/channel.h ../include/class.h ../include/hash.h \ ../include/ircd_log.h ../include/ircd_osdep.h ../include/ircd_reply.h \ ../include/ircd_string.h ../include/ircd_chattr.h ../include/ircd.h \ @@ -903,8 +905,8 @@ s_bsd.o: s_bsd.c ../include/s_bsd.h ../config/config.h \ ../include/send.h ../include/sprintf_irc.h ../include/support.h \ ../include/sys.h ../include/uping.h ../include/version.h s_conf.o: s_conf.c ../include/s_conf.h ../include/IPcheck.h \ - ../include/class.h ../include/client.h ../include/dbuf.h \ - ../include/ircd_defs.h ../include/ircd_handler.h ../include/crule.h \ + ../include/class.h ../include/client.h ../include/ircd_defs.h \ + ../include/dbuf.h ../include/ircd_handler.h ../include/crule.h \ ../include/fileio.h ../include/gline.h ../config/config.h \ ../config/setup.h ../include/hash.h ../include/ircd.h \ ../include/struct.h ../include/ircd_alloc.h ../include/fda.h \ @@ -949,25 +951,24 @@ s_numeric.o: s_numeric.c ../include/s_numeric.h ../include/channel.h \ s_serv.o: s_serv.c ../include/s_serv.h ../include/IPcheck.h \ ../include/channel.h ../config/config.h ../config/setup.h \ ../include/ircd_defs.h ../include/client.h ../include/dbuf.h \ - ../include/ircd_handler.h ../include/crule.h ../include/gline.h \ - ../include/hash.h ../include/ircd.h ../include/struct.h \ - ../include/ircd_alloc.h ../include/fda.h ../include/ircd_reply.h \ - ../include/ircd_string.h ../include/ircd_chattr.h \ - ../include/ircd_snprintf.h ../include/ircd_xopen.h ../include/jupe.h \ - ../include/list.h ../include/msg.h ../include/match.h \ - ../include/numeric.h ../include/numnicks.h ../include/parse.h \ - ../include/querycmds.h ../include/s_bsd.h ../include/s_conf.h \ - ../include/s_debug.h ../include/s_misc.h ../include/s_user.h \ - ../include/send.h ../include/sprintf_irc.h ../include/sys.h \ - ../include/userload.h + ../include/ircd_handler.h ../include/gline.h ../include/hash.h \ + ../include/ircd.h ../include/struct.h ../include/ircd_alloc.h \ + ../include/fda.h ../include/ircd_reply.h ../include/ircd_string.h \ + ../include/ircd_chattr.h ../include/ircd_snprintf.h \ + ../include/ircd_xopen.h ../include/jupe.h ../include/list.h \ + ../include/msg.h ../include/match.h ../include/numeric.h \ + ../include/numnicks.h ../include/parse.h ../include/querycmds.h \ + ../include/s_bsd.h ../include/s_conf.h ../include/s_debug.h \ + ../include/s_misc.h ../include/s_user.h ../include/send.h \ + ../include/sprintf_irc.h ../include/sys.h ../include/userload.h s_stats.o: s_stats.c ../include/s_stats.h ../include/class.h \ - ../include/client.h ../include/dbuf.h ../include/ircd_defs.h \ - ../include/ircd_handler.h ../include/crule.h ../include/ircd.h \ - ../config/config.h ../config/setup.h ../include/struct.h \ - ../include/ircd_chattr.h ../include/ircd_reply.h \ - ../include/ircd_string.h ../include/listener.h ../include/match.h \ - ../include/msg.h ../include/numeric.h ../include/numnicks.h \ - ../include/s_conf.h ../include/s_user.h ../include/send.h + ../include/client.h ../include/ircd_defs.h ../include/dbuf.h \ + ../include/ircd_handler.h ../include/ircd.h ../config/config.h \ + ../config/setup.h ../include/struct.h ../include/ircd_chattr.h \ + ../include/ircd_reply.h ../include/ircd_string.h \ + ../include/listener.h ../include/match.h ../include/msg.h \ + ../include/numeric.h ../include/numnicks.h ../include/s_conf.h \ + ../include/s_user.h ../include/send.h s_user.o: s_user.c ../include/s_user.h ../include/IPcheck.h \ ../include/channel.h ../config/config.h ../config/setup.h \ ../include/ircd_defs.h ../include/class.h ../include/client.h \ @@ -1010,7 +1011,7 @@ uping.o: uping.c ../include/uping.h ../include/ircd_defs.h \ ../include/s_misc.h ../include/s_user.h ../include/send.h \ ../include/sys.h userload.o: userload.c ../include/userload.h ../include/client.h \ - ../include/dbuf.h ../include/ircd_defs.h ../include/ircd_handler.h \ + ../include/ircd_defs.h ../include/dbuf.h ../include/ircd_handler.h \ ../include/ircd.h ../config/config.h ../config/setup.h \ ../include/struct.h ../include/msg.h ../include/numnicks.h \ ../include/querycmds.h ../include/s_misc.h ../include/send.h \ @@ -1028,7 +1029,7 @@ whocmds.o: whocmds.c ../include/whocmds.h ../config/config.h \ ../include/userload.h ../include/version.h ../include/whowas.h \ ../include/msg.h whowas.o: whowas.c ../include/whowas.h ../include/client.h \ - ../include/dbuf.h ../include/ircd_defs.h ../include/ircd_handler.h \ + ../include/ircd_defs.h ../include/dbuf.h ../include/ircd_handler.h \ ../include/ircd.h ../config/config.h ../config/setup.h \ ../include/struct.h ../include/ircd_alloc.h ../include/fda.h \ ../include/ircd_chattr.h ../include/ircd_string.h ../include/list.h \ diff --git a/ircd/channel.c b/ircd/channel.c index c785dc3..1c544bc 100644 --- a/ircd/channel.c +++ b/ircd/channel.c @@ -97,7 +97,7 @@ struct Membership* find_member_link(struct Channel* chptr, const struct Client* assert(0 != chptr); /* Servers don't have member links */ - if (IsServer(cptr)) + if (IsServer(cptr)||IsMe(cptr)) return 0; /* +k users are typically on a LOT of channels. So we iterate over who diff --git a/ircd/ircd.c b/ircd/ircd.c index 1745f99..fc45159 100644 --- a/ircd/ircd.c +++ b/ircd/ircd.c @@ -20,7 +20,6 @@ * $Id$ */ #include "ircd.h" - #include "IPcheck.h" #include "class.h" #include "client.h" @@ -482,7 +481,7 @@ static void event_loop(void) { /* timeout pending queries that haven't been responded to */ timeout_auth_queries(CurrentTime); - ip_registry_expire(); + IPcheck_expire(); if (GlobalRehashFlag) { rehash(&me, 1); @@ -494,7 +493,6 @@ static void event_loop(void) { } } - /*---------------------------------------------------------------------------- * check_file_access: random helper function to make sure that a file is * accessible in a certain way, and complain if not. @@ -666,6 +664,7 @@ int main(int argc, char **argv) { } uping_init(); + read_tlines(); rmotd = read_motd(RPATH); diff --git a/ircd/ircd_string.c b/ircd/ircd_string.c index bc4c9c4..4976e13 100644 --- a/ircd/ircd_string.c +++ b/ircd/ircd_string.c @@ -182,7 +182,7 @@ NTL_HDR_strChattr { NTL_SRC_strChattr } NTL_HDR_strCasediff { NTL_SRC_strCasediff } #endif /* !FORCEINLINE */ -/*============================================================================= +/* * Other functions visible externally */ diff --git a/ircd/list.c b/ircd/list.c index aaee361..58df1b7 100644 --- a/ircd/list.c +++ b/ircd/list.c @@ -23,7 +23,6 @@ #include "class.h" #include "client.h" -#include "IPcheck.h" #include "ircd.h" #include "ircd_alloc.h" #include "ircd_reply.h" @@ -182,7 +181,6 @@ void free_client(struct Client* cptr) if (cptr->dns_reply) --cptr->dns_reply->ref_count; if (-1 < cptr->fd) { - ip_registry_local_disconnect(cptr); close(cptr->fd); } DBufClear(&cptr->sendQ); diff --git a/ircd/m_names.c b/ircd/m_names.c index 90fe894..072b567 100644 --- a/ircd/m_names.c +++ b/ircd/m_names.c @@ -183,8 +183,8 @@ void do_names(struct Client* sptr, struct Channel* chptr, int filter) flag = 1; if (mlen + idx + NICKLEN + 5 > BUFSIZE) /* space, modifier, nick, \r \n \0 */ - { - send_reply(sptr, RPL_NAMREPLY, buf); + { + sendto_one(sptr, rpl_str(RPL_NAMREPLY), me.name, sptr->name, buf); strcpy(buf, "* "); ircd_strncpy(buf + 2, chptr->chname, len + 1); buf[len + 2] = 0; @@ -218,16 +218,17 @@ int m_names(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) char* s; char* para = parc > 1 ? parv[1] : 0; - if (parc > 2 && hunt_server_cmd(sptr, CMD_NAMES, cptr, 1, "%s %C", 2, parc, - parv)) + if (parc > 2 && hunt_server_cmd(sptr, CMD_NAMES, cptr, 1, "%s %C", 2, parc, parv)) return 0; - if (EmptyString(para)) + if (EmptyString(para)) { + send_reply(sptr, RPL_ENDOFNAMES, "*"); return 0; + } else if (*para == '0') *para = '\0'; - s = strchr(para, ','); /* Recursively call m_names for each comma-seperated channel. */ + s = strchr(para, ','); /* Recursively call m_names for each comma-seperated channel. Eww. */ if (s) { parv[1] = ++s; m_names(cptr, sptr, parc, parv); @@ -326,7 +327,6 @@ int m_names(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) send_reply(sptr, RPL_ENDOFNAMES, chptr ? chptr->chname : para); return 1; } - } else { @@ -361,12 +361,13 @@ int ms_names(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) char* s; char* para = parc > 1 ? parv[1] : 0; - if (parc > 2 && hunt_server_cmd(sptr, CMD_NAMES, cptr, 1, "%s %C", 2, parc, - parv)) + if (parc > 2 && hunt_server_cmd(sptr, CMD_NAMES, cptr, 1, "%s %C", 2, parc, parv)) return 0; - if (EmptyString(para)) + if (EmptyString(para)) { + send_reply(sptr, RPL_ENDOFNAMES, "*"); return 0; + } else if (*para == '0') *para = '\0'; diff --git a/ircd/m_nick.c b/ircd/m_nick.c index aa38882..2f5eda7 100644 --- a/ircd/m_nick.c +++ b/ircd/m_nick.c @@ -217,6 +217,7 @@ int m_nick(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) */ if (IsUnknown(acptr) && MyConnect(acptr)) { ++ServerStats->is_ref; + IPcheck_connect_fail(acptr->ip); exit_client(cptr, acptr, &me, "Overridden by other sign on"); return set_nick_name(cptr, sptr, nick, parc, parv); } @@ -382,6 +383,7 @@ int ms_nick(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) */ if (IsUnknown(acptr) && MyConnect(acptr)) { ++ServerStats->is_ref; + IPcheck_connect_fail(acptr->ip); exit_client(cptr, acptr, &me, "Overridden by other sign on"); return set_nick_name(cptr, sptr, nick, parc, parv); } @@ -674,6 +676,7 @@ int m_nick(struct Client *cptr, struct Client *sptr, int parc, char *parv[]) if (IsUnknown(acptr) && MyConnect(acptr)) { ++ServerStats->is_ref; + IPcheck_connect_fail(acptr->ip); exit_client(cptr, acptr, &me, "Overridden by other sign on"); return set_nick_name(cptr, sptr, nick, parc, parv); } diff --git a/ircd/numnicks.c b/ircd/numnicks.c index 33fda6a..93053f4 100644 --- a/ircd/numnicks.c +++ b/ircd/numnicks.c @@ -56,9 +56,9 @@ */ /* - * when n2k comes, define this for more capacity + * Lets have *LOTS* of connections... */ -#undef EXTENDED_NUMERICS +#define EXTENDED_NUMERICS /* These must be the same on ALL servers ! Do not change ! */ diff --git a/ircd/parse.c b/ircd/parse.c index 2a4287b..b2c7657 100644 --- a/ircd/parse.c +++ b/ircd/parse.c @@ -532,6 +532,19 @@ struct Message msgtab[] = { /* UNREG, CLIENT, SERVER, OPER, SERVICE */ { m_proto, m_proto, m_proto, m_proto, m_ignore } }, + /* This command is an alias for QUIT during the unregistered part of + * of the server. This is because someone jumping via a broken web + * proxy will send a 'POST' as their first command - which we will + * obviously disconnect them immediately for, stopping people abusing + * open gateways + */ + { + MSG_POST, + TOK_POST, + 0, MAXPARA, MFLG_SLOW, 0, + /* UNREG, CLIENT, SERVER, OPER, SERVICE */ + { m_quit, m_ignore, m_ignore, m_ignore, m_ignore } + }, { 0 } }; diff --git a/ircd/s_auth.c b/ircd/s_auth.c index 46ed91f..d5d84ec 100644 --- a/ircd/s_auth.c +++ b/ircd/s_auth.c @@ -177,6 +177,7 @@ static void auth_kill_client(struct AuthRequest* auth) if (IsDNSPending(auth)) delete_resolver_queries(auth); + IPcheck_disconnect(auth->client); Count_unknowndisconnects(UserStats); free_client(auth->client); free_auth_request(auth); @@ -539,7 +540,7 @@ void start_auth(struct Client* client) ++client->dns_reply->ref_count; ircd_strncpy(client->sockhost, client->dns_reply->hp->h_name, HOSTLEN); if (IsUserPort(auth->client)) - sendheader(client, REPORT_FIN_DNSC); + sendheader(client, REPORT_FIN_DNSC); } else SetDNSPending(auth); diff --git a/ircd/s_bsd.c b/ircd/s_bsd.c index 64a251f..cda4eb7 100644 --- a/ircd/s_bsd.c +++ b/ircd/s_bsd.c @@ -151,6 +151,7 @@ void report_error(const char* text, const char* who, int err) static time_t last_notice = 0; int errtmp = errno; /* debug may change 'errno' */ const char* errmsg = (err) ? strerror(err) : ""; + if (!errmsg) errmsg = "Unknown error"; @@ -185,7 +186,7 @@ static void connect_dns_callback(void* vptr, struct DNSReply* reply) } else sendto_opmask_butone(0, SNO_OLDSNO, "Connect to %s failed: host lookup", - aconf->name); + aconf->name); } /* @@ -403,7 +404,7 @@ static int completed_connection(struct Client* cptr) if (!msg) msg = "Unknown error"; sendto_opmask_butone(0, SNO_OLDSNO, "Connection failed to %s: %s", - cptr->name, msg); + cptr->name, msg); return 0; } if (!(aconf = find_conf_byname(cptr->confs, cptr->name, CONF_SERVER))) { @@ -440,8 +441,8 @@ static int completed_connection(struct Client* cptr) cptr->flags |= FLAGS_PINGSENT; sendrawto_one(cptr, MSG_SERVER " %s 1 %Tu %Tu J%s %s%s :%s", - me.name, me.serv->timestamp, newts, MAJOR_PROTOCOL, - NumServCap(&me), me.info); + me.name, me.serv->timestamp, newts, MAJOR_PROTOCOL, + NumServCap(&me), me.info); return (IsDead(cptr)) ? 0 : 1; } @@ -510,7 +511,6 @@ void close_connection(struct Client *cptr) if (-1 < cptr->fd) { flush_connections(cptr); - ip_registry_local_disconnect(cptr); LocalClientArray[cptr->fd] = 0; close(cptr->fd); cptr->fd = -1; @@ -588,15 +588,15 @@ void add_connection(struct Listener* listener, int fd) { * * If they're throttled, murder them, but tell them why first. */ - if ( !ip_registry_check_local(addr.sin_addr.s_addr,&next_target) ) { - ++ServerStats->is_ref; - write(fd,throttle_message,strlen(throttle_message)); - close(fd); - return; + if (!IPcheck_local_connect(addr.sin_addr, &next_target) && !listener->server) { + ++ServerStats->is_ref; + write(fd, throttle_message, strlen(throttle_message)); + close(fd); + return; } new_client = make_client(0, ((listener->server) ? - STAT_UNKNOWN_SERVER : STAT_UNKNOWN_USER)); + STAT_UNKNOWN_SERVER : STAT_UNKNOWN_USER)); /* * Copy ascii address to 'sockhost' just in case. Then we have something @@ -615,7 +615,6 @@ void add_connection(struct Listener* listener, int fd) { ++listener->ref_count; Count_newunknown(UserStats); - ip_registry_connect_succeeded(new_client); /* if we've made it this far we can put the client on the auth query pile */ start_auth(new_client); } @@ -1061,8 +1060,7 @@ int read_message(time_t delay) const char* msg = (cptr->error) ? strerror(cptr->error) : "EOF from client"; if (!msg) msg = "Unknown error"; - exit_client_msg(cptr, cptr, &me, "Read error: %s", - msg); + exit_client_msg(cptr, cptr, &me, "Read error: %s", msg); } } return 0; @@ -1275,8 +1273,7 @@ int read_message(time_t delay) const char* msg = (cptr->error) ? strerror(cptr->error) : "EOF from client"; if (!msg) msg = "Unknown error"; - exit_client_msg(cptr, cptr, &me, "Read error: %s", - msg); + exit_client_msg(cptr, cptr, &me, "Read error: %s", msg); } } return 0; @@ -1305,7 +1302,7 @@ int connect_server(struct ConfItem* aconf, struct Client* by, if (aconf->dns_pending) { sendto_opmask_butone(0, SNO_OLDSNO, "Server %s connect DNS pending", - aconf->name); + aconf->name); return 0; } Debug((DEBUG_NOTICE, "Connect to %s[@%s]", aconf->name, @@ -1314,17 +1311,17 @@ int connect_server(struct ConfItem* aconf, struct Client* by, if ((cptr = FindClient(aconf->name))) { if (IsServer(cptr) || IsMe(cptr)) { sendto_opmask_butone(0, SNO_OLDSNO, "Server %s already present from %s", - aconf->name, cptr->from->name); + aconf->name, cptr->from->name); if (by && IsUser(by) && !MyUser(by)) { - sendcmdto_one(&me, CMD_NOTICE, by, "%C :Server %s already present " - "from %s", by, aconf->name, cptr->from->name); + sendcmdto_one(&me, CMD_NOTICE, by, "%C :Server %s already present " + "from %s", by, aconf->name, cptr->from->name); } return 0; } else if (IsHandshake(cptr) || IsConnecting(cptr)) { if (by && IsUser(by)) { - sendcmdto_one(&me, CMD_NOTICE, by, "%C :Connection to %s already in " - "progress", by, cptr->name); + sendcmdto_one(&me, CMD_NOTICE, by, "%C :Connection to %s already in " + "progress", by, cptr->name); } return 0; } @@ -1372,10 +1369,10 @@ int connect_server(struct ConfItem* aconf, struct Client* by, if (!find_conf_byhost(cptr->confs, aconf->host, CONF_SERVER)) { sendto_opmask_butone(0, SNO_OLDSNO, "Host %s is not enabled for " - "connecting: no C-line", aconf->name); + "connecting: no C-line", aconf->name); if (by && IsUser(by) && !MyUser(by)) { sendcmdto_one(&me, CMD_NOTICE, by, "%C :Connect to host %s failed: no " - "C-line", by, aconf->name); + "C-line", by, aconf->name); } det_confs_butmask(cptr, 0); free_client(cptr); @@ -1387,7 +1384,7 @@ int connect_server(struct ConfItem* aconf, struct Client* by, if (!connect_inet(aconf, cptr)) { if (by && IsUser(by) && !MyUser(by)) { sendcmdto_one(&me, CMD_NOTICE, by, "%C :Couldn't connect to %s", by, - cptr->name); + cptr->name); } det_confs_butmask(cptr, 0); free_client(cptr); @@ -1421,12 +1418,10 @@ int connect_server(struct ConfItem* aconf, struct Client* by, LocalClientArray[cptr->fd] = cptr; Count_newunknown(UserStats); - ip_registry_add_local(aconf->ipnum.s_addr); /* Actually we lie, the connect hasn't succeeded yet, but we have a valid * cptr, so we register it now. * Maybe these two calls should be merged. */ - ip_registry_connect_succeeded(cptr); add_client_to_list(cptr); hAddClient(cptr); nextping = CurrentTime; diff --git a/ircd/s_conf.c b/ircd/s_conf.c index 1f64ecc..8385689 100644 --- a/ircd/s_conf.c +++ b/ircd/s_conf.c @@ -325,7 +325,7 @@ check_limit_and_attach(struct Client* cptr, struct ConfItem* aconf) !aconf->passwd[2]) number = (*aconf->passwd-'0')*10+(aconf->passwd[1]-'0'); } - if (ip_registry_count(cptr->ip.s_addr) > number) + if (IPcheck_nr(cptr) > number) return ACR_TOO_MANY_FROM_IP; return attach_conf(cptr, aconf); } diff --git a/ircd/s_misc.c b/ircd/s_misc.c index 20e8a18..f905331 100644 --- a/ircd/s_misc.c +++ b/ircd/s_misc.c @@ -147,9 +147,7 @@ char *myctime(time_t value) * * Returns: * "name[user@ip#.port]" if 'showip' is true; - * "name[sockethost]", if name and sockhost are different and - * showip is false; else - * "name". + * "name" if 'showip' is false. * * NOTE 1: * Watch out the allocation of "nbuf", if either sptr->name @@ -169,12 +167,8 @@ const char* get_client_name(const struct Client* sptr, int showip) if (showip) sprintf_irc(nbuf, "%s[%s@%s]", sptr->name, (IsIdented(sptr)) ? sptr->username : "", sptr->sock_ip); - else { - if (0 != ircd_strcmp(sptr->name, sptr->sockhost)) - sprintf_irc(nbuf, "%s[%s]", sptr->name, sptr->sockhost); - else + else return sptr->name; - } return nbuf; } return sptr->name; @@ -256,7 +250,6 @@ static void exit_one_client(struct Client* bcptr, const char* comment) Count_clientdisconnects(bcptr, UserStats); else { Count_remoteclientquits(UserStats, bcptr); - ip_registry_remote_disconnect(bcptr); } } else if (IsServer(bcptr)) @@ -279,6 +272,11 @@ static void exit_one_client(struct Client* bcptr, const char* comment) else if (IsUnknown(bcptr) || IsConnecting(bcptr) || IsHandshake(bcptr)) Count_unknowndisconnects(UserStats); + /* + * Update IPregistry + */ + if (IsIPChecked(bcptr)) + IPcheck_disconnect(bcptr); /* * Remove from serv->client_list @@ -302,6 +300,7 @@ static void exit_one_client(struct Client* bcptr, const char* comment) #endif remove_client_from_list(bcptr); } + /* * exit_downlinks - added by Run 25-9-94 * diff --git a/ircd/s_serv.c b/ircd/s_serv.c index 9c85743..dab6bfb 100644 --- a/ircd/s_serv.c +++ b/ircd/s_serv.c @@ -80,7 +80,7 @@ int exit_new_server(struct Client* cptr, struct Client* sptr, #endif /* 0 */ int exit_new_server(struct Client *cptr, struct Client *sptr, const char *host, - time_t timestamp, const char *pattern, ...) + time_t timestamp, const char *pattern, ...) { struct VarData vd; int retval = 0; @@ -111,7 +111,7 @@ int a_kills_b_too(struct Client *a, struct Client *b) * and thus make_server was called, and serv->prot set. --Run */ int server_estab(struct Client *cptr, struct ConfItem *aconf, - struct Jupe *ajupe) + struct Jupe *ajupe) { struct Client* acptr = 0; const char* inpath; @@ -131,8 +131,14 @@ int server_estab(struct Client *cptr, struct ConfItem *aconf, * Pass my info to the new server */ sendrawto_one(cptr, MSG_SERVER " %s 1 %Tu %Tu J%s %s%s :%s", me.name, - me.serv->timestamp, cptr->serv->timestamp, MAJOR_PROTOCOL, - NumServCap(&me), *me.info ? me.info : "IRCers United"); + me.serv->timestamp, cptr->serv->timestamp, MAJOR_PROTOCOL, + NumServCap(&me), *me.info ? me.info : "IRCers United"); + /* + * Don't charge this IP# for connecting + * XXX - if this comes from a server port, it will not have been added + * to the IP check registry, see add_connection in s_bsd.c + */ + IPcheck_connect_fail(cptr->ip); } det_confs_butmask(cptr, CONF_LEAF | CONF_HUB | CONF_SERVER | CONF_UWORLD); @@ -157,7 +163,7 @@ int server_estab(struct Client *cptr, struct ConfItem *aconf, (acptr = findNUser(cptr->serv->by))) { if (acptr->user == cptr->serv->user) { sendcmdto_one(&me, CMD_NOTICE, acptr, "%C :Link with %s established.", - acptr, inpath); + acptr, inpath); } else { /* @@ -172,7 +178,7 @@ int server_estab(struct Client *cptr, struct ConfItem *aconf, cptr->serv->up = &me; cptr->serv->updown = add_dlink(&me.serv->down, cptr); sendto_opmask_butone(0, SNO_NETWORK, "Net junction: %s %s", me.name, - cptr->name); + cptr->name); SetJunction(cptr); /* * Old sendto_serv_but_one() call removed because we now @@ -188,14 +194,14 @@ int server_estab(struct Client *cptr, struct ConfItem *aconf, continue; if (ajupe) sendcmdto_one(&me, CMD_SERVER, acptr, - "%s 2 0 %Tu J%02u %s%s 0 %%%Tu :%s", cptr->name, - cptr->serv->timestamp, Protocol(cptr), NumServCap(cptr), - JupeLastMod(ajupe), cptr->info); + "%s 2 0 %Tu J%02u %s%s 0 %%%Tu :%s", cptr->name, + cptr->serv->timestamp, Protocol(cptr), NumServCap(cptr), + JupeLastMod(ajupe), cptr->info); else sendcmdto_one(&me, CMD_SERVER, acptr, - "%s 2 0 %Tu J%02u %s%s 0 :%s", cptr->name, - cptr->serv->timestamp, Protocol(cptr), NumServCap(cptr), - cptr->info); + "%s 2 0 %Tu J%02u %s%s 0 :%s", cptr->name, + cptr->serv->timestamp, Protocol(cptr), NumServCap(cptr), + cptr->info); } /* @@ -231,17 +237,17 @@ int server_estab(struct Client *cptr, struct ConfItem *aconf, 0 != ircd_strcmp(acptr->name, acptr->sockhost) && 0 != ircd_strncmp(acptr->info, "JUPE", 4)); if ((ajupe = jupe_find(acptr->name)) && !JupeIsLocal(ajupe)) - sendcmdto_one(acptr->serv->up, CMD_SERVER, cptr, - "%s %d 0 %Tu %s%u %s%s 0 %%%Tu :%s", acptr->name, - acptr->hopcount + 1, acptr->serv->timestamp, - protocol_str, Protocol(acptr), NumServCap(acptr), - JupeLastMod(ajupe), acptr->info); + sendcmdto_one(acptr->serv->up, CMD_SERVER, cptr, + "%s %d 0 %Tu %s%u %s%s 0 %%%Tu :%s", acptr->name, + acptr->hopcount + 1, acptr->serv->timestamp, + protocol_str, Protocol(acptr), NumServCap(acptr), + JupeLastMod(ajupe), acptr->info); else - sendcmdto_one(acptr->serv->up, CMD_SERVER, cptr, - "%s %d 0 %Tu %s%u %s%s 0 :%s", acptr->name, - acptr->hopcount + 1, acptr->serv->timestamp, - protocol_str, Protocol(acptr), NumServCap(acptr), - acptr->info); + sendcmdto_one(acptr->serv->up, CMD_SERVER, cptr, + "%s %d 0 %Tu %s%u %s%s 0 :%s", acptr->name, + acptr->hopcount + 1, acptr->serv->timestamp, + protocol_str, Protocol(acptr), NumServCap(acptr), + acptr->info); } } @@ -256,23 +262,23 @@ int server_estab(struct Client *cptr, struct ConfItem *aconf, char *s = umode_str(acptr); struct Gline *agline = 0; if ((agline = gline_lookup(acptr, GLINE_GLOBAL | GLINE_LASTMOD))) - sendcmdto_one(acptr->user->server, CMD_NICK, cptr, - "%s %d %Tu %s %s %s%s%s%%%Tu:%s@%s %s %s%s :%s", - acptr->name, acptr->hopcount + 1, acptr->lastnick, - acptr->user->username, acptr->user->host, - *s ? "+" : "", s, *s ? " " : "", - GlineLastMod(agline), GlineUser(agline), - GlineHost(agline), - inttobase64(xxx_buf, ntohl(acptr->ip.s_addr), 6), - NumNick(acptr), acptr->info); + sendcmdto_one(acptr->user->server, CMD_NICK, cptr, + "%s %d %Tu %s %s %s%s%s%%%Tu:%s@%s %s %s%s :%s", + acptr->name, acptr->hopcount + 1, acptr->lastnick, + acptr->user->username, acptr->user->host, + *s ? "+" : "", s, *s ? " " : "", + GlineLastMod(agline), GlineUser(agline), + GlineHost(agline), + inttobase64(xxx_buf, ntohl(acptr->ip.s_addr), 6), + NumNick(acptr), acptr->info); else - sendcmdto_one(acptr->user->server, CMD_NICK, cptr, - "%s %d %Tu %s %s %s%s%s%s %s%s :%s", - acptr->name, acptr->hopcount + 1, acptr->lastnick, - acptr->user->username, acptr->user->host, - *s ? "+" : "", s, *s ? " " : "", - inttobase64(xxx_buf, ntohl(acptr->ip.s_addr), 6), - NumNick(acptr), acptr->info); + sendcmdto_one(acptr->user->server, CMD_NICK, cptr, + "%s %d %Tu %s %s %s%s%s%s %s%s :%s", + acptr->name, acptr->hopcount + 1, acptr->lastnick, + acptr->user->username, acptr->user->host, + *s ? "+" : "", s, *s ? " " : "", + inttobase64(xxx_buf, ntohl(acptr->ip.s_addr), 6), + NumNick(acptr), acptr->info); } } /* diff --git a/ircd/s_user.c b/ircd/s_user.c index 813cf0f..f3222ec 100644 --- a/ircd/s_user.c +++ b/ircd/s_user.c @@ -238,8 +238,11 @@ int hunt_server(int MustBeOper, struct Client *cptr, struct Client *sptr, char * { /* Make sure it's a server */ if (!strchr(parv[server], '*')) { - if (0 == (acptr = FindClient(parv[server]))) + if (0 == (acptr = FindClient(parv[server]))) { + sendto_one(sptr, err_str(ERR_NOSUCHSERVER), + me.name, parv[0], parv[server]); return HUNTED_NOSUCH; + } if (acptr->user) acptr = acptr->user->server; } @@ -273,8 +276,8 @@ int hunt_server(int MustBeOper, struct Client *cptr, struct Client *sptr, char * } int hunt_server_cmd(struct Client *from, const char *cmd, const char *tok, - struct Client *one, int MustBeOper, const char *pattern, - int server, int parc, char *parv[]) + struct Client *one, int MustBeOper, const char *pattern, + int server, int parc, char *parv[]) { struct Client *acptr; char *to; @@ -312,7 +315,7 @@ int hunt_server_cmd(struct Client *from, const char *cmd, const char *tok, parv[server] = (char *) acptr; /* HACK! HACK! HACK! ARGH! */ sendcmdto_one(from, cmd, tok, acptr, pattern, parv[1], parv[2], parv[3], - parv[4], parv[5], parv[6], parv[7], parv[8]); + parv[4], parv[5], parv[6], parv[7], parv[8]); return (HUNTED_PASS); } @@ -443,37 +446,39 @@ int register_user(struct Client *cptr, struct Client *sptr, break; case ACR_NO_AUTHORIZATION: sendto_opmask_butone(0, SNO_UNAUTH, "Unauthorized connection from %s.", - get_client_name(sptr, HIDE_IP)); + get_client_name(sptr, HIDE_IP)); ++ServerStats->is_ref; return exit_client(cptr, sptr, &me, - "No Authorization - use another server"); + "No Authorization - use another server"); case ACR_TOO_MANY_IN_CLASS: if (CurrentTime - last_too_many1 >= (time_t) 60) { last_too_many1 = CurrentTime; sendto_opmask_butone(0, SNO_TOOMANY, "Too many connections in " - "class for %s.", - get_client_name(sptr, HIDE_IP)); + "class for %s.", + get_client_name(sptr, HIDE_IP)); } ++ServerStats->is_ref; + IPcheck_connect_fail(sptr->ip); return exit_client(cptr, sptr, &me, - "Sorry, your connection class is full - try " - "again later or try another server"); + "Sorry, your connection class is full - try " + "again later or try another server"); case ACR_TOO_MANY_FROM_IP: if (CurrentTime - last_too_many2 >= (time_t) 60) { last_too_many2 = CurrentTime; sendto_opmask_butone(0, SNO_TOOMANY, "Too many connections from " - "same IP for %s.", - get_client_name(sptr, HIDE_IP)); + "same IP for %s.", + get_client_name(sptr, HIDE_IP)); } ++ServerStats->is_ref; return exit_client(cptr, sptr, &me, - "Too many connections from your host"); + "Too many connections from your host"); case ACR_ALREADY_AUTHORIZED: /* Can this ever happen? */ case ACR_BAD_SOCKET: ++ServerStats->is_ref; + IPcheck_connect_fail(sptr->ip); return exit_client(cptr, sptr, &me, "Unknown error -- Try again"); } ircd_strncpy(user->host, sptr->sockhost, HOSTLEN); @@ -492,6 +497,7 @@ int register_user(struct Client *cptr, struct Client *sptr, && strcmp(sptr->passwd, aconf->passwd)) { ServerStats->is_ref++; + IPcheck_connect_fail(sptr->ip); send_reply(sptr, ERR_PASSWDMISMATCH); return exit_client(cptr, sptr, &me, "Bad Password"); } @@ -501,6 +507,7 @@ int register_user(struct Client *cptr, struct Client *sptr, */ if (find_kill(sptr)) { ServerStats->is_ref++; + IPcheck_connect_fail(sptr->ip); return exit_client(cptr, sptr, &me, "K-lined"); } /* @@ -573,12 +580,12 @@ int register_user(struct Client *cptr, struct Client *sptr, ServerStats->is_ref++; send_reply(cptr, SND_EXPLICIT | ERR_INVALIDUSERNAME, - ":Your username is invalid."); + ":Your username is invalid."); send_reply(cptr, SND_EXPLICIT | ERR_INVALIDUSERNAME, - ":Connect with your real username, in lowercase."); + ":Connect with your real username, in lowercase."); send_reply(cptr, SND_EXPLICIT | ERR_INVALIDUSERNAME, - ":If your mail address were foo@bar.com, your username " - "would be foo."); + ":If your mail address were foo@bar.com, your username " + "would be foo."); return exit_client(cptr, sptr, &me, "USER: Bad username"); } Count_unknownbecomesclient(sptr, UserStats); @@ -625,6 +632,7 @@ int register_user(struct Client *cptr, struct Client *sptr, nextping = CurrentTime; if (sptr->snomask & SNO_NOISY) set_snomask(sptr, sptr->snomask & SNO_NOISY, SNO_ADD); + IPcheck_connect_succeeded(sptr); } else /* if (IsServer(cptr)) */ @@ -635,8 +643,8 @@ int register_user(struct Client *cptr, struct Client *sptr, if (acptr->from != sptr->from) { sendcmdto_one(&me, CMD_KILL, cptr, "%C :%s (%s != %s[%s])", - sptr, me.name, user->server->name, acptr->from->name, - acptr->from->sockhost); + sptr, me.name, user->server->name, acptr->from->name, + acptr->from->sockhost); sptr->flags |= FLAGS_KILLED; return exit_client(cptr, sptr, &me, "NICK server wrong direction"); } @@ -653,26 +661,34 @@ int register_user(struct Client *cptr, struct Client *sptr, if (IsBurst(acptr) || Protocol(acptr) < 10) break; } + if (!IPcheck_remote_connect(sptr, (acptr != &me))) { + /* + * We ran out of bits to count this + */ + sendcmdto_one(&me, CMD_KILL, sptr, "%C :%s (Too many connections from your host -- Ghost)", + sptr, me.name); + return exit_client(cptr, sptr, &me,"Too many connections from your host -- throttled"); + } } tmpstr = umode_str(sptr); if (agline) sendcmdto_serv_butone(user->server, CMD_NICK, cptr, - "%s %d %Tu %s %s %s%s%s%%%Tu:%s@%s %s %s%s :%s", - nick, sptr->hopcount + 1, sptr->lastnick, - user->username, user->host, - *tmpstr ? "+" : "", tmpstr, *tmpstr ? " " : "", - GlineLastMod(agline), GlineUser(agline), - GlineHost(agline), - inttobase64(ip_base64, ntohl(sptr->ip.s_addr), 6), - NumNick(sptr), sptr->info); + "%s %d %Tu %s %s %s%s%s%%%Tu:%s@%s %s %s%s :%s", + nick, sptr->hopcount + 1, sptr->lastnick, + user->username, user->host, + *tmpstr ? "+" : "", tmpstr, *tmpstr ? " " : "", + GlineLastMod(agline), GlineUser(agline), + GlineHost(agline), + inttobase64(ip_base64, ntohl(sptr->ip.s_addr), 6), + NumNick(sptr), sptr->info); else sendcmdto_serv_butone(user->server, CMD_NICK, cptr, - "%s %d %Tu %s %s %s%s%s%s %s%s :%s", - nick, sptr->hopcount + 1, sptr->lastnick, - user->username, user->host, - *tmpstr ? "+" : "", tmpstr, *tmpstr ? " " : "", - inttobase64(ip_base64, ntohl(sptr->ip.s_addr), 6), - NumNick(sptr), sptr->info); + "%s %d %Tu %s %s %s%s%s%s %s%s :%s", + nick, sptr->hopcount + 1, sptr->lastnick, + user->username, user->host, + *tmpstr ? "+" : "", tmpstr, *tmpstr ? " " : "", + inttobase64(ip_base64, ntohl(sptr->ip.s_addr), 6), + NumNick(sptr), sptr->info); /* Send umode to client */ if (MyUser(sptr)) @@ -776,16 +792,10 @@ int set_nick_name(struct Client* cptr, struct Client* sptr, lastmod = atoi(parv[parc - 4] + 1); if (lastmod && - (agline = gline_find(t, GLINE_EXACT | GLINE_GLOBAL | GLINE_LASTMOD)) - && GlineLastMod(agline) > lastmod && !IsBurstOrBurstAck(cptr)) - gline_resend(cptr, agline); - } - if (!ip_registry_remote_connect(new_client)) { - sendcmdto_one(&me, CMD_KILL, new_client, "%C :%s (Too many connections from your host -- Ghost)", - new_client,me.name); - return exit_client(cptr,new_client,&me,"Too many connections from your host -- throttled"); + (agline = gline_find(t, GLINE_EXACT | GLINE_GLOBAL | GLINE_LASTMOD)) + && GlineLastMod(agline) > lastmod && !IsBurstOrBurstAck(cptr)) + gline_resend(cptr, agline); } - sendto_ops("Registering new remote client"); return register_user(cptr, new_client, new_client->name, parv[4], agline); } else if (sptr->name[0]) { @@ -799,7 +809,7 @@ int set_nick_name(struct Client* cptr, struct Client* sptr, if (MyUser(sptr)) { const char* channel_name; if ((channel_name = find_no_nickchange_channel(sptr))) { - return send_reply(cptr, ERR_BANNICKCHANGE, channel_name); + return send_reply(cptr, ERR_BANNICKCHANGE, channel_name); } /* * Refuse nick change if the last nick change was less @@ -811,10 +821,10 @@ int set_nick_name(struct Client* cptr, struct Client* sptr, */ if (CurrentTime < cptr->nextnick) { cptr->nextnick += 2; - send_reply(cptr, ERR_NICKTOOFAST, parv[1], - cptr->nextnick - CurrentTime); + send_reply(cptr, ERR_NICKTOOFAST, parv[1], + cptr->nextnick - CurrentTime); /* Send error message */ - sendcmdto_one(cptr, CMD_NICK, cptr, "%s", cptr->name); + sendcmdto_one(cptr, CMD_NICK, cptr, "%s", cptr->name); /* bounce NICK to user */ return 0; /* ignore nick change! */ } @@ -841,7 +851,7 @@ int set_nick_name(struct Client* cptr, struct Client* sptr, sendcmdto_common_channels(sptr, CMD_NICK, ":%s", nick); add_history(sptr, 1); sendcmdto_serv_butone(sptr, CMD_NICK, cptr, "%s %Tu", nick, - sptr->lastnick); + sptr->lastnick); } else sendcmdto_one(sptr, CMD_NICK, sptr, ":%s", nick); @@ -965,8 +975,8 @@ int check_target_limit(struct Client *sptr, void *target, const char *name, * No server flooding */ sptr->nexttarget += 2; - send_reply(sptr, ERR_TARGETTOOFAST, name, - sptr->nexttarget - CurrentTime); + send_reply(sptr, ERR_TARGETTOOFAST, name, + sptr->nexttarget - CurrentTime); } return 1; } @@ -1110,8 +1120,7 @@ void send_user_info(struct Client* sptr, char* names, int rpl, InfoFormatter fmt if (5 == ++arg_count) break; } - if (users_found) - send_buffer(sptr, buf); + send_buffer(sptr, buf); } @@ -1150,8 +1159,8 @@ int set_user_mode(struct Client *cptr, struct Client *sptr, int parc, char *parv { if (IsServer(cptr)) sendcmdto_flag_butone(&me, CMD_WALLOPS, 0, FLAGS_WALLOP, - ":MODE for User %s from %s!%s", parv[1], - cptr->name, sptr->name); + ":MODE for User %s from %s!%s", parv[1], + cptr->name, sptr->name); else send_reply(sptr, ERR_USERSDONTMATCH); return 0; @@ -1531,8 +1540,8 @@ int is_silenced(struct Client *sptr, struct Client *acptr) { if (!MyConnect(sptr)) { - sendcmdto_one(acptr, CMD_SILENCE, sptr->from, "%C %s", sptr, - lp->value.cp); + sendcmdto_one(acptr, CMD_SILENCE, sptr->from, "%C %s", sptr, + lp->value.cp); } return 1; } @@ -1590,7 +1599,7 @@ int add_silence(struct Client* sptr, const char* mask) len += strlen(lp->value.cp); if ((len > MAXSILELENGTH) || (++cnt >= MAXSILES)) { - send_reply(sptr, ERR_SILELISTFULL, mask); + send_reply(sptr, ERR_SILELISTFULL, mask); return -1; } else if (!mmatch(lp->value.cp, mask)) diff --git a/ircd/table_gen.c b/ircd/table_gen.c index 44eaa7b..e5554f9 100644 --- a/ircd/table_gen.c +++ b/ircd/table_gen.c @@ -17,7 +17,7 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/*============================================================================= +/* * TABLE GENERATOR * The following part of code is NOT included in the actual server's * or library source, it's just used to build the above tables diff --git a/ircd/uping.c b/ircd/uping.c index ab90801..accc52d 100644 --- a/ircd/uping.c +++ b/ircd/uping.c @@ -173,7 +173,6 @@ static void uping_start(struct UPing* pptr) sendcmdto_one(&me, CMD_NOTICE, pptr->client, "%C :Sending %d ping%s to %s", pptr->client, pptr->count, (pptr->count == 1) ? "" : "s", pptr->name); - pptr->timeout = CurrentTime + UPINGTIMEOUT; pptr->active = 1; } -- 2.20.1