[IRC-Dev CVS] [CVS] Module ircd-ircdev: Change committed
Brought to you by:
zolty
From: Toni G. <zo...@us...> - 2005-04-28 22:00:31
|
CVSROOT : /cvsroot/irc-dev Module : ircd-ircdev Commit time: 2005-04-28 22:00:20 UTC Modified files: ChangeLog ChangeLog.es TODO.es include/ddb.h include/patchlevel.h include/s_conf.h ircd/ddb.c ircd/ddb_events.c ircd/ircd.c ircd/ircd_lexer.l ircd/ircd_parser.y ircd/m_invite.c ircd/m_map.c ircd/m_whowas.c ircd/s_conf.c ircd/s_err.c ircd/s_stats.c ircd/s_user.c tools/convert-conf.py Log message: Author: zoltan <zo...@ir...> Log message: 2005-04-29 Toni García <zo...@ir...> 1.0.alpha29 * Tabla i de ilines * Tabla z de Config * Cambios en map * Cambios en parser.y ---------------------- diff included ---------------------- Index: ircd-ircdev/ChangeLog diff -u ircd-ircdev/ChangeLog:1.30 ircd-ircdev/ChangeLog:1.31 --- ircd-ircdev/ChangeLog:1.30 Sun Apr 24 15:18:05 2005 +++ ircd-ircdev/ChangeLog Thu Apr 28 14:59:58 2005 @@ -1,10 +1,16 @@ # # ChangeLog for ircd-ircdev # -# $Id: ChangeLog,v 1.30 2005/04/24 22:18:05 zolty Exp $ +# $Id: ChangeLog,v 1.31 2005/04/28 21:59:58 zolty Exp $ # # Insert new changes at beginning of the change list. # +2005-04-29 Toni García <zo...@ir...> 1.0.alpha29 + * Table i (ilines) + * Table z (config) + * Map changes + * parser.y changes + 2005-04-25 Toni García <zo...@ir...> 1.0.alpha28 * Fix bugs Index: ircd-ircdev/ChangeLog.es diff -u ircd-ircdev/ChangeLog.es:1.30 ircd-ircdev/ChangeLog.es:1.31 --- ircd-ircdev/ChangeLog.es:1.30 Sun Apr 24 15:18:05 2005 +++ ircd-ircdev/ChangeLog.es Thu Apr 28 15:00:05 2005 @@ -1,10 +1,16 @@ # # Log de Cambios para ircd-ircdev # -# $Id: ChangeLog.es,v 1.30 2005/04/24 22:18:05 zolty Exp $ +# $Id: ChangeLog.es,v 1.31 2005/04/28 22:00:05 zolty Exp $ # # Insertar los nuevos cambios al principio de esta lista de cambios. # +2005-04-29 Toni García <zo...@ir...> 1.0.alpha29 + * Tabla i de ilines + * Tabla z de Config + * Cambios en map + * Cambios en parser.y + 2005-04-25 Toni García <zo...@ir...> 1.0.alpha28 * Fix de bugs Index: ircd-ircdev/TODO.es diff -u ircd-ircdev/TODO.es:1.20 ircd-ircdev/TODO.es:1.21 --- ircd-ircdev/TODO.es:1.20 Wed Apr 20 15:09:46 2005 +++ ircd-ircdev/TODO.es Thu Apr 28 15:00:05 2005 @@ -1,7 +1,7 @@ # # TODO para ircd-ircdev # -# $Id: TODO.es,v 1.20 2005/04/20 22:09:46 zolty Exp $ +# $Id: TODO.es,v 1.21 2005/04/28 22:00:05 zolty Exp $ # # Insertar las nuevas entradas al principio de la lista TODO. # @@ -68,6 +68,9 @@ actualmente deja X clones para cada IP de ese rango, deberia haber alguna forma de que sea por rango. +[18:11:32] <Tor> quote opmode torcum #opers,#lala +[18:11:38] <Tor> quote opmode #opers +nk lalala +[18:14:59] <Tor> burst de aways DOCUMENTACION PENDIENTE -------------------------------------------------------------------------------------- Index: ircd-ircdev/include/ddb.h diff -u ircd-ircdev/include/ddb.h:1.5 ircd-ircdev/include/ddb.h:1.6 --- ircd-ircdev/include/ddb.h:1.5 Thu Apr 14 03:28:06 2005 +++ ircd-ircdev/include/ddb.h Thu Apr 28 15:00:07 2005 @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: ddb.h,v 1.5 2005/04/14 10:28:06 zolty Exp $ + * $Id: ddb.h,v 1.6 2005/04/28 22:00:07 zolty Exp $ * */ #ifndef INCLUDED_ddb_h @@ -45,11 +45,15 @@ #define DDB_INIT 'a' /* First table */ #define DDB_CHANDB 'c' /* ChanDB table */ +#define DDB_ILINEDB 'i' /* IlineDB table */ #define DDB_NICKDB 'n' /* NickDB table */ - +#define DDB_CONFIGDB 'z' /* ConfigDB table */ #define DDB_END 'z' /* Last table */ +#define DDB_CONFIGDB_MAX_CLONES_PER_IP "maxclones" +#define DDB_CONFIGDB_MSG_TOO_MANY_FROM_IP "msgmanyperip" + /* * PseudoBots */ @@ -120,8 +124,8 @@ extern unsigned int ddb_resident_table[DDB_TABLE_MAX]; extern unsigned int ddb_count_table[DDB_TABLE_MAX]; extern unsigned int ddb_id_table[DDB_TABLE_MAX]; -typedef void (*ddb_events_table_t)(char *, char *, int); -extern ddb_events_table_t ddb_events_table[DDB_TABLE_MAX]; +typedef void (*ddb_events_table_td)(char *, char *, int); +extern ddb_events_table_td ddb_events_table[DDB_TABLE_MAX]; extern unsigned int ddb_hashtable_hi[DDB_TABLE_MAX]; extern unsigned int ddb_hashtable_lo[DDB_TABLE_MAX]; extern int ddb_hash_register(char *key, int hash_size); Index: ircd-ircdev/include/patchlevel.h diff -u ircd-ircdev/include/patchlevel.h:1.29 ircd-ircdev/include/patchlevel.h:1.30 --- ircd-ircdev/include/patchlevel.h:1.29 Sun Apr 24 15:18:05 2005 +++ ircd-ircdev/include/patchlevel.h Thu Apr 28 15:00:08 2005 @@ -17,10 +17,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: patchlevel.h,v 1.29 2005/04/24 22:18:05 zolty Exp $ + * $Id: patchlevel.h,v 1.30 2005/04/28 22:00:08 zolty Exp $ * */ -#define PATCHLEVEL ".alpha28" +#define PATCHLEVEL ".alpha29" #define RELEASE "1.0" Index: ircd-ircdev/include/s_conf.h diff -u ircd-ircdev/include/s_conf.h:1.11 ircd-ircdev/include/s_conf.h:1.12 --- ircd-ircdev/include/s_conf.h:1.11 Fri Apr 22 09:22:13 2005 +++ ircd-ircdev/include/s_conf.h Thu Apr 28 15:00:08 2005 @@ -21,7 +21,7 @@ */ /** @file s_conf.h * @brief ircd configuration file API. - * @version $Id: s_conf.h,v 1.11 2005/04/22 16:22:13 zolty Exp $ + * @version $Id: s_conf.h,v 1.12 2005/04/28 22:00:08 zolty Exp $ */ #ifndef INCLUDED_s_conf_h #define INCLUDED_s_conf_h @@ -54,6 +54,8 @@ #define CONF_OPERATOR 0x0020 /**< ConfItem describes an Operator block */ #define CONF_UWORLD 0x8000 /**< ConfItem describes a Uworld server */ +#define CONF_AUTOCONNECT 0x0001 /**< Autoconnect to a server */ + /** Indicates ConfItem types that count associated clients. */ #define CONF_CLIENT_MASK (CONF_CLIENT | CONF_OPERATOR | CONF_SERVER) @@ -85,6 +87,7 @@ time_t hold; /**< Earliest time to attempt an outbound connect on this ConfItem. */ int dns_pending; /**< A dns request is pending. */ + int flags; /**< Additional modifiers for item. */ int addrbits; /**< Number of bits valid in ConfItem::address. */ struct Privs privs; /**< Privileges for opers. */ /** Used to detect if a privilege has been set by this ConfItem. */ Index: ircd-ircdev/ircd/ddb.c diff -u ircd-ircdev/ircd/ddb.c:1.5 ircd-ircdev/ircd/ddb.c:1.6 --- ircd-ircdev/ircd/ddb.c:1.5 Thu Apr 14 03:28:06 2005 +++ ircd-ircdev/ircd/ddb.c Thu Apr 28 15:00:08 2005 @@ -21,7 +21,7 @@ */ /** @file * @brief Implementation of Distributed DataBase. - * @version $Id: ddb.c,v 1.5 2005/04/14 10:28:06 zolty Exp $ + * @version $Id: ddb.c,v 1.6 2005/04/28 22:00:08 zolty Exp $ */ #include "config.h" @@ -161,7 +161,9 @@ * y no deben ser superiores a HASHSIZE, ya que ello * solo desperdiciaria memoria. */ + ddb_resident_table[DDB_ILINEDB] = 256; ddb_resident_table[DDB_NICKDB] = 32768; + ddb_resident_table[DDB_CONFIGDB] = 256; for (table = DDB_INIT; table <= DDB_END; table++) ddb_table_init(table); @@ -230,7 +232,7 @@ strcpy(keytemp, key); while (keytemp[i]) { -/* keytemp[i] = toLower(keytemp[i]); */ +/* keytemp[i] = ToLower(keytemp[i]); */ i++; } @@ -272,7 +274,7 @@ /* while (c[i] != 0) { - k[i] = toLower(c[i]); + k[i] = ToLower(c[i]); i++; } */ @@ -520,7 +522,10 @@ { /* if (!strcmp(ddb->key, k)) */ if (!ircd_strcmp(ddb->key, k)) + { + assert(0 != ddb->content); return ddb; + } } return NULL; } @@ -559,7 +564,13 @@ char * ddb_get_botname(char *bot) { - return cli_name(&me); + struct Ddb *ddb; + + ddb = ddb_find_key(DDB_CONFIGDB, DDB_NICKSERV); + if (ddb) + return ddb->content; + else + return cli_name(&me); } Index: ircd-ircdev/ircd/ddb_events.c diff -u ircd-ircdev/ircd/ddb_events.c:1.1 ircd-ircdev/ircd/ddb_events.c:1.2 --- ircd-ircdev/ircd/ddb_events.c:1.1 Thu Apr 14 03:28:07 2005 +++ ircd-ircdev/ircd/ddb_events.c Thu Apr 28 15:00:08 2005 @@ -21,7 +21,7 @@ */ /** @file * @brief Events of Distributed DataBase. - * @version $Id: ddb_events.c,v 1.1 2005/04/14 10:28:07 zolty Exp $ + * @version $Id: ddb_events.c,v 1.2 2005/04/28 22:00:08 zolty Exp $ */ #include "config.h" @@ -41,8 +41,9 @@ static int events_init = 0; static void ddb_events_table_n(char *key, char *content, int update); +static void ddb_events_table_z(char *key, char *content, int update); -ddb_events_table_t ddb_events_table[DDB_TABLE_MAX]; +ddb_events_table_td ddb_events_table[DDB_TABLE_MAX]; void @@ -51,7 +52,9 @@ if (events_init) return; + ddb_events_table[DDB_ILINEDB] = 0; ddb_events_table[DDB_NICKDB] = ddb_events_table_n; + ddb_events_table[DDB_CONFIGDB] = ddb_events_table_z; events_init = 1; } @@ -174,3 +177,8 @@ } } } + +static void +ddb_events_table_z(char *key, char *content, int update) +{ +} Index: ircd-ircdev/ircd/ircd.c diff -u ircd-ircdev/ircd/ircd.c:1.16 ircd-ircdev/ircd/ircd.c:1.17 --- ircd-ircdev/ircd/ircd.c:1.16 Fri Apr 22 09:22:13 2005 +++ ircd-ircdev/ircd/ircd.c Thu Apr 28 15:00:08 2005 @@ -21,7 +21,7 @@ */ /** @file * @brief Entry point and other initialization functions for the daemon. - * @version $Id: ircd.c,v 1.16 2005/04/22 16:22:13 zolty Exp $ + * @version $Id: ircd.c,v 1.17 2005/04/28 22:00:08 zolty Exp $ */ #include "config.h" @@ -268,6 +268,7 @@ */ if (!(aconf->status & CONF_SERVER) || aconf->address.port == 0 + || !(aconf->flags & CONF_AUTOCONNECT) || ((ajupe = jupe_find(aconf->name)) && JupeIsActive(ajupe))) continue; Index: ircd-ircdev/ircd/ircd_lexer.l diff -u ircd-ircdev/ircd/ircd_lexer.l:1.12 ircd-ircdev/ircd/ircd_lexer.l:1.13 --- ircd-ircdev/ircd/ircd_lexer.l:1.12 Sun Apr 24 15:18:05 2005 +++ ircd-ircdev/ircd/ircd_lexer.l Thu Apr 28 15:00:08 2005 @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: ircd_lexer.l,v 1.12 2005/04/24 22:18:05 zolty Exp $ + * $Id: ircd_lexer.l,v 1.13 2005/04/28 22:00:08 zolty Exp $ * */ @@ -26,6 +26,7 @@ #include <unistd.h> #include <stdio.h> #include <stdlib.h> +#include <string.h> #include "config.h" #include "ircd.h" #include "ircd_alloc.h" @@ -102,9 +103,11 @@ TOKEN(PREPEND), TOKEN(USERMODE), TOKEN(FAST), + TOKEN(AUTOCONNECT), #undef TOKEN { "administrator", ADMIN }, { "apass_opmode", TPRIV_APASS_OPMODE }, + { "auto", AUTOCONNECT }, { "b", BYTES }, { "badchan", TPRIV_BADCHAN }, { "chan_limit", TPRIV_CHAN_LIMIT }, Index: ircd-ircdev/ircd/ircd_parser.y diff -u ircd-ircdev/ircd/ircd_parser.y:1.19 ircd-ircdev/ircd/ircd_parser.y:1.20 --- ircd-ircdev/ircd/ircd_parser.y:1.19 Sun Apr 24 15:18:05 2005 +++ ircd-ircdev/ircd/ircd_parser.y Thu Apr 28 15:00:08 2005 @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: ircd_parser.y,v 1.19 2005/04/24 22:18:05 zolty Exp $ + * $Id: ircd_parser.y,v 1.20 2005/04/28 22:00:08 zolty Exp $ * */ %{ @@ -70,7 +70,7 @@ int yylex(void); /* Now all the globals we need :/... */ - int tping, tconn, maxlinks, sendq, port, invert, stringno; + int tping, tconn, maxlinks, sendq, port, invert, stringno, flags; char *name, *pass, *host, *ip, *username, *origin, *hub_limit; char *stringlist[MAX_STRINGS]; struct ConnectionClass *c_class; @@ -157,6 +157,7 @@ %token IAUTH %token TIMEOUT %token FAST +%token AUTOCONNECT /* and now a lot of privileges... */ %token TPRIV_CHAN_LIMIT TPRIV_MODE_LCHAN TPRIV_DEOP_LCHAN TPRIV_WALK_LCHAN %token TPRIV_LOCAL_KILL TPRIV_REHASH TPRIV_RESTART TPRIV_DIE @@ -396,7 +397,8 @@ connectblock: CONNECT { - maxlinks = 65535; + maxlinks = 65535; + flags = CONF_AUTOCONNECT; } '{' connectitems '}' { struct ConfItem *aconf = NULL; @@ -409,7 +411,7 @@ else if (strchr(host, '*') || strchr(host, '?')) parse_error("Invalid host '%s' in connect block", host); else if (c_class == NULL) - parse_error("Missing class in connect block"); + parse_error("Missing or non-existent class in connect block"); else { aconf = make_conf(CONF_SERVER); aconf->name = name; @@ -420,6 +422,7 @@ aconf->host = host; aconf->maximum = maxlinks; aconf->hub_limit = hub_limit; + aconf->flags = flags; lookup_confhost(aconf); } if (!aconf) { @@ -431,12 +434,12 @@ } name = pass = host = origin = hub_limit = NULL; c_class = NULL; - port = 0; + port = flags = 0; }';'; connectitems: connectitem connectitems | connectitem; connectitem: connectname | connectpass | connectclass | connecthost | connectport | connectvhost | connectleaf | connecthub - | connecthublimit | connectmaxhops | error; + | connecthublimit | connectmaxhops | connectauto | error; connectname: NAME '=' QSTRING ';' { MyFree(name); @@ -450,6 +453,8 @@ connectclass: CLASS '=' QSTRING ';' { c_class = find_class($3); + if (!c_class) + parse_error("No such connection class '%s' for Connect block", $3); MyFree($3); }; connecthost: HOST '=' QSTRING ';' @@ -484,6 +489,8 @@ { maxlinks = $3; }; +connectauto: AUTOCONNECT '=' YES ';' { flags |= CONF_AUTOCONNECT; } + | AUTOCONNECT '=' NO ';' { flags &= ~CONF_AUTOCONNECT; }; uworldblock: UWORLD '{' uworlditems '}' ';'; uworlditems: uworlditem uworlditems | uworlditem; @@ -503,7 +510,7 @@ else if (host == NULL) parse_error("Missing host in operator block"); else if (c_class == NULL) - parse_error("Missing class in operator block"); + parse_error("Invalid or missing class in operator block"); else { aconf = make_conf(CONF_OPERATOR); aconf->name = name; @@ -554,6 +561,8 @@ operclass: CLASS '=' QSTRING ';' { c_class = find_class($3); + if (!c_class) + parse_error("No such connection class '%s' for Operator block", $3); MyFree($3); }; @@ -654,17 +663,16 @@ } '{' clientitems '}' ';' { + struct ConfItem *aconf = 0; struct irc_in_addr addr; unsigned char addrbits = 0; - if (ip && !ipmask_parse(ip, &addr, &addrbits)) { - parse_error("Invalid IP address %s in block", ip); - MyFree(username); - MyFree(host); - MyFree(ip); - MyFree(pass); - } else { - struct ConfItem *aconf = make_conf(CONF_CLIENT); + if (!c_class) + parse_error("Invalid or missing class in Client block"); + else if (ip && !ipmask_parse(ip, &addr, &addrbits)) + parse_error("Invalid IP address %s in Client block", ip); + else { + aconf = make_conf(CONF_CLIENT); aconf->username = username; aconf->host = host; if (ip) @@ -673,10 +681,16 @@ memset(&aconf->address.addr, 0, sizeof(aconf->address.addr)); aconf->addrbits = addrbits; aconf->name = ip; - aconf->conn_class = c_class ? c_class : find_class("default"); + aconf->conn_class = c_class; aconf->maximum = maxlinks; aconf->passwd = pass; } + if (!aconf) { + MyFree(username); + MyFree(host); + MyFree(ip); + MyFree(pass); + } host = NULL; username = NULL; c_class = NULL; @@ -720,6 +734,8 @@ clientclass: CLASS '=' QSTRING ';' { c_class = find_class($3); + if (!c_class) + parse_error("No such connection class '%s' for Class block", $3); MyFree($3); }; clientpass: PASS '=' QSTRING ';' Index: ircd-ircdev/ircd/m_invite.c diff -u ircd-ircdev/ircd/m_invite.c:1.9 ircd-ircdev/ircd/m_invite.c:1.10 --- ircd-ircdev/ircd/m_invite.c:1.9 Mon Mar 21 10:39:08 2005 +++ ircd-ircdev/ircd/m_invite.c Thu Apr 28 15:00:08 2005 @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: m_invite.c,v 1.9 2005/03/21 18:39:08 zolty Exp $ + * $Id: m_invite.c,v 1.10 2005/04/28 22:00:08 zolty Exp $ * */ @@ -176,24 +176,23 @@ if (cli_user(acptr)->away) send_reply(sptr, RPL_AWAY, cli_name(acptr), cli_user(acptr)->away); - if (MyConnect(acptr)) + if (MyConnect(acptr)) { add_invite(acptr, chptr); + sendcmdto_one(sptr, CMD_INVITE, acptr, "%s %H", cli_name(acptr), chptr); + } if (!IsLocalChannel(chptr->chname) || MyConnect(acptr)) { if (feature_bool(FEAT_ANNOUNCE_INVITES)) { /* Announce to channel operators. */ sendcmdto_channel_butserv_butone(&me, get_error_numeric(RPL_ISSUEDINVITE)->str, - NULL, chptr, sptr, SKIP_NONOPS, + NULL, chptr, sptr, SKIP_NONOPS, "%H %C %C :%C has been invited by %C", chptr, acptr, sptr, acptr, sptr); - /* Announce to servers with channel operators, but skip acptr, - * since they will be notified below. */ - sendcmdto_channel_servers_butone(sptr, NULL, TOK_INVITE, chptr, acptr, SKIP_NONOPS, + /* Announce to servers with channel operators. */ + sendcmdto_channel_servers_butone(sptr, NULL, TOK_INVITE, chptr, NULL, SKIP_NONOPS, "%s %H %Tu", cli_name(acptr), chptr, chptr->creationtime); } - sendcmdto_one(sptr, CMD_INVITE, acptr, "%s %H %Tu", cli_name(acptr), - chptr, chptr->creationtime); } return 0; @@ -281,8 +280,10 @@ if (is_silenced(sptr, acptr)) return 0; - if (MyConnect(acptr)) + if (MyConnect(acptr)) { add_invite(acptr, chptr); + sendcmdto_one(sptr, CMD_INVITE, acptr, "%s %H", cli_name(acptr), chptr); + } if (feature_bool(FEAT_ANNOUNCE_INVITES)) { /* Announce to channel operators. */ @@ -290,16 +291,12 @@ NULL, chptr, sptr, SKIP_NONOPS, "%H %C %C :%C has been invited by %C", chptr, acptr, sptr, acptr, sptr); - /* Announce to servers with channel operators, but skip acptr, - * since they will be notified below. */ - sendcmdto_channel_servers_butone(sptr, NULL, TOK_INVITE, chptr, acptr, SKIP_NONOPS, + /* Announce to servers with channel operators. */ + sendcmdto_channel_servers_butone(sptr, NULL, TOK_INVITE, chptr, NULL, SKIP_NONOPS, "%s %H %Tu", cli_name(acptr), chptr, chptr->creationtime); } - sendcmdto_one(sptr, CMD_INVITE, acptr, - "%s %H %Tu", - cli_name(acptr), chptr, chptr->creationtime); return 0; } Index: ircd-ircdev/ircd/m_map.c diff -u ircd-ircdev/ircd/m_map.c:1.7 ircd-ircdev/ircd/m_map.c:1.8 --- ircd-ircdev/ircd/m_map.c:1.7 Mon Mar 21 10:39:08 2005 +++ ircd-ircdev/ircd/m_map.c Thu Apr 28 15:00:09 2005 @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: m_map.c,v 1.7 2005/03/21 18:39:08 zolty Exp $ + * $Id: m_map.c,v 1.8 2005/04/28 22:00:09 zolty Exp $ * */ @@ -115,6 +115,17 @@ else { char lag[512]; + unsigned int users; + unsigned int totalusers; + unsigned int percentage; + + totalusers = UserStats.clients; + if (!totalusers) + totalusers = 1; + + users = (IsMe(server) ? UserStats.local_clients : cli_serv(server)->clients); + percentage = (10000 * users) / totalusers; + if (cli_serv(server)->lag>10000) lag[0]=0; else if (cli_serv(server)->lag<0) @@ -128,8 +139,8 @@ else chr = ""; send_reply(cptr, RPL_MAP, prompt, chr, cli_name(server), - lag, (server == &me) ? UserStats.local_clients : - cli_serv(server)->clients); + lag, users, (users == 1) ? "" : "s", + (percentage / 100), (percentage % 100)); } if (prompt_length > 0) { Index: ircd-ircdev/ircd/m_whowas.c diff -u ircd-ircdev/ircd/m_whowas.c:1.7 ircd-ircdev/ircd/m_whowas.c:1.8 --- ircd-ircdev/ircd/m_whowas.c:1.7 Fri Apr 22 09:22:13 2005 +++ ircd-ircdev/ircd/m_whowas.c Thu Apr 28 15:00:09 2005 @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: m_whowas.c,v 1.7 2005/04/22 16:22:13 zolty Exp $ + * $Id: m_whowas.c,v 1.8 2005/04/28 22:00:09 zolty Exp $ * */ @@ -137,7 +137,7 @@ { send_reply(sptr, RPL_WHOWASUSER, temp->name, temp->username, temp->hostname, temp->realname); - if (IsAnOper(sptr) && ircd_strcmp(temp->hostname, temp->realhost)) + if (IsAnOper(sptr) && temp->realhost) send_reply(sptr, RPL_WHOISACTUALLY, temp->name, temp->username, temp->realhost); send_reply(sptr, RPL_WHOISSERVER, temp->name, feature_bool(FEAT_HIS_WHOIS_SERVERNAME) && !IsOper(sptr) ? Index: ircd-ircdev/ircd/s_conf.c diff -u ircd-ircdev/ircd/s_conf.c:1.13 ircd-ircdev/ircd/s_conf.c:1.14 --- ircd-ircdev/ircd/s_conf.c:1.13 Fri Apr 22 09:22:13 2005 +++ ircd-ircdev/ircd/s_conf.c Thu Apr 28 15:00:09 2005 @@ -21,7 +21,7 @@ */ /** @file * @brief ircd configuration file driver - * @version $Id: s_conf.c,v 1.13 2005/04/22 16:22:13 zolty Exp $ + * @version $Id: s_conf.c,v 1.14 2005/04/28 22:00:09 zolty Exp $ */ #include "config.h" @@ -30,6 +30,7 @@ #include "class.h" #include "client.h" #include "crule.h" +#include "ddb.h" #include "ircd_features.h" #include "fileio.h" #include "gline.h" @@ -46,6 +47,7 @@ #include "listener.h" #include "match.h" #include "motd.h" +#include "msg.h" #include "numeric.h" #include "numnicks.h" #include "opercmds.h" @@ -369,8 +371,34 @@ static enum AuthorizationCheckResult check_limit_and_attach(struct Client* cptr, struct ConfItem* aconf) { +#if defined(DDB) + struct Ddb *ddb; + int clones; + int maxclones; + + ddb = ddb_find_key(DDB_ILINEDB, (char *)ircd_ntoa(&cli_ip(cptr))); + if (ddb && (clones = atoi(ddb->content))) + maxclones = clones; + else if ((ddb = ddb_find_key(DDB_CONFIGDB, (char *)DDB_CONFIGDB_MAX_CLONES_PER_IP)) + && (clones = atoi(ddb->content))) + maxclones = clones; + else + maxclones = aconf->maximum; + + if (IPcheck_nr(cptr) > maxclones) + { + ddb = ddb_find_key(DDB_CONFIGDB, (char *)DDB_CONFIGDB_MSG_TOO_MANY_FROM_IP); + + sendcmdto_one(&me, CMD_NOTICE, cptr, + "In %s IRC Network only allows %d clones for your IP (%s)%s%s", + feature_str(FEAT_NETWORK), maxclones, ircd_ntoa(&cli_ip(cptr)), + ddb ? ". " : "", ddb ? ddb->content : ""); + return ACR_TOO_MANY_FROM_IP; + } +#else if (IPcheck_nr(cptr) > aconf->maximum) return ACR_TOO_MANY_FROM_IP; +#endif return attach_conf(cptr, aconf); } Index: ircd-ircdev/ircd/s_err.c diff -u ircd-ircdev/ircd/s_err.c:1.17 ircd-ircdev/ircd/s_err.c:1.18 --- ircd-ircdev/ircd/s_err.c:1.17 Fri Apr 22 09:22:13 2005 +++ ircd-ircdev/ircd/s_err.c Thu Apr 28 15:00:09 2005 @@ -21,7 +21,7 @@ */ /** @file * @brief Error handling support. - * @version $Id: s_err.c,v 1.17 2005/04/22 16:22:13 zolty Exp $ + * @version $Id: s_err.c,v 1.18 2005/04/28 22:00:09 zolty Exp $ */ #include "config.h" @@ -65,7 +65,7 @@ /* 014 */ { 0 }, /* 015 */ - { RPL_MAP, ":%s%s%s %s [%i clients]", "015" }, + { RPL_MAP, ":%s%s%s %s [%i client%s - %i.%i%%]", "015" }, /* 016 */ { RPL_MAPMORE, ":%s%s --> *more*", "016" }, /* 017 */ Index: ircd-ircdev/ircd/s_stats.c diff -u ircd-ircdev/ircd/s_stats.c:1.12 ircd-ircdev/ircd/s_stats.c:1.13 --- ircd-ircdev/ircd/s_stats.c:1.12 Fri Apr 22 09:22:13 2005 +++ ircd-ircdev/ircd/s_stats.c Thu Apr 28 15:00:09 2005 @@ -22,7 +22,7 @@ /** @file * @brief Report configuration lines and other statistics from this * server. - * @version $Id: s_stats.c,v 1.12 2005/04/22 16:22:13 zolty Exp $ + * @version $Id: s_stats.c,v 1.13 2005/04/28 22:00:09 zolty Exp $ * * Note: The info is reported in the order the server uses * it--not reversed as in ircd.conf! @@ -415,7 +415,8 @@ nowr = CurrentTime - cli_since(&me); send_reply(to, RPL_STATSUPTIME, nowr / 86400, (nowr / 3600) % 24, (nowr / 60) % 60, nowr % 60); - send_reply(to, RPL_STATSCONN, max_connection_count, max_client_count); + send_reply(to, RPL_STATSCONN, max_connection_count, max_client_count, + ServerStats->is_cl); } /** Verbosely report on servers connected to the network. Index: ircd-ircdev/ircd/s_user.c diff -u ircd-ircdev/ircd/s_user.c:1.15 ircd-ircdev/ircd/s_user.c:1.16 --- ircd-ircdev/ircd/s_user.c:1.15 Fri Apr 22 09:22:13 2005 +++ ircd-ircdev/ircd/s_user.c Thu Apr 28 15:00:09 2005 @@ -21,7 +21,7 @@ */ /** @file * @brief Miscellaneous user-related helper functions. - * @version $Id: s_user.c,v 1.15 2005/04/22 16:22:13 zolty Exp $ + * @version $Id: s_user.c,v 1.16 2005/04/28 22:00:09 zolty Exp $ */ #include "config.h" @@ -432,7 +432,7 @@ { last_too_many1 = CurrentTime; sendto_opmask_butone(0, SNO_TOOMANY, "Too many connections in " - "class %i for %s.", get_client_class(sptr), + "class %s for %s.", get_client_class(sptr), get_client_name(sptr, SHOW_IP)); } ++ServerStats->is_ref; @@ -613,12 +613,32 @@ /* * Set user's initial modes */ - parv[0] = (char*)nick; - parv[1] = (char*)nick; - parv[2] = (char*)client_get_default_umode(sptr); - parv[3] = NULL; /* needed in case of +s */ - set_user_mode(sptr, sptr, 3, parv); - ClearHiddenHost(sptr); /* just in case somebody stuck +x in there */ + tmpstr = (char*)client_get_default_umode(sptr); + if (tmpstr) for (; *tmpstr; ++tmpstr) { + switch (*tmpstr) { + case 's': + if (!feature_bool(FEAT_HIS_SNOTICES_OPER_ONLY)) { + SetServNotice(sptr); + set_snomask(sptr, SNO_DEFAULT, SNO_SET); + } + break; + case 'w': + if (!feature_bool(FEAT_WALLOPS_OPER_ONLY)) + SetWallops(sptr); + break; + case 'i': + SetInvisible(sptr); + ++UserStats.inv_clients; + break; + case 'd': + SetDeaf(sptr); + break; + case 'g': + if (!feature_bool(FEAT_HIS_DEBUG_OPER_ONLY)) + SetDebug(sptr); + break; + } + } } else /* if (IsServer(cptr)) */ @@ -678,9 +698,14 @@ iptobase64(ip_base64, &cli_ip(sptr), sizeof(ip_base64), 0), NumNick(sptr), cli_info(sptr)); - /* Send server notice mask to client */ - if (MyUser(sptr) && (cli_snomask(sptr) != SNO_DEFAULT) && HasFlag(sptr, FLAG_SERVNOTICE)) - send_reply(sptr, RPL_SNOMASK, cli_snomask(sptr), cli_snomask(sptr)); + /* Send user mode to client */ + if (MyUser(sptr)) + { + static struct Flags flags; /* automatically initialized to zeros */ + send_umode(cptr, sptr, &flags, ALL_UMODES); + if ((cli_snomask(sptr) != SNO_DEFAULT) && HasFlag(sptr, FLAG_SERVNOTICE)) + send_reply(sptr, RPL_SNOMASK, cli_snomask(sptr), cli_snomask(sptr)); + } /* Notify new local user */ check_status_watch(sptr, RPL_LOGON); Index: ircd-ircdev/tools/convert-conf.py diff -u ircd-ircdev/tools/convert-conf.py:1.4 ircd-ircdev/tools/convert-conf.py:1.5 --- ircd-ircdev/tools/convert-conf.py:1.4 Fri Apr 22 09:22:13 2005 +++ ircd-ircdev/tools/convert-conf.py Thu Apr 28 15:00:09 2005 @@ -19,7 +19,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# $Id: convert-conf.py,v 1.4 2005/04/22 16:22:13 zolty Exp $ +# $Id: convert-conf.py,v 1.5 2005/04/28 22:00:09 zolty Exp $ # # Configuration file converter from 2.10.11 to 2.10.12 format @@ -70,6 +70,10 @@ "HIS_SERVERINFO", "HIS_URLSERVERS" ] +deprecated_features = [ + "VIRTUAL_HOST", + ] + # [ "old feature" => ( local oper priv, global oper priv ) ] # None means don't add this feature_to_priv = { @@ -209,7 +213,7 @@ opers.append(parts) cvtmap = { - 'M': ('General', ('name', 'vhost', 'description', '', '!numeric'), ''), + 'M': ('General', ('name', 'vhost', 'description', '-', '!numeric'), ''), 'A': ('Admin', ('location', 'contact', 'contact'), ''), 'Y': ('Class', ('name', '!pingfreq', '!connectfreq', '!maxlinks', '!sendq'), ''), 'I': do_iline, @@ -283,6 +287,11 @@ for item in items: if idx >= len(parts): break + # This field is ignored + if parts[idx]=="-": + continue + if len(parts[idx]) and not len(item): + sys.stderr.write("WARNING: Unknown field %i on line %i\n" % (idx,lno)) if len(parts[idx]) and len(item): if item[0] == '!': print "\t%s = %s;" % (item[1:], istr(parts[idx])) @@ -344,13 +353,18 @@ print "\tname = \"%s\";" % qstr(connects[i]["name"]) print "\thost = \"%s\";" % qstr(connects[i]["host"]) print "\tpassword = \"%s\";" % qstr(connects[i]["password"]) - if connects[i]["port"]: + if connects[i].has_key("port"): print "\tport = %s;" % connects[i]["port"] print "\tclass = \"%s\";" % qstr(connects[i]["class"]) if connects[i].has_key("hub"): print "\thub = \"%s\";" % qstr(connects[i]["hub"]) else: print "\tleaf;" + if not connects[i].has_key("port"): + print "# You can now specify ports without implying autoconnect" + print "#\tport = 4400;" + print "\tautoconnect = no;" + sys.stderr.write("NOTE: You should add a port for \"%s\", autoconnect is now specified seperately\n" % qstr(connects[i]["name"])) print "};" print @@ -367,8 +381,10 @@ print "# Option converted to locop privilege" elif name.startswith("OPER_"): print "# Option converted to oper privilege" + elif name in deprecated_features: + print "# Option is deprecated" else: - print "# Option no longer exists in 2.10.12" + print "# Unknown option" print "#\t\"%s\" = \"%s\";" % (qstr(name), qstr(value)) print "\t\"%s\" = \"%s\";" % (qstr(name), qstr(value)) print "};" ----------------------- End of diff ----------------------- |