irc-dev-cvs Mailing List for IRC-Dev ircd development (Page 4)
Brought to you by:
zolty
You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(22) |
Sep
|
Oct
(2) |
Nov
|
Dec
(2) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(30) |
Feb
(4) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(27) |
Dec
(17) |
2004 |
Jan
|
Feb
(4) |
Mar
|
Apr
(4) |
May
(8) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(14) |
Dec
(2) |
2005 |
Jan
(18) |
Feb
(2) |
Mar
(12) |
Apr
(18) |
May
(16) |
Jun
(3) |
Jul
(2) |
Aug
|
Sep
(3) |
Oct
(9) |
Nov
|
Dec
|
2007 |
Jan
|
Feb
|
Mar
|
Apr
(8) |
May
|
Jun
|
Jul
(3) |
Aug
|
Sep
(5) |
Oct
|
Nov
(3) |
Dec
(2) |
2008 |
Jan
(6) |
Feb
|
Mar
|
Apr
|
May
|
Jun
(4) |
Jul
(8) |
Aug
(14) |
Sep
(4) |
Oct
(11) |
Nov
(1) |
Dec
|
From: Toni G. <zo...@us...> - 2005-10-25 09:47:45
|
CVSROOT : /cvsroot/irc-dev Module : ircd-ircdev Commit time: 2005-10-25 09:47:39 UTC Modified files: TODO.es Log message: Mas todo ---------------------- diff included ---------------------- Index: ircd-ircdev/TODO.es diff -u ircd-ircdev/TODO.es:1.30 ircd-ircdev/TODO.es:1.31 --- ircd-ircdev/TODO.es:1.30 Thu Oct 13 03:01:58 2005 +++ ircd-ircdev/TODO.es Tue Oct 25 02:47:29 2005 @@ -1,7 +1,7 @@ # # TODO para ircd-ircdev # -# $Id: TODO.es,v 1.30 2005/10/13 10:01:58 zolty Exp $ +# $Id: TODO.es,v 1.31 2005/10/25 09:47:29 zolty Exp $ # # Insertar las nuevas entradas al principio de la lista TODO. # @@ -26,6 +26,7 @@ notices de auth y dnslookup al conectar. - [D] U-lines a traves de la DDB. - [D] Mejorar la inicializacion de las DDB con los eventos. + - [G] Con la introduccion de &his, comprobar TODO. PRIORIDAD MEDIA @@ -73,6 +74,16 @@ [18:11:38] <Tor> quote opmode #opers +nk lalala [18:14:59] <Tor> burst de aways +[16:01:38] <Daijo> -mcpu=k8 -pipe -fomit-frame-pointer -mfpmath=sse +[16:01:45] <Daijo> -Os -mcpu=k8 -pipe -fomit-frame-pointer -mfpmath=sse +[16:01:48] <Daijo> con eso no veas como ganaria +[16:03:28] <Daijo> -O2 -march=i586 -pipe -fomit-frame-pointer +[16:03:30] <Daijo> eso es generico +[16:03:44] <Daijo> el omit-frame-pointer no es nada recomendado para depuracion +[16:04:23] <Daijo> y mi linea primera hace que compile para un binario menor (lo cual va de cabeza a la cache del +procesador), optimizando para 64 bits, y utilizando sse como funciones de coma flotante +[16:04:35] <Daijo> el -pipe hace que compile en memoria xa tardar menos + DOCUMENTACION PENDIENTE -------------------------------------------------------------------------------------- - [G] Documentar para Doxygen el Watch ----------------------- End of diff ----------------------- |
From: Toni G. <zo...@us...> - 2005-10-17 14:02:50
|
CVSROOT : /cvsroot/irc-dev Module : ircd-ircdev Commit time: 2005-10-17 14:02:42 UTC Modified files: ChangeLog ChangeLog.es doc/ircd.sample-en.conf doc/ircd.sample-es.conf include/channel.h include/ircd_string.h include/match.h include/patchlevel.h ircd/Makefile.in ircd/channel.c ircd/ddb_db_native.c ircd/gline.c ircd/ircd.c ircd/ircd_string.c ircd/m_burst.c ircd/m_invite.c ircd/m_join.c ircd/m_mode.c ircd/m_names.c ircd/m_opmode.c ircd/m_ping.c ircd/match.c ircd/s_conf.c ircd/test/ircd_in_addr_t.c Added files: ircd/convert-conf.c Log message: Author: zoltan <zo...@ir...> Log message: 2005-10-17 Toni García <zo...@ir...> 1.0.alpha44 * Sincronización Undernet ---------------------- diff included ---------------------- Index: ircd-ircdev/ChangeLog diff -u ircd-ircdev/ChangeLog:1.45 ircd-ircdev/ChangeLog:1.46 --- ircd-ircdev/ChangeLog:1.45 Thu Sep 1 04:25:42 2005 +++ ircd-ircdev/ChangeLog Mon Oct 17 07:02:32 2005 @@ -1,10 +1,13 @@ # # ChangeLog for ircd-ircdev # -# $Id: ChangeLog,v 1.45 2005/09/01 11:25:42 zolty Exp $ +# $Id: ChangeLog,v 1.46 2005/10/17 14:02:32 zolty Exp $ # # Insert new changes at beginning of the change list. # +2005-10-17 Toni García <zo...@ir...> 1.0.alpha44 + * Undernet synchronization + 2005-09-01 Toni García <zo...@ir...> 1.0.alpha43 * Undernet synchronization Index: ircd-ircdev/ChangeLog.es diff -u ircd-ircdev/ChangeLog.es:1.45 ircd-ircdev/ChangeLog.es:1.46 --- ircd-ircdev/ChangeLog.es:1.45 Thu Sep 1 04:25:42 2005 +++ ircd-ircdev/ChangeLog.es Mon Oct 17 07:02:32 2005 @@ -1,10 +1,13 @@ # # Log de Cambios para ircd-ircdev # -# $Id: ChangeLog.es,v 1.45 2005/09/01 11:25:42 zolty Exp $ +# $Id: ChangeLog.es,v 1.46 2005/10/17 14:02:32 zolty Exp $ # # Insertar los nuevos cambios al principio de esta lista de cambios. # +2005-10-17 Toni García <zo...@ir...> 1.0.alpha44 + * Sincronización Undernet + 2005-09-01 Toni García <zo...@ir...> 1.0.alpha43 * Sincronización Undernet Index: ircd-ircdev/doc/ircd.sample-en.conf diff -u ircd-ircdev/doc/ircd.sample-en.conf:1.22 ircd-ircdev/doc/ircd.sample-en.conf:1.23 --- ircd-ircdev/doc/ircd.sample-en.conf:1.22 Thu Sep 1 04:25:42 2005 +++ ircd-ircdev/doc/ircd.sample-en.conf Mon Oct 17 07:02:32 2005 @@ -800,7 +800,7 @@ # "GLINEMAXUSERCOUNT" = "20"; # "SOCKSENDBUF" = "61440"; # "SOCKRECVBUF" = "61440"; -# "IPCHECK_CLONE_LIMIT = 24"; +# "IPCHECK_CLONE_LIMIT = "24"; # "IPCHECK_CLONE_PERIOD = "40"; # "IPCHECK_CLONE_DELAY = "600"; # "MPATH" = "ircd.motd"; @@ -859,7 +859,7 @@ # "HIS_BANWHO" = "TRUE"; # "HIS_KILLWHO" = "TRUE"; # "HIS_REWRITE" = "TRUE"; -# "HIS_REMOTE" = 1; +# "HIS_REMOTE" = "1"; # "HIS_NETSPLIT" = TRUE"; # "HIS_SERVERNAME" = "*.irc-dev.net"; # "HIS_SERVERINFO" = "IRC-Dev.Net, Desarrollo de IRC / IRC Development"; Index: ircd-ircdev/doc/ircd.sample-es.conf diff -u ircd-ircdev/doc/ircd.sample-es.conf:1.17 ircd-ircdev/doc/ircd.sample-es.conf:1.18 --- ircd-ircdev/doc/ircd.sample-es.conf:1.17 Thu Sep 1 04:25:42 2005 +++ ircd-ircdev/doc/ircd.sample-es.conf Mon Oct 17 07:02:32 2005 @@ -838,7 +838,7 @@ # "GLINEMAXUSERCOUNT" = "20"; # "SOCKSENDBUF" = "61440"; # "SOCKRECVBUF" = "61440"; -# "IPCHECK_CLONE_LIMIT = 24"; +# "IPCHECK_CLONE_LIMIT = "24"; # "IPCHECK_CLONE_PERIOD = "40"; # "IPCHECK_CLONE_DELAY = "600"; # "MPATH" = "ircd.motd"; @@ -897,7 +897,7 @@ # "HIS_BANWHO" = "TRUE"; # "HIS_KILLWHO" = "TRUE"; # "HIS_REWRITE" = "TRUE"; -# "HIS_REMOTE" = 1; +# "HIS_REMOTE" = "1"; # "HIS_NETSPLIT" = TRUE"; # "HIS_SERVERNAME" = "*.irc-dev.net"; # "HIS_SERVERINFO" = "IRC-Dev.Net, Desarrollo de IRC / IRC Development"; Index: ircd-ircdev/include/channel.h diff -u ircd-ircdev/include/channel.h:1.13 ircd-ircdev/include/channel.h:1.14 --- ircd-ircdev/include/channel.h:1.13 Thu Sep 1 04:25:42 2005 +++ ircd-ircdev/include/channel.h Mon Oct 17 07:02:32 2005 @@ -22,7 +22,7 @@ */ /** @file * @brief Channel management and maintenance. - * @version $Id: channel.h,v 1.13 2005/09/01 11:25:42 zolty Exp $ + * @version $Id: channel.h,v 1.14 2005/10/17 14:02:32 zolty Exp $ */ #ifndef INCLUDED_channel_h #define INCLUDED_channel_h @@ -213,10 +213,6 @@ */ #define MAGIC_REMOTE_JOIN_TS 1270080000 -/** - * used in can_join to determine if an oper forced a join on a channel - */ -#define MAGIC_OPER_OVERRIDE 1000 extern const char* const PartFmt1; @@ -430,7 +426,6 @@ /* * Proto types */ -extern void clean_channelname(char* name); extern void channel_modes(struct Client *cptr, char *mbuf, char *pbuf, int buflen, struct Channel *chptr, struct Membership *member); @@ -445,7 +440,6 @@ const struct Client* cptr); extern int sub1_from_channel(struct Channel* chptr); extern int destruct_channel(struct Channel* chptr); -extern int can_join(struct Client *sptr, struct Channel *chptr, char *key); extern void add_user_to_channel(struct Channel* chptr, struct Client* who, unsigned int flags, int oplevel); extern void make_zombie(struct Membership* member, struct Client* who, Index: ircd-ircdev/include/ircd_string.h diff -u ircd-ircdev/include/ircd_string.h:1.6 ircd-ircdev/include/ircd_string.h:1.7 --- ircd-ircdev/include/ircd_string.h:1.6 Wed Jun 22 00:54:29 2005 +++ ircd-ircdev/include/ircd_string.h Mon Oct 17 07:02:32 2005 @@ -21,7 +21,7 @@ */ /** @file ircd_string.h * @brief Public declarations and APIs for string operations. - * @version $Id: ircd_string.h,v 1.6 2005/06/22 07:54:29 zolty Exp $ + * @version $Id: ircd_string.h,v 1.7 2005/10/17 14:02:32 zolty Exp $ */ #ifndef INCLUDED_ircd_string_h #define INCLUDED_ircd_string_h @@ -51,7 +51,8 @@ char** vector, int size); extern const char* ircd_ntoa(const struct irc_in_addr* addr); extern const char* ircd_ntoa_r(char* buf, const struct irc_in_addr* addr); -extern int ircd_aton(struct irc_in_addr *addr, const char *str); +#define ircd_aton(ADDR, STR) ipmask_parse((STR), (ADDR), NULL) +extern int ipmask_parse(const char *in, struct irc_in_addr *mask, unsigned char *bits_ptr); extern char* host_from_uh(char* buf, const char* userhost, size_t len); extern char* ircd_strtok(char** save, char* str, char* fs); Index: ircd-ircdev/include/match.h diff -u ircd-ircdev/include/match.h:1.4 ircd-ircdev/include/match.h:1.5 --- ircd-ircdev/include/match.h:1.4 Mon Jan 10 04:22:00 2005 +++ ircd-ircdev/include/match.h Mon Oct 17 07:02:32 2005 @@ -21,7 +21,7 @@ */ /** @file match.h * @brief Interface for matching strings to IRC masks. - * @version $Id: match.h,v 1.4 2005/01/10 12:22:00 zolty Exp $ + * @version $Id: match.h,v 1.5 2005/10/17 14:02:32 zolty Exp $ */ #ifndef INCLUDED_match_h #define INCLUDED_match_h @@ -51,8 +51,6 @@ extern int matchdecomp(char *mask, const char *cmask); extern int mmexec(const char *wcm, int wminlen, const char *rcm, int rminlen); -extern int check_if_ipmask(const char *mask); -extern int ipmask_parse(const char *in, struct irc_in_addr *mask, unsigned char *bits_ptr); extern int ipmask_check(const struct irc_in_addr *addr, const struct irc_in_addr *mask, unsigned char bits); #endif /* INCLUDED_match_h */ Index: ircd-ircdev/include/patchlevel.h diff -u ircd-ircdev/include/patchlevel.h:1.44 ircd-ircdev/include/patchlevel.h:1.45 --- ircd-ircdev/include/patchlevel.h:1.44 Thu Sep 1 04:25:42 2005 +++ ircd-ircdev/include/patchlevel.h Mon Oct 17 07:02:32 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.44 2005/09/01 11:25:42 zolty Exp $ + * $Id: patchlevel.h,v 1.45 2005/10/17 14:02:32 zolty Exp $ * */ -#define PATCHLEVEL ".alpha43" +#define PATCHLEVEL ".alpha44" #define RELEASE "1.0" Index: ircd-ircdev/ircd/Makefile.in diff -u ircd-ircdev/ircd/Makefile.in:1.27 ircd-ircdev/ircd/Makefile.in:1.28 --- ircd-ircdev/ircd/Makefile.in:1.27 Wed May 25 09:56:23 2005 +++ ircd-ircdev/ircd/Makefile.in Mon Oct 17 07:02:32 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: Makefile.in,v 1.27 2005/05/25 16:56:23 zolty Exp $ +# $Id: Makefile.in,v 1.28 2005/10/17 14:02:32 zolty Exp $ #### Start of system configuration section. #### @@ -69,6 +69,9 @@ PURIFY = RINGLOG_O = +CONVERT_CONF_SRC = \ + convert-conf.c + ENGINE_SRC = \ engine_devpoll.c \ engine_epoll.c \ @@ -261,6 +264,8 @@ UMKPASSWD_OBJS = ${UMKPASSWD_SRC:%.c=%.o} +CONVERT_CONF_OBJS = ${CONVERT_CONF_SRC:%.c=%.o} + DEP_SRC = ${IRCD_SRC} ${UNDERNET_SRC} ${DDB_SRC} ${SERVICES_SRC} ${ENGINE_SRC} ${CRYPTO_SRC} all: @@ -271,13 +276,16 @@ .c.o: ${CC} ${CFLAGS} ${CPPFLAGS} -c $< -o $@ -build: ircd +build: ircd convert-conf ircd: ${OBJS} ../include/patchlevel.h version.o ${PURIFY} ${CC} ${OBJS} version.o ${RINGLOG_O} ${LDFLAGS} ${LIBS} \ -o ircd ${CHMOD} ${IRCDMODE} ircd +convert-conf: ${CONVERT_CONF_OBJS} + ${PURIFY} ${CC} ${CONVERT_CONF_OBJS} ${LDFLAGS} -o convert-conf + # # Make sure the anti hack checksums get included when things change # bleah @@ -356,7 +364,7 @@ @echo "Please remove the contents of ${DPATH} manually" clean: - ${RM} -f *.o *.bak ircd version.c umkpasswd ircd_osdep.c chattr.tab.c table_gen y.tab.* lex.yy.* + ${RM} -f *.o *.bak ircd version.c umkpasswd convert-conf chattr.tab.c table_gen y.tab.* lex.yy.* distclean: clean ${RM} -f Makefile stamp-m Index: ircd-ircdev/ircd/channel.c diff -u ircd-ircdev/ircd/channel.c:1.25 ircd-ircdev/ircd/channel.c:1.26 --- ircd-ircdev/ircd/channel.c:1.25 Thu Sep 1 04:25:42 2005 +++ ircd-ircdev/ircd/channel.c Mon Oct 17 07:02:32 2005 @@ -21,7 +21,7 @@ */ /** @file * @brief Channel management and maintanance - * @version $Id: channel.c,v 1.25 2005/09/01 11:25:42 zolty Exp $ + * @version $Id: channel.c,v 1.26 2005/10/17 14:02:32 zolty Exp $ */ #include "config.h" @@ -368,12 +368,15 @@ #if defined(UNDERNET) char tmphost[HOSTLEN + 1]; #endif + char iphost[SOCKIPLEN + 1]; + char *hostmask; char *sr; struct Ban *found; /* Build nick!user and alternate host names. */ ircd_snprintf(0, nu, sizeof(nu), "%s!%s", cli_name(cptr), cli_user(cptr)->username); + ircd_ntoa_r(iphost, &cli_ip(cptr)); #if defined(UNDERNET) if (!IsAccount(cptr)) @@ -403,11 +406,13 @@ if (res) continue; /* Compare host portion of ban. */ + hostmask = banlist->banstr + banlist->nu_len + 1; if (!((banlist->flags & BAN_IPMASK) && ipmask_check(&cli_ip(cptr), &banlist->address, banlist->addrbits)) - && match(banlist->banstr + banlist->nu_len + 1, cli_user(cptr)->host) - && !(sr && match(banlist->banstr + banlist->nu_len + 1, sr) == 0)) + && match(hostmask, cli_user(cptr)->host) + && !(sr && match(hostmask, sr))) continue; + /* If an exception matches, no ban can match. */ if (banlist->flags & BAN_EXCEPTION) return NULL; @@ -1320,106 +1325,6 @@ send_reply(cptr, RPL_ENDOFBANLIST, chptr->chname); } -/** Check a key against a keyring. - * We are now treating the key part of /join channellist key as a key - * ring; that is, we try one key against the actual channel key, and if that - * doesn't work, we try the next one, and so on. -Kev -Texaco - * Returns: 0 on match, 1 otherwise - * This version contributed by SeKs \<in...@in...\> - * - * @param key Key to check - * @param keyring Comma separated list of keys - * - * @returns True if the key was found and matches, false otherwise. - */ -static int compall(char *key, char *keyring) -{ - char *p1; - -top: - p1 = key; /* point to the key... */ - while (*p1 && *p1 == *keyring) - { /* step through the key and ring until they - don't match... */ - p1++; - keyring++; - } - - if (!*p1 && (!*keyring || *keyring == ',')) - /* ok, if we're at the end of the and also at the end of one of the keys - in the keyring, we have a match */ - return 0; - - if (!*keyring) /* if we're at the end of the key ring, there - weren't any matches, so we return 1 */ - return 1; - - /* Not at the end of the key ring, so step - through to the next key in the ring: */ - while (*keyring && *(keyring++) != ','); - - goto top; /* and check it against the key */ -} - -/** Returns if a user can join a channel with a specific key. - * - * @param sptr The client trying to join - * @param chptr The channel to join - * @param key The key to use - * - * @returns any error that occurred bitwised OR'd with MAGIC_OPER_OVERRIDE - * if the oper used the magic key, 0 if no error occured. - */ -int can_join(struct Client *sptr, struct Channel *chptr, char *key) -{ - int overrideJoin = 0; - - /* - * Now a banned user CAN join if invited -- Nemesi - * Now a user CAN escape channel limit if invited -- bfriendly - * Now a user CAN escape anything if invited -- Isomer - */ - - if (IsInvited(sptr, chptr)) - return 0; - - /* An oper can force a join on a local channel using "OVERRIDE" as the key. - a HACK(4) notice will be sent if he would not have been supposed - to join normally. */ - if (IsLocalChannel(chptr->chname) && HasPriv(sptr, PRIV_WALK_LCHAN) && - !BadPtr(key) && compall("OVERRIDE",chptr->mode.key) != 0 && - compall("OVERRIDE",key) == 0) - overrideJoin = MAGIC_OPER_OVERRIDE; - - if (chptr->mode.mode & MODE_INVITEONLY) - return overrideJoin + ERR_INVITEONLYCHAN; - - if (chptr->mode.limit && chptr->users >= chptr->mode.limit) - return overrideJoin + ERR_CHANNELISFULL; - - if ((chptr->mode.mode & MODE_REGONLY) && -#if defined(UNDERNET) - !IsAccount(sptr)) -#elif defined(DDB) || defined(SERVICES) - !IsNickRegistered(sptr)) -#endif - return overrideJoin + ERR_NEEDREGGEDNICK; - - if (find_ban(sptr, chptr->banlist)) - return overrideJoin + ERR_BANNEDFROMCHAN; - - /* - * now using compall (above) to test against a whole key ring -Kev - */ - if (*chptr->mode.key && (EmptyString(key) || compall(chptr->mode.key, key))) - return overrideJoin + ERR_BADCHANNELKEY; - - if (overrideJoin) - return ERR_DONTCHEAT; - - return 0; -} - /** Remove bells and commas from channel name * * @param cn Channel name to clean, modified in place. @@ -3639,9 +3544,7 @@ assert(0 != jbuf); if (!chan) { - if (jbuf->jb_type == JOINBUF_TYPE_JOIN) - sendcmdto_serv_butone(jbuf->jb_source, CMD_JOIN, jbuf->jb_connect, "0"); - + sendcmdto_serv_butone(jbuf->jb_source, CMD_JOIN, jbuf->jb_connect, "0"); return; } Index: ircd-ircdev/ircd/convert-conf.c diff -u /dev/null ircd-ircdev/ircd/convert-conf.c:1.1 --- /dev/null Mon Oct 17 07:02:43 2005 +++ ircd-ircdev/ircd/convert-conf.c Mon Oct 17 07:02:32 2005 @@ -0,0 +1,650 @@ +/* + * IRC-Dev IRCD - An advanced and innovative IRC Daemon, ircd/convert-conf.c + * + * Copyright (C) 2002-2005 IRC-Dev Development Team <de...@ir...> + * Copyright (C) 2005 Michael Poole + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * $Id: convert-conf.c,v 1.1 2005/10/17 14:02:32 zolty Exp $ + * convert-conf.c - Convert ircu2.10.11 ircd.conf to ircu2.10.12 format. + * + */ + +#include <ctype.h> /* tolower(), toupper(), isdigit() */ +#include <stdio.h> /* *printf(), fgets() */ +#include <stdlib.h> /* free(), strtol() */ +#include <string.h> /* strlen(), memcpy(), strchr(), strspn() */ + +#define MAX_FIELDS 5 + +const char *admin_names[] = { "location", "contact", "contact", 0 }, + *connect_names[] = { "host", "password", "name", "#port", "class", 0 }, + *crule_names[] = { "server", "", "rule", 0 }, + *general_names[] = { "name", "vhost", "description", "", "#numeric", 0 }, + *motd_names[] = { "host", "file", 0 }, + *class_names[] = { "name", "#pingfreq", "#connectfreq", "#maxlinks", "#sendq", 0 }, + *removed_features[] = { "VIRTUAL_HOST", "OPERS_SEE_IN_SECRET_CHANNELS", "LOCOP_SEE_IN_SECRET_CHANNELS", 0 }; +char orig_line[512], line[512], dbuf[512]; +char *fields[MAX_FIELDS + 1]; +unsigned int nfields; +unsigned int lineno; + +/*** GENERIC SUPPORT CODE ***/ + +static int split_line(char *input, char **output) +{ + size_t quoted = 0, jj; + char *dest = dbuf, ch; + + nfields = 1; + output[0] = dest; + while (*input != '\0' && *input != '#') switch (ch = *input++) { + case ':': + if (quoted) + *dest++ = ch; + else { + *dest++ = '\0'; + if (nfields >= MAX_FIELDS) + return nfields; + output[nfields++] = dest; + } + break; + case '\\': + switch (ch = *input++) { + case 'b': *dest++ = '\b'; break; + case 'f': *dest++ = '\f'; break; + case 'n': *dest++ = '\n'; break; + case 'r': *dest++ = '\r'; break; + case 't': *dest++ = '\t'; break; + case 'v': *dest++ = '\v'; break; + default: *dest++ = ch; break; + } + break; + case '"': quoted = !quoted; break; + default: *dest++ = ch; break; + } + + *dest = '\0'; + for (jj = nfields; jj < MAX_FIELDS; ++jj) + output[jj] = dest; + return nfields; +} + +static void simple_line(const char *block, const char **names, const char *extra) +{ + size_t ii; + + /* Print the current line and start the new block. */ + fprintf(stdout, "# %s\n%s {\n", orig_line, block); + + /* Iterate over fields in input line, formatting each. */ + for (ii = 0; ii < nfields && names[ii]; ++ii) { + if (!fields[ii][0] || !names[ii][0]) + continue; + else if (names[ii][0] == '#') + fprintf(stdout, "\t%s = %s;\n", names[ii] + 1, fields[ii]); + else + fprintf(stdout, "\t%s = \"%s\";\n", names[ii], fields[ii]); + } + + /* Close the new block (including any fixed-form text). */ + if (extra) + fprintf(stdout, "\t%s\n", extra); + fputs("};\n", stdout); +} + +#define dupstring(TARGET, SOURCE) do { free(TARGET); if (SOURCE) { size_t len = strlen(SOURCE); (TARGET) = malloc(len+1); memcpy((TARGET), (SOURCE), len); } else (TARGET) = 0; } while(0) + +/*** MANAGING LISTS OF STRINGS ***/ + +struct string_list { + struct string_list *next; + char *origin; + char *extra; + char value[1]; +}; + +static struct string_list *string_get(struct string_list **list, const char *value) +{ + struct string_list *curr; + size_t len = strlen(value), ii; + + while ((curr = *list)) { + for (ii = 0; tolower(curr->value[ii]) == tolower(value[ii]) && ii < len; ++ii) ; + if (curr->value[ii] == '\0' && value[ii] == '\0') + return curr; + list = &curr->next; + } + + *list = calloc(1, sizeof(**list) + len); + memcpy((*list)->value, value, len); + return *list; +} + +/*** SERVER CONNECTION RELATED CODE ***/ + +struct connect { + char *host; + char *password; + char *port; + char *class; + char *hub; + char *maximum; + struct connect *next; + struct string_list *origins; + char name[1]; +} *connects; + +static struct connect *get_connect(const char *name) +{ + struct connect *conn; + size_t ii, nlen; + + /* Look for a pre-existing connection with the same name. */ + nlen = strlen(name); + for (conn = connects; conn; conn = conn->next) + { + for (ii = 0; tolower(name[ii]) == conn->name[ii] && ii < nlen; ++ii) ; + if (conn->name[ii] == '\0' && name[ii] == '\0') + break; + } + + /* If none was found, create a new one. */ + if (!conn) + { + conn = calloc(1, sizeof(*conn) + nlen); + for (ii = 0; ii < nlen; ++ii) + conn->name[ii] = tolower(name[ii]); + conn->next = connects; + connects = conn; + } + + /* Return the connection. */ + return conn; +} + +static void do_connect(void) +{ + struct connect *conn = get_connect(fields[2]); + dupstring(conn->host, fields[0]); + dupstring(conn->password, fields[1]); + dupstring(conn->port, fields[3]); + dupstring(conn->class, fields[4]); + string_get(&conn->origins, orig_line); +} + +static void do_hub(void) +{ + struct connect *conn = get_connect(fields[2]); + dupstring(conn->hub, fields[0]); + dupstring(conn->maximum, fields[3]); + string_get(&conn->origins, orig_line); +} + +static void do_leaf(void) +{ + struct connect *conn = get_connect(fields[2]); + free(conn->hub); + conn->hub = 0; + string_get(&conn->origins, orig_line); +} + +static void finish_connects(void) +{ + struct connect *conn; + struct string_list *sl; + + for (conn = connects; conn; conn = conn->next) + { + for (sl = conn->origins; sl; sl = sl->next) + fprintf(stdout, "# %s\n", sl->value); + fprintf(stdout, + "Connect {\n\tname =\"%s\";\n\thost = \"%s\";\n" + "\tpassword = \"%s\";\n\tclass = \"%s\";\n", + conn->name, conn->host, conn->password, conn->class); + if (conn->port && conn->port[0] != '\0') + fprintf(stdout, "\tport = %s;\n", conn->port); + else + fprintf(stdout, + "# Every Connect block should have a port number.\n" + "# To prevent autoconnects, set autoconnect = no.\n" + "#\tport = 4400;\n" + "\tautoconnect = no;\n"); + if (conn->maximum && conn->maximum[0] != '\0') + fprintf(stdout, "\tmaxhops = %s;\n", conn->maximum); + if (conn->hub && conn->hub[0] != '\0') + fprintf(stdout, "\thub = \"%s\";\n", conn->hub); + fprintf(stdout, "};\n\n"); + + } +} + +/*** FEATURE MANAGEMENT CODE ***/ + +struct feature { + struct string_list *values; + struct string_list *origins; + struct feature *next; + char name[1]; +} *features; + +struct remapped_feature { + const char *name; + const char *privilege; + int flags; /* 2 = global, 1 = local */ + struct feature *feature; +} remapped_features[] = { + /* Specially handled privileges: If you change the index of + * anything with NULL privilege, change the code in + * finish_operators() to match! + */ + { "CRYPT_OPER_PASSWORD", NULL, 0, 0 }, /* default: true */ + { "OPER_KILL", NULL, 2, 0 }, /* default: true */ + { "LOCAL_KILL_ONLY", NULL, 2, 0 }, /* default: false */ + /* remapped features that affect all opers */ + { "OPER_NO_CHAN_LIMIT", "chan_limit", 3, 0 }, + { "OPER_MODE_LCHAN", "mode_lchan", 3, 0 }, + { "OPER_WALK_THROUGH_LMODES", "walk_lchan", 3, 0 }, + { "NO_OPER_DEOP_LCHAN", "deop_lchan", 3, 0 }, + { "SHOW_INVISIBLE_USERS", "show_invis", 3, 0 }, + { "SHOW_ALL_INVISIBLE_USERS", "show_all_invis", 3, 0 }, + { "UNLIMIT_OPER_QUERY", "unlimit_query", 3, 0 }, + /* remapped features affecting only global opers */ + { "OPER_REHASH", "rehash", 2, 0 }, + { "OPER_RESTART", "restart", 2, 0 }, + { "OPER_DIE", "die", 2, 0 }, + { "OPER_GLINE", "gline", 2, 0 }, + { "OPER_LGLINE", "local_gline", 2, 0 }, + { "OPER_JUPE", "jupe", 2, 0 }, + { "OPER_LJUPE", "local_jupe", 2, 0 }, + { "OPER_OPMODE", "opmode", 2, 0 }, + { "OPER_LOPMODE", "local_opmode", 2, 0 }, + { "OPER_FORCE_OPMODE", "force_opmode", 2, 0 }, + { "OPER_FORCE_LOPMODE", "force_local_opmode", 2, 0 }, + { "OPER_BADCHAN", "badchan", 2, 0 }, + { "OPER_LBADCHAN", "local_badchan", 2, 0 }, + { "OPER_SET", "set", 2, 0 }, + { "OPER_WIDE_GLINE", "wide_gline", 2, 0 }, + /* remapped features affecting only local opers */ + { "LOCOP_KILL", "kill", 1, 0 }, + { "LOCOP_REHASH", "rehash", 1, 0 }, + { "LOCOP_RESTART", "restart", 1, 0 }, + { "LOCOP_DIE", "die", 1, 0 }, + { "LOCOP_LGLINE", "local_gline", 1, 0 }, + { "LOCOP_LJUPE", "local_jupe", 1, 0 }, + { "LOCOP_LOPMODE", "local_opmode", 1, 0 }, + { "LOCOP_FORCE_LOPMODE", "force_local_opmode", 1, 0 }, + { "LOCOP_LBADCHAN", "local_badchan", 1, 0 }, + { "LOCOP_WIDE_GLINE", "wide_gline", 1, 0 }, + { 0, 0, 0, 0 } +}; + +static void do_feature(void) +{ + struct feature *feat; + size_t ii; + + ii = strlen(fields[0]); + feat = calloc(1, sizeof(*feat) + ii); + while (ii-- > 0) + feat->name[ii] = toupper(fields[0][ii]); + feat->next = features; + features = feat; + string_get(&feat->origins, orig_line); + for (ii = 1; fields[ii] && fields[ii][0]; ++ii) + string_get(&feat->values, fields[ii]); +} + +static void finish_features(void) +{ + struct remapped_feature *rmf; + struct string_list *sl; + struct feature *feat; + size_t ii; + + fputs("Features {\n\t\"OPLEVELS\" = \"FALSE\";\n", stdout); + + for (feat = features; feat; feat = feat->next) { + /* See if the feature was remapped to an oper privilege. */ + for (rmf = remapped_features; rmf->name; rmf++) + if (0 == strcmp(feat->name, rmf->name)) + break; + if (rmf->name) { + rmf->feature = feat; + fprintf(stdout, "# Above feature mapped to an oper privilege.\n"); + continue; + } + + /* Was it removed? */ + for (ii = 0; removed_features[ii]; ++ii) + if (0 == strcmp(feat->name, removed_features[ii])) + break; + if (removed_features[ii]) { + fprintf(stdout, "# Above feature no longer exists.\n"); + continue; + } + + /* Wasn't remapped, wasn't removed: print it out. */ + fprintf(stdout, "\t\"%s\" =", feat->name); + for (sl = feat->values; sl; sl = sl->next) + fprintf(stdout, " \"%s\"", sl->value); + fprintf(stdout, ";\n"); + } + fputs("};\n\n", stdout); + +} + +/*** OPERATOR BLOCKS ***/ + +struct operator { + char *name; + char *host; + char *password; + char *class; + char *origin; + int is_local; + struct operator *next; +} *operators; + +static void do_operator(int is_local) +{ + struct operator *oper; + + oper = calloc(1, sizeof(*oper)); + dupstring(oper->host, fields[0]); + dupstring(oper->password, fields[1]); + dupstring(oper->name, fields[2]); + dupstring(oper->class, fields[4]); + dupstring(oper->origin, orig_line); + oper->is_local = is_local; + oper->next = operators; + operators = oper; +} + +static void finish_operators(void) +{ + struct remapped_feature *remap; + struct operator *oper; + struct feature *feat; + char *pw_salt = ""; + int global_kill = 0, mask = 0; + size_t ii; + + if ((feat = remapped_features[0].feature) && feat->values + && 0 == strcmp(feat->values->value, "FALSE")) + pw_salt = "$PLAIN$"; + + if ((feat = remapped_features[1].feature) && feat->values + && 0 == strcmp(feat->values->value, "FALSE")) + global_kill = 1; + else if ((feat = remapped_features[2].feature) && feat->values + && 0 == strcmp(feat->values->value, "FALSE")) + global_kill = 2; + + for (oper = operators; oper; oper = oper->next) { + fprintf(stdout, "# %s\nOperator {\n\tname = \"%s\";\n" + "\thost = \"%s\";\n\tpassword = \"%s%s\";\n" + "\tclass = \"%s\";\n", + oper->origin, oper->name, oper->host, pw_salt, + oper->password, oper->class); + if (oper->is_local) { + fputs("\tlocal = yes;\n", stdout); + mask = 1; + } else { + fputs("\tlocal = no;\n", stdout); + if (global_kill == 1) + fputs("\tkill = no;\n\tlocal_kill = no;\n", stdout); + else if (global_kill == 2) + fputs("\tkill = no;\n\tlocal_kill = yes;\n", stdout); + mask = 2; + } + for (ii = 0; (remap = &remapped_features[ii++])->name; ) { + if (!remap->feature || !remap->privilege + || !remap->feature->values || !remap->flags & mask) + continue; + fprintf(stdout, "\t%s = %s;\n", remap->privilege, + strcmp(remap->feature->values->value, "TRUE") ? "no" : "yes"); + } + fputs("};\n\n", stdout); + } +} + +/*** OTHER CONFIG TRANSFORMS ***/ + +static void do_kill(void) +{ + const char *host = fields[0], *reason = fields[1], *user = fields[2]; + + if (!memcmp(host, "$R", 3)) { + fprintf(stderr, "Empty realname K: line at line %u.\n", lineno); + return; + } + + /* Print the current line and start the new block. */ + fprintf(stdout, "# %s\nKill {\n", orig_line); + + /* Translate the user-matching portions. */ + if (host[0] == '$' && host[1] == 'R') { + /* Realname kill, possibly with a username */ + fprintf(stdout, "\trealname = \"%s\";\n", host + 2); + if (user[0] != '\0' && (user[0] != '*' || user[1] != '\0')) + fprintf(stdout, "\thost = \"%s@*\";\n", user); + } else { + /* Normal host or IP-based kill */ + if (user[0] != '\0' && (user[0] != '*' || user[1] != '\0')) + fprintf(stdout, "\thost = \"%s@%s\";\n", user, host); + else + fprintf(stdout, "\thost = \"%s\";\n", host); + } + + /* Translate the reason section. */ + if (reason[0] == '!') + fprintf(stdout, "\tfile = \"%s\";\n", reason + 1); + else + fprintf(stdout, "\treason = \"%s\";\n", reason); + + /* Close the block. */ + fprintf(stdout, "};\n"); +} + +static void do_port(void) +{ + const char *ipmask = fields[0], *iface = fields[1], *flags = fields[2], *port = fields[3]; + + /* Print the current line and start the new block. */ + fprintf(stdout, "# %s\nPort {\n", orig_line); + + /* Print the easy fields. */ + fprintf(stdout, "\tport = %s;\n", port); + if (iface && iface[0] != '\0') + fprintf(stdout, "\tvhost = \"%s\";\n", iface); + if (ipmask && ipmask[0] != '\0') + fprintf(stdout, "\tmask = \"%s\";\n", ipmask); + + /* Translate flag field. */ + while (*flags) switch (*flags++) { + case 'C': case 'c': /* client port is default state */; break; + case 'S': case 's': fprintf(stdout, "\tserver = yes;\n"); break; + case 'H': case 'h': fprintf(stdout, "\thidden = yes;\n"); break; + } + + /* Close the block. */ + fprintf(stdout, "};\n"); +} + +struct string_list *quarantines; + +static void do_quarantine(void) +{ + struct string_list *q; + q = string_get(&quarantines, fields[0]); + dupstring(q->origin, orig_line); + dupstring(q->extra, fields[1]); +} + +static void finish_quarantines(void) +{ + struct string_list *sl; + + if (quarantines) + { + fputs("Quarantine {\n", stdout); + for (sl = quarantines; sl; sl = sl->next) + fprintf(stdout, "# %s\n\t\"%s\" = \"%s\";\n", sl->origin, sl->value, sl->extra); + fputs("};\n\n", stdout); + } +} + +static void do_uworld(void) +{ + fprintf(stdout, "# %s\n", orig_line); + if (fields[0] && fields[0][0]) + fprintf(stdout, "Uworld { name = \"%s\"; };\n", fields[0]); + if (fields[1] && fields[1][0]) + fprintf(stdout, "Jupe { nick = \"%s\"; };\n", fields[1]); +} + +static void emit_client(const char *mask, const char *passwd, const char *class, long maxlinks, int is_ip) +{ + char *delim; + size_t len; + + delim = strchr(mask, '@'); + if (delim) { + *delim++ = '\0'; + if (is_ip) { + len = strspn(delim, "0123456789.*"); + if (delim[len]) { + fprintf(stderr, "Invalid IP mask on line %u.\n", lineno); + return; + } + fprintf(stdout, "Client {\n\tusername = \"%s\";\n\tip = \"%s\";\n", mask, delim); + } else { + fprintf(stdout, "Client {\n\tusername =\"%s\";\n\thost = \"%s\";\n", mask, delim); + } + } else if (is_ip) { + len = strspn(mask, "0123456789.*"); + if (mask[len]) + return; + fprintf(stdout, "Client {\n\tip = \"%s\";\n", mask); + } else { + if (!strchr(mask, '.') && !strchr(mask, '*')) + return; + fprintf(stdout, "Client {\n\thost = \"%s\";\n", mask); + } + + if (passwd) + fprintf(stdout, "\tpassword = \"%s\";\n", passwd); + + if (maxlinks >= 0) + fprintf(stdout, "\tmaxlinks = %ld;\n", maxlinks); + + fprintf(stdout, "\tclass = \"%s\";\n};\n", class); +} + +static void do_client(void) +{ + char *passwd = NULL, *delim; + long maxlinks; + + /* Print the current line. */ + fprintf(stdout, "# %s\n", orig_line); + + /* See if the password is really a maxlinks count. */ + maxlinks = strtol(fields[1], &delim, 10); + if (fields[1][0] == '\0') + maxlinks = -1; + else if (maxlinks < 0 || maxlinks > 99 || *delim != '\0') + passwd = fields[1]; + + /* Translate the IP and host mask fields into blocks. */ + emit_client(fields[0], passwd, fields[4], maxlinks, 1); + emit_client(fields[2], passwd, fields[4], maxlinks, 0); +} + +int main(int argc, char *argv[]) +{ + FILE *ifile; + + if (argc < 2) + ifile = stdin; + else if (!(ifile = fopen(argv[1], "rt"))) { + fprintf(stderr, "Unable to open file %s for input.\n", argv[1]); + return 1; + } + + for (lineno = 1; fgets(line, sizeof(line), ifile); ++lineno) { + /* Read line and pass comments through. */ + size_t len = strlen(line); + if (line[0] == '#') { + fputs(line, stdout); + continue; + } + /* Strip EOL character(s) and pass blank lines through. */ + while (len > 0 && (line[len-1] == '\n' || line[len-1] == '\r')) + line[--len] = '\0'; + if (len == 0) { + fputc('\n', stdout); + continue; + } + /* Skip but report invalid lines. */ + if (line[1] != ':') { + fprintf(stdout, "# %s\n", line); + fprintf(stderr, "Invalid input line %d.\n", lineno); + continue; + } + /* Copy the original line into a reusable variable. */ + strcpy(orig_line, line); + /* Split line into fields. */ + nfields = split_line(line + 2, fields); + + /* Process the input line. */ + switch (line[0]) { + case 'A': case 'a': simple_line("Admin", admin_names, NULL); break; + case 'C': case 'c': do_connect(); break; + case 'D': simple_line("CRule", crule_names, "all = yes;"); break; + case 'd': simple_line("CRule", crule_names, NULL); break; + case 'F': case 'f': do_feature(); break; + case 'H': case 'h': do_hub(); break; + case 'I': case 'i': do_client(); break; + case 'K': case 'k': do_kill(); break; + case 'L': case 'l': do_leaf(); break; + case 'M': case 'm': simple_line("General", general_names, NULL); break; + case 'O': do_operator(0); break; + case 'o': do_operator(1); break; + case 'P': case 'p': do_port(); break; + case 'Q': case 'q': do_quarantine(); break; + case 'T': case 't': simple_line("Motd", motd_names, NULL); break; + case 'U': case 'u': do_uworld(); break; + case 'Y': case 'y': simple_line("Class", class_names, NULL); break; + default: + fprintf(stderr, "Unknown line %u with leading character '%c'.\n", lineno, line[0]); + break; + } + } + + fclose(ifile); + + fputs("\n# The following lines were intentionally moved and rearranged." + "\n# Our apologies for any inconvenience this may cause." + "\n\n", stdout); + finish_connects(); + finish_quarantines(); + finish_features(); + finish_operators(); + + return 0; +} Index: ircd-ircdev/ircd/ddb_db_native.c diff -u ircd-ircdev/ircd/ddb_db_native.c:1.4 ircd-ircdev/ircd/ddb_db_native.c:1.5 --- ircd-ircdev/ircd/ddb_db_native.c:1.4 Mon May 16 03:17:27 2005 +++ ircd-ircdev/ircd/ddb_db_native.c Mon Oct 17 07:02:32 2005 @@ -22,7 +22,7 @@ */ /** @file * @brief Native DataBase implementation of Distributed DataBases. - * @version $Id: ddb_db_native.c,v 1.4 2005/05/16 10:17:27 zolty Exp $ + * @version $Id: ddb_db_native.c,v 1.5 2005/10/17 14:02:32 zolty Exp $ */ #include "config.h" @@ -67,20 +67,15 @@ ddb_db_init(void) { char path[1024]; + struct stat *sStat; unsigned char table; int fd; - int temp; -#if 0 - temp = chdir(feature_str(FEAT_DDBPATH)); - log_write(LS_SYSTEM, L_CRIT, 0, "chdir(), resultado: %d", temp); - if (0 != temp) - /* if (0 != chdir(feature_str(FEAT_DDBPATH))) */ + if ((stat(feature_str(FEAT_DDBPATH), sStat) == 0)) { if (0 != mkdir(feature_str(FEAT_DDBPATH), 0775)) ddb_die("Error when creating %s directory", feature_str(FEAT_DDBPATH)); } -#endif /* Verify if hashes file is exist. */ ircd_snprintf(0, path, sizeof(path), "%s/hashes", feature_str(FEAT_DDBPATH)); Index: ircd-ircdev/ircd/gline.c diff -u ircd-ircdev/ircd/gline.c:1.15 ircd-ircdev/ircd/gline.c:1.16 --- ircd-ircdev/ircd/gline.c:1.15 Thu Sep 1 04:25:42 2005 +++ ircd-ircdev/ircd/gline.c Mon Oct 17 07:02:32 2005 @@ -23,7 +23,7 @@ */ /** @file * @brief Implementation of Gline manipulation functions. - * @version $Id: gline.c,v 1.15 2005/09/01 11:25:42 zolty Exp $ + * @version $Id: gline.c,v 1.16 2005/10/17 14:02:32 zolty Exp $ */ #include "config.h" @@ -167,10 +167,8 @@ else gline->gl_host = NULL; - if (*user != '$' && ipmask_parse(host, &gline->gl_addr, &gline->gl_bits)) { - Debug((DEBUG_DEBUG,"IP gline: %s/%u", ircd_ntoa(&gline->gl_addr), gline->gl_bits)); + if (*user != '$' && ipmask_parse(host, &gline->gl_addr, &gline->gl_bits)) gline->gl_flags |= GLINE_IPMASK; - } if (after) { gline->gl_next = after->gl_next; @@ -229,10 +227,6 @@ continue; if (GlineIsIpMask(gline)) { -#ifdef DEBUGMODE - char tbuf1[SOCKIPLEN], tbuf2[SOCKIPLEN]; - Debug((DEBUG_DEBUG,"IP gline: %s %s/%u", ircd_ntoa_r(tbuf1, &cli_ip(acptr)), ircd_ntoa_r(tbuf2, &gline->gl_addr), gline->gl_bits)); -#endif if (!ipmask_check(&cli_ip(acptr), &gline->gl_addr, gline->gl_bits)) continue; } @@ -696,7 +690,7 @@ gline_free(gline); continue; } - + if ((flags & GLINE_GLOBAL && gline->gl_flags & GLINE_LOCAL) || (flags & GLINE_LASTMOD && !gline->gl_lastmod)) continue; @@ -705,19 +699,12 @@ Debug((DEBUG_DEBUG,"realname gline: '%s' '%s'",gline->gl_user,cli_info(cptr))); if (match(gline->gl_user+2, cli_info(cptr)) != 0) continue; - if (!GlineIsActive(gline)) - continue; - return gline; } else { if (match(gline->gl_user, (cli_user(cptr))->username) != 0) continue; if (GlineIsIpMask(gline)) { -#ifdef DEBUGMODE - char tbuf1[SOCKIPLEN], tbuf2[SOCKIPLEN]; - Debug((DEBUG_DEBUG,"IP gline: %s %s/%u", ircd_ntoa_r(tbuf1, &cli_ip(cptr)), ircd_ntoa_r(tbuf2, &gline->gl_addr), gline->gl_bits)); -#endif if (!ipmask_check(&cli_ip(cptr), &gline->gl_addr, gline->gl_bits)) continue; } Index: ircd-ircdev/ircd/ircd.c diff -u ircd-ircdev/ircd/ircd.c:1.21 ircd-ircdev/ircd/ircd.c:1.22 --- ircd-ircdev/ircd/ircd.c:1.21 Thu Sep 1 04:25:42 2005 +++ ircd-ircdev/ircd/ircd.c Mon Oct 17 07:02:32 2005 @@ -21,7 +21,7 @@ */ /** @file * @brief Entry point and other initialization functions for the daemon. - * @version $Id: ircd.c,v 1.21 2005/09/01 11:25:42 zolty Exp $ + * @version $Id: ircd.c,v 1.22 2005/10/17 14:02:32 zolty Exp $ */ #include "config.h" @@ -280,14 +280,14 @@ || ((ajupe = jupe_find(aconf->name)) && JupeIsActive(ajupe))) continue; + /* Do we need to postpone this connection further? */ + hold = aconf->hold > CurrentTime; + /* Update next possible connection check time. */ - if (next > aconf->hold || next == 0) + if (hold && (next > aconf->hold || next == 0)) next = aconf->hold; - /* Update the next time we can consider this entry. */ cltmp = aconf->conn_class; - hold = aconf->hold > CurrentTime; /* before we update aconf->hold */ - aconf->hold = ConFreq(cltmp) ? CurrentTime + ConFreq(cltmp) : 0; /* Do not try to connect if its use is still on hold until future, * too many links in its connection class, it is already linked, Index: ircd-ircdev/ircd/ircd_string.c diff -u ircd-ircdev/ircd/ircd_string.c:1.11 ircd-ircdev/ircd/ircd_string.c:1.12 --- ircd-ircdev/ircd/ircd_string.c:1.11 Wed Jun 22 00:54:29 2005 +++ ircd-ircdev/ircd/ircd_string.c Mon Oct 17 07:02:32 2005 @@ -21,7 +21,7 @@ */ /** @file * @brief Implementation of string operations. - * @version $Id: ircd_string.c,v 1.11 2005/06/22 07:54:29 zolty Exp $ + * @version $Id: ircd_string.c,v 1.12 2005/10/17 14:02:32 zolty Exp $ */ #include "config.h" @@ -456,12 +456,13 @@ /** Attempt to parse an IPv4 address into a network-endian form. * @param[in] input Input string. * @param[out] output Network-endian representation of the address. + * @param[out] pbits Number of bits found in pbits. * @return Number of characters used from \a input, or 0 if the parse failed. */ static unsigned int -ircd_aton_ip4(const char *input, unsigned int *output) +ircd_aton_ip4(const char *input, unsigned int *output, unsigned char *pbits) { - unsigned int dots = 0, pos = 0, part = 0, ip = 0; + unsigned int dots = 0, pos = 0, part = 0, ip = 0, bits; /* Intentionally no support for bizarre IPv4 formats (plain * integers, octal or hex components) -- only vanilla dotted @@ -469,33 +470,60 @@ */ if (input[0] == '.') return 0; - while (1) { - if (IsDigit(input[pos])) { - part = part * 10 + input[pos++] - '0'; - if (part > 255) - return 0; - if ((dots == 3) && !IsDigit(input[pos])) { - *output = htonl(ip | part); - return pos; - } - } else if (input[pos] == '.') { - if (input[++pos] == '.') + bits = 32; + while (1) switch (input[pos]) { + case '\0': + if (dots < 3) + return 0; + out: + ip |= part << (24 - 8 * dots); + *output = htonl(ip); + if (pbits) + *pbits = bits; + return pos; + case '.': + if (input[++pos] == '.') + return 0; + ip |= part << (24 - 8 * dots++); + part = 0; + if (input[pos] == '*') { + while (input[++pos] == '*') ; + if (input[pos] != '\0') return 0; - ip |= part << (24 - 8 * dots++); - part = 0; - } else + if (pbits) + *pbits = dots * 8; + *output = htonl(ip); + return pos; + } + break; + case '/': + if (!pbits || !IsDigit(input[pos + 1])) + return 0; + for (bits = 0; IsDigit(input[++pos]); ) + bits = bits * 10 + input[pos] - '0'; + if (bits > 32) + return 0; + goto out; + case '0': case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': case '9': + part = part * 10 + input[pos++] - '0'; + if (part > 255) return 0; + break; + default: + return 0; } } /** Parse a numeric IPv4 or IPv6 address into an irc_in_addr. - * @param[out] ip Receives parsed IP address. * @param[in] input Input buffer. + * @param[out] ip Receives parsed IP address. + * @param[out] pbits If non-NULL, receives number of bits specified in address mask. * @return Number of characters used from \a input, or 0 if the * address was unparseable or malformed. */ int -ircd_aton(struct irc_in_addr *ip, const char *input) +ipmask_parse(const char *input, struct irc_in_addr *ip, unsigned char *pbits) { char *colon; char *dot; @@ -523,80 +551,104 @@ pos += 2; part_start = input + pos; } - while (ii < 8) { + while (ii < 8) switch (input[pos]) { unsigned char chval; - - switch (input[pos]) { - case '0': case '1': case '2': case '3': case '4': - case '5': case '6': case '7': case '8': case '9': - chval = input[pos] - '0'; - use_chval: - part = (part << 4) | chval; - if (part > 0xffff) + case '0': case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': case '9': + chval = input[pos] - '0'; + use_chval: + part = (part << 4) | chval; + if (part > 0xffff) + return 0; + pos++; + break; + case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': + chval = input[pos] - 'A' + 10; + goto use_chval; + case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': + chval = input[pos] - 'a' + 10; + goto use_chval; + case ':': + part_start = input + ++pos; + if (input[pos] == '.') + return 0; + ip->in6_16[ii++] = htons(part); + part = 0; + if (input[pos] == ':') { + if (colon < 8) return 0; + colon = ii; pos++; - break; - case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': - chval = input[pos] - 'A' + 10; - goto use_chval; - case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': - chval = input[pos] - 'a' + 10; - goto use_chval; - case ':': - part_start = input + ++pos; - if (input[pos] == '.') - return 0; - ip->in6_16[ii++] = htons(part); - part = 0; - if (input[pos] == ':') { - if (colon < 8) - return 0; - colon = ii; - pos++; - } - break; - case '.': { - uint32_t ip4; - unsigned int len; - len = ircd_aton_ip4(part_start, &ip4); - if (!len || (ii > 6)) - return 0; - ip->in6_16[ii++] = htons(ntohl(ip4) >> 16); - ip->in6_16[ii++] = htons(ntohl(ip4) & 65535); - if (colon < 8) { - unsigned int jj; - /* Shift stuff after "::" up and fill middle with zeros. */ - for (jj = 0; jj < ii - colon; jj++) - ip->in6_16[7 - jj] = ip->in6_16[ii - jj - 1]; - for (jj = 0; jj < 8 - ii; jj++) - ip->in6_16[colon + jj] = 0; - } - return part_start - input + len; - } - default: { - ip->in6_16[ii++] = htons(part); - if (colon < 8) { - unsigned int jj; - /* Shift stuff after "::" up and fill middle with zeros. */ - for (jj = 0; jj < ii - colon; jj++) - ip->in6_16[7 - jj] = ip->in6_16[ii - jj - 1]; - for (jj = 0; jj < 8 - ii; jj++) - ip->in6_16[colon + jj] = 0; - } - return pos; - } } + break; + case '.': { + uint32_t ip4; + unsigned int len; + len = ircd_aton_ip4(part_start, &ip4, pbits); + if (!len || (ii > 6)) + return 0; + ip->in6_16[ii++] = htons(ntohl(ip4) >> 16); + ip->in6_16[ii++] = htons(ntohl(ip4) & 65535); + if (pbits) + *pbits += 96; + pos = part_start + len - input; + goto finish; + } + case '/': + if (!pbits || !IsDigit(input[pos + 1])) + return 0; + ip->in6_16[ii++] = htons(part); + for (part = 0; IsDigit(input[++pos]); ) + part = part * 10 + input[pos] - '0'; + if (part > 128) + return 0; + *pbits = part; + goto finish; + case '*': + while (input[++pos] == '*') ; + if (input[pos] != '\0' || colon < 8) + return 0; + if (pbits) + *pbits = ii * 16; + return pos; + case '\0': + ip->in6_16[ii++] = htons(part); + if (colon == 8 && ii < 8) + return 0; + if (pbits) + *pbits = 128; + goto finish; + default: + return 0; + } + finish: + if (colon < 8) { + unsigned int jj; + /* Shift stuff after "::" up and fill middle with zeros. */ + for (jj = 0; jj < ii - colon; jj++) + ip->in6_16[7 - jj] = ip->in6_16[ii - jj - 1]; + for (jj = 0; jj < 8 - ii; jj++) + ip->in6_16[colon + jj] = 0; } return pos; - } else if (dot) { + } else if (dot || strchr(input, '/')) { unsigned int addr; - int len = ircd_aton_ip4(input, &addr); + int len = ircd_aton_ip4(input, &addr, pbits); if (len) { ip->in6_16[5] = htons(65535); ip->in6_16[6] = htons(ntohl(addr) >> 16); ip->in6_16[7] = htons(ntohl(addr) & 65535); - return len; + if (pbits) + *pbits += 96; } - } - return 0; /* parse failed */ + return len; + } else if (input[0] == '*') { + unsigned int pos = 0; + while (input[++pos] == '*') ; + if (input[pos] != '\0') + return 0; + if (pbits) + *pbits = 0; + return pos; + } else return 0; /* parse failed */ } Index: ircd-ircdev/ircd/m_burst.c diff -u ircd-ircdev/ircd/m_burst.c:1.13 ircd-ircdev/ircd/m_burst.c:1.14 --- ircd-ircdev/ircd/m_burst.c:1.13 Thu Sep 1 04:25:42 2005 +++ ircd-ircdev/ircd/m_burst.c Mon Oct 17 07:02:32 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: m_burst.c,v 1.13 2005/09/01 11:25:42 zolty Exp $ + * $Id: m_burst.c,v 1.14 2005/10/17 14:02:32 zolty Exp $ * */ @@ -403,11 +403,7 @@ strcpy(newban->who, "*"); */ newban->when = TStime(); - - newban->flags = BAN_BURSTED; /* set flags */ - if ((ptr = strrchr(ban, '@')) && check_if_ipmask(ptr + 1)) - newban->flags |= BAN_IPMASK; - + newban->flags = BAN_BURSTED; newban->next = 0; if (lp) lp->next = newban; /* link it in */ Index: ircd-ircdev/ircd/m_invite.c diff -u ircd-ircdev/ircd/m_invite.c:1.13 ircd-ircdev/ircd/m_invite.c:1.14 --- ircd-ircdev/ircd/m_invite.c:1.13 Sun Jul 3 13:21:42 2005 +++ ircd-ircdev/ircd/m_invite.c Mon Oct 17 07:02:32 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.13 2005/07/03 20:21:42 zolty Exp $ + * $Id: m_invite.c,v 1.14 2005/10/17 14:02:32 zolty Exp $ * */ @@ -141,12 +141,9 @@ if (is_silenced(sptr, acptr)) return 0; - clean_channelname(parv[2]); - - if (!IsChannelPrefix(*parv[2])) - return 0; - - if (!(chptr = FindChannel(parv[2]))) { + if (!IsChannelName(parv[2]) + || !strIsIrcCh(parv[2]) + || !(chptr = FindChannel(parv[2]))) { send_reply(sptr, ERR_NOSUCHCHANNEL, parv[2]); return 0; } Index: ircd-ircdev/ircd/m_join.c diff -u ircd-ircdev/ircd/m_join.c:1.13 ircd-ircdev/ircd/m_join.c:1.14 --- ircd-ircdev/ircd/m_join.c:1.13 Thu Sep 1 04:25:42 2005 +++ ircd-ircdev/ircd/m_join.c Mon Oct 17 07:02:32 2005 @@ -18,66 +18,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: m_join.c,v 1.13 2005/09/01 11:25:42 zolty Exp $ + * $Id: m_join.c,v 1.14 2005/10/17 14:02:32 zolty Exp $ * */ -/* - * m_functions execute protocol messages on this server: - * - * cptr is always NON-NULL, pointing to a *LOCAL* client - * structure (with an open socket connected!). This - * identifies the physical socket where the message - * originated (or which caused the m_function to be - * executed--some m_functions may call others...). - * - * sptr is the source of the message, defined by the - * prefix part of the message if present. If not - * or prefix not found, then sptr==cptr. - * - * (!IsServer(cptr)) => (cptr == sptr), because - * prefixes are taken *only* from servers... - * - * (IsServer(cptr)) - * (sptr == cptr) => the message didn't - * have the prefix. - * - * (sptr != cptr && IsServer(sptr) means - * the prefix specified servername. (?) - * - * (sptr != cptr && !IsServer(sptr) means - * that message originated from a remote - * user (not local). - * - * combining - * - * (!IsServer(sptr)) means that, sptr can safely - * taken as defining the target structure of the - * message in this server. - * - * *Always* true (if 'parse' and others are working correct): - * - * 1) sptr->from == cptr (note: cptr->from == cptr) - * - * 2) MyConnect(sptr) <=> sptr == cptr (e.g. sptr - * *cannot* be a local connection, unless it's - * actually cptr!). [MyConnect(x) should probably - * be defined as (x == x->from) --msa ] - * - * parc number of variable parameter strings (if zero, - * parv is allowed to be NULL) - * - * parv a NULL terminated list of parameter pointers, - * - * parv[0], sender (prefix string), if not present - * this points to an empty string. - * parv[1]...parv[parc-1] - * pointers to additional parameters - * parv[parc] == NULL, *always* - * - * note: it is guaranteed that parv[0]..parv[parc-1] are all - * non-NULL pointers. - */ #include "config.h" #include "channel.h" @@ -102,23 +46,25 @@ #include <stdlib.h> #include <string.h> -/* - * Helper function to find last 0 in a comma-separated list of - * channel names. +/** Searches for and handles a 0 in a join list. + * @param[in] cptr Client that sent us the message. + * @param[in] sptr Original source of message. + * @param[in] chanlist List of channels to join. + * @return First token in \a chanlist after the final 0 entry, which + * may be its nul terminator (if the final entry is a 0 entry). */ static char * -last0(char *chanlist) +last0(struct Client *cptr, struct Client *sptr, char *chanlist) { char *p; + int join0 = 0; for (p = chanlist; p[0]; p++) /* find last "JOIN 0" */ if (p[0] == '0' && (p[1] == ',' || p[1] == '\0' || !IsChannelChar(p[1]))) { - chanlist = p; /* we'll start parsing here */ - - if (!p[1]) /* hit the end */ - break; - - p++; + if (*++p == ',') + p++; + chanlist = p; + join0 = 1; } else { while (p[0] != ',' && p[0] != '\0') /* skip past channel name */ p++; @@ -127,43 +73,34 @@ break; } - return chanlist; -} - -/* - * Helper function to perform a JOIN 0 if needed; returns 0 if channel - * name is not 0, else removes user from all channels and returns 1. - */ -static int -join0(struct JoinBuf *join, struct Client *cptr, struct Client *sptr, - char *chan) -{ - struct Membership *member; - struct JoinBuf part; + if (join0) { + struct JoinBuf part; + struct Membership *member; + + joinbuf_init(&part, sptr, cptr, JOINBUF_TYPE_PARTALL, + "Left all channels", 0); + + joinbuf_join(&part, 0, 0); + + while ((member = cli_user(sptr)->channel)) + joinbuf_join(&part, member->channel, + IsZombie(member) ? CHFL_ZOMBIE : + IsDelayedJoin(member) ? CHFL_DELAYED : + 0); - /* is it a JOIN 0? */ - if (chan[0] != '0' || chan[1] != '\0') - return 0; - - joinbuf_join(join, 0, 0); /* join special channel 0 */ - - /* leave all channels */ - joinbuf_init(&part, sptr, cptr, JOINBUF_TYPE_PARTALL, - "Left all channels", 0); - - while ((member = cli_user(sptr)->channel)) - joinbuf_join(&part, member->channel, - IsZombie(member) ? CHFL_ZOMBIE : - IsDelayedJoin(member) ? CHFL_DELAYED : - 0); + joinbuf_flush(&part); - joinbuf_flush(&part); + } - return 1; + return chanlist; } -/* - * m_join - generic message handler +/** Handle a JOIN message from a client connection. + * See @ref m_functions for discussion of the arguments. + * @param[in] cptr Client that sent us the message. + * @param[in] sptr Original source of message. + * @param[in] parc Number of arguments. + * @param[in] parv Argument vector. */ int m_join(struct Client *cptr, struct Client *sptr, int parc, char *parv[]) { @@ -171,8 +108,6 @@ struct JoinBuf join; struct JoinBuf create; struct Gline *gline; - unsigned int flags = 0; - int i, j, k = 0; char *p = 0; char *chanlist; char *name; @@ -184,34 +119,33 @@ joinbuf_init(&join, sptr, cptr, JOINBUF_TYPE_JOIN, 0, 0); joinbuf_init(&create, sptr, cptr, JOINBUF_TYPE_CREATE, 0, TStime()); - chanlist = last0(parv[1]); /* find last "JOIN 0" */ + chanlist = last0(cptr, sptr, parv[1]); /* find last "JOIN 0" */ keys = parv[2]; /* remember where keys are */ - for (name = ircd_strtok(&p, chanlist, ","); name; name = ircd_strtok(&p, 0, ",")) { - clean_channelname(name); + char *key = 0; - if (join0(&join, cptr, sptr, name)) /* did client do a JOIN 0? */ - continue; + /* If we have any more keys, take the first for this channel. */ + if (!BadPtr(keys) + && (keys = strchr(key = keys, ','))) + *keys++ = '\0'; + + /* Empty keys are the same as no keys. */ + if (key && !key[0]) + key = 0; - /* bad channel name */ - if (!IsChannelName(name)) + if (!IsChannelName(name) || !strIsIrcCh(name)) { + /* bad channel name */ send_reply(sptr, ERR_NOSUCHCHANNEL, name); continue; } - /* This checks if the channel contains control codes and rejects em - * until they are gone, then we will do it otherwise - *SOB Mode* - */ - for (k = 0, j = 0; name[j]; j++) - if (IsCntrl(name[j])) - k++; - if (k > 0) - { - send_reply(sptr, ERR_NOSUCHCHANNEL, name); - continue; + if (cli_user(sptr)->joined >= feature_int(FEAT_MAXCHANNELSPERUSER) + && !HasPriv(sptr, PRIV_CHAN_LIMIT)) { + send_reply(sptr, ERR_TOOMANYCHANNELS, name); + break; /* no point processing the other channels */ } /* BADCHANed channel */ @@ -221,123 +155,111 @@ continue; } - if ((chptr = FindChannel(name))) - { - if (find_member_link(chptr, sptr)) - continue; /* already on channel */ - - flags = CHFL_DEOPPED; - } - else - flags = CHFL_CHANOP; - - /* disallow creating local channels */ - if (IsLocalChannel(name) && !chptr && !feature_bool(FEAT_LOCAL_CHANNELS)) { + if (!(chptr = FindChannel(name))) { + if ((name[0] == '&') && !feature_bool(FEAT_LOCAL_CHANNELS)) { send_reply(sptr, ERR_NOSUCHCHANNEL, name); continue; - } + } - if (cli_user(sptr)->joined >= feature_int(FEAT_MAXCHANNELSPERUSER) && - !HasPriv(sptr, PRIV_CHAN_LIMIT)) { - send_reply(sptr, ERR_TOOMANYCHANNELS, chptr ? chptr->chname : name); - break; /* no point processing the other channels */ - } + if (!(chptr = get_channel(sptr, name, CGT_CREATE))) + continue; - if (chptr) { + /* Try to add the new channel as a recent target for the user. */ + if (check_target_limit(sptr, chptr, chptr->chname, 1)) { #if defined(UNDERNET) - int is_level0_op = 0; - if (!BadPtr(keys) && *chptr->mode.apass) { - /* Don't use compall for the apass, only a single key is allowed. */ - if (strcmp(chptr->mode.apass, keys) == 0) { - is_level0_op = 1; - flags &= ~CHFL_DEOPPED; - flags |= CHFL_CHANOP | CHFL_CHANNEL_MANAGER; - } - else if (*chptr->mode.upass && strcmp(chptr->mode.upass, keys) == 0) { - is_level0_op = 1; - flags &= ~CHFL_DEOPPED; - flags |= CHFL_CHANOP; - } +/* FIXME zoltan */ + chptr->members = 0; + destruct_channel(chptr); + continue; } -#elif defined(DDB) - struct Ddb *ddb; - ... [truncated message content] |
From: Toni G. <zo...@us...> - 2005-10-13 10:02:18
|
CVSROOT : /cvsroot/irc-dev Module : ircd-ircdev Commit time: 2005-10-13 10:02:08 UTC Modified files: TODO.es Log message: actualizacion todo ---------------------- diff included ---------------------- Index: ircd-ircdev/TODO.es diff -u ircd-ircdev/TODO.es:1.29 ircd-ircdev/TODO.es:1.30 --- ircd-ircdev/TODO.es:1.29 Thu Sep 1 04:33:58 2005 +++ ircd-ircdev/TODO.es Thu Oct 13 03:01:58 2005 @@ -1,10 +1,14 @@ # # TODO para ircd-ircdev # -# $Id: TODO.es,v 1.29 2005/09/01 11:33:58 zolty Exp $ +# $Id: TODO.es,v 1.30 2005/10/13 10:01:58 zolty Exp $ # # Insertar las nuevas entradas al principio de la lista TODO. # +URGENTISIMO + - Pasar el codigo de alpha a BETA. Hay que revisar codigo por .c por +.c. Esto es debido a que la base del ircd ya se utiliza en producción. + URGENTE -------------------------------------------------------------------------------------- ----------------------- End of diff ----------------------- |
From: Toni G. <zo...@us...> - 2005-09-01 11:38:14
|
CVSROOT : /cvsroot/irc-dev Module : ircd-ircdev Commit time: 2005-09-01 11:38:07 UTC Modified files: doc/history/Undernet/ChangeLog-u2.10.12 Log message: ChangeLog ---------------------- diff included ---------------------- Index: ircd-ircdev/doc/history/Undernet/ChangeLog-u2.10.12 diff -u ircd-ircdev/doc/history/Undernet/ChangeLog-u2.10.12:1.3 ircd-ircdev/doc/history/Undernet/ChangeLog-u2.10.12:1.4 --- ircd-ircdev/doc/history/Undernet/ChangeLog-u2.10.12:1.3 Wed Mar 9 10:12:32 2005 +++ ircd-ircdev/doc/history/Undernet/ChangeLog-u2.10.12 Thu Sep 1 04:37:57 2005 @@ -1,3 +1,1320 @@ +2005-08-30 Michael Poole <md...@tr...> + + * include/channel.h (PASSLEN): Remove; use KEYLEN instead. + + * ircd/channel.c (mode_parse_upass): Likewise. + (mode_parse_apass): Likewise. + The inconsistency (in clean_key()) was reported by Reed. + +2005-08-30 Michael Poole <md...@tr...> + + * RELEASE.NOTES: Document +D and +d channel modes. + +2005-08-29 Michael Poole <md...@tr...> + + * include/numeric.h (ERR_NOMANAGER_LONG): Undefine. + (ERR_NOMANAGER_SHORT): Rename to ERR_NOMANAGER. + + * ircd/s_err.c (replyTable): Change to reflect that. + + * ircd/channel.c (clean_key): New function. + (mode_parse_key): Use it, and check that keys do not start with :. + (mode_parse_upass): Likewise, and adjust for ERR_NOMANAGER. + (mode_parse_apass): Likewise. + The key and password changes fix bugs reported by coekie. + +2005-08-27 Michael Poole <md...@tr...> + + * ircd/channel.c (add_user_to_channel): Use SetOpLevel() instead + of assigning directly to member->oplevel. + (mode_parse_apass): Likewise. + (mode_process_clients): Users opped by outsiders should get + oplevel 1, since they are not channel managers. + + * ircd/m_burst.c (ms_burst): Use SetOpLevel() instead of assigning + directly to member->oplevel. + +2005-08-25 Michael Poole <md...@tr...> + + * ircd/channel.c (member_can_send_to_channel): At coekie's + suggestion, disallow channel manager talking after Apass is set, + so they set and use Upass sooner. + + * ircd/class.c (init_class): Default class should have 1 link. + (report_classes): Return links count minus one to match old output. + + * ircd/m_trace.c (do_trace): Fix links count here, too (spotted by + Reed). + +2005-08-25 Michael Poole <md...@tr...> + + * ircd/channel.c (mode_parse): Accept +A/+U from servers + regardless of FEAT_OPLEVELS. + +2005-08-24 Michael Poole <md...@tr...> + + * ircd/ircd.c (parse_command_line): Mention epoll engine when run + with -v. + +2005-08-24 Michael Poole <md...@tr...> + + * include/patchlevel.h (PATCHLEVEL): Increment. + + * ircd/channel.c (joinbuf_join): Double check that oplevel is 0 or + 1 when propagating JOIN <level>:#channel, to avoid PV on receiver. + + * ircd/engine_epoll.c: Add system call numbers for more CPU types. + + * ircd/ircd_log.c (log_open): Remove NFS-oriented alarm() calls; + anyone who writes logs over NFS is mental. (Thanks to D. Bruce.) + +2005-08-21 Michael Poole <md...@tr...> + + * include/s_conf.h (free_mapping): Declare new function. + + * ircd/ircd_parser.y (pseudoblock): Use it. + + * ircd/s_conf.c (free_mapping): Define it. + (close_mappings): New function. + (rehash): Call close_mappings() before reading file. + + * ircd/m_kill.c (do_kill): Revert 2005-08-18 change. + +2005-08-19 Michael Poole <md...@tr...> + + * ircd/parse.c (tok_tree): Re-add token tree structure. + (initmsgtree): Populate it. + (parse_server): Prefer it to full message tree. + +2005-08-18 Michael Poole <md...@tr...> + + * ircd/m_kill.c (do_kill): When FEAT_HIS_KILLWHO, change apparent + source of KILLs to &his instead of &me. + +2005-08-16 Michael Poole <md...@tr...> + + * ircd/channel.c (mode_parse_ban): Avoid overwriting part of + newban->banstr[] when the source is a server. (Spotted by jcq.) + +2005-08-16 Michael Poole <md...@tr...> + + * ircd/channel.c (joinbuf_join): Switch to &his instead of &me for + announcements to local users in a channel. + + * ircd/m_burst.c (ms_burst): Likewise. + + * ircd/m_invite.c (m_invite): Likewise. + (ms_invite): Likewise. + + * ircd/m_kick.c (ms_kick): Likewise. + + * ircd/m_topic.c (do_settopic): Another &me -> &his change for + HIS, and use that apparent source for the channel localcast. + +2005-08-16 Jukka Ollila <jao...@ni...> + + * ircd/s_user.c (hide_hostmask): Use HIS_SERVERNAME instead of the + real thing for the post-mode-x rejoin. + +2005-08-15 Michael Poole <md...@tr...> + + * include/supported.h (FEATURESVALUES2): Add +d channel mode. + + * ircd/IPcheck.c (ip_registry_new_entry): Clarify that this is not + a varadic function. (Suggested by Ian Kumlien.) + + * ircd/convert-conf.c (finish_operators): Likewise. + + * ircd/listener.c (close_listeners): Likewise. + + * ircd/channel.c (CheckDelayedJoins): Use HIS server name to + remove channel mode +d. + +2005-08-12 Michael Poole <md...@tr...> + + * ircd/channel.c (pretty_mask): Recognize ':' as unique to the + host part of a ban mask. + +2005-08-03 Jan Krueger <ja...@he...> + + * ircd/m_kick.c (m_kick): Send JOIN prior to confirming KICK on + invisible member. + +2005-08-08 Michael Poole <md...@tr...> + + * ircd/channel.c (find_ban): For non-IPmask bans, match the ban + string against the string form of the client's IP address. + +2005-07-16 Michael Poole <md...@tr...> + + * configure.in: Apply a test for socklen_t that Reed found. + + * configure: Regenerate. + +2005-07-16 Michael Poole <md...@tr...> + + * RELEASE.NOTES: Mention that 2.10.11 does not support oplevels. + + * README.FreeBSD: Remove (merged into README). + + * README.Solaris: Remove (merged into README). + + * README: Merge in the above; also update for 2.10.12. + + * doc/example.conf: Change mention of K-lines to say Kill blocks + instead. + + * doc/iauth.txt: Remove (out of date). + + * doc/readme.features: Update to reflect that 2.10.11 is not the + current release. Change mention of various config lines to use + the equivalent config entries or blocks instead. + + * doc/readme.log: Likewise. + + * doc/api/features.txt: Change F-line mentions to say Feature + entry instead. + + * doc/api/modebuf.txt: Change U-line mention to say Uworld entry. + + * doc/api/motd.txt: Change T-line mentions to say Motd entry. + +2005-07-15 Michael Poole <md...@tr...> + + * ircd/ircd_features.c (feature_init): Always call + feature_notify_server*() so that 'his' is initialized. + + * ircd/m_whois.c (do_whois): Unswap sense of comparison to choose + between user->server and &his. + +2005-07-14 Michael Poole <md...@tr...> + + * ircd/channel.c (mode_parse_apass): Update oplevels when setting + or removing the +A password. Partial credit goes to Reed Loden. + +2005-07-14 Michael Poole <md...@tr...> + + * include/ircd_features.h: Declare new "his" pseudo-server to hold + FEAT_HIS_SERVERNAME and FEAT_HIS_SERVERINFO in a convenient place. + + * ircd/ircd_features.c: Initialize and update it. + + * ircd/channel.c (modebuf_flush_int): Use it as the apparent + source for opmodes and server mode changes (also when the source + is me). + + * ircd/m_burst.c (ms_burst): Use it as the apparent source for net + rider kicks. + + * ircd/m_whois.c (do_whois): Use it to simplify code here. + + * ircd/s_misc.c (exit_client): Use it as the apparent killer. + +2005-07-14 Michael Poole <md...@tr...> + + * doc/example.conf (General): Update comment about vhost to match + the code change below. + + * ircd/ircd_parser.y (generalvhost): Accept vhost="*"; as a + synonym for the default behavior (for backwards compatibility). + Spotted by Kev. + + * ircd/channel.c (sub1_from_channel): Remove stale code and + comment, replacing with an up-to-date comment. Spotted by skx. + +2005-07-11 Michael Poole <md...@tr...> + + * ircd/engine_select.c: Remove outdated comment about USE_POLL. + + * ircd/parse.c (msgtab): #if out CAP handler until we have caps. + + * RELEASE.NOTES: Remove mention of capabilities for now. + +2005-07-11 Stephan Peijnik <spe...@gm...> + + * ircd/gline.c (gline_add): It's only a protocol violation when a + server issues a "whacky" gline. If it's an oper, only tell opers + with SNO_GLINE. + + * ircd/ircd_auth.c (iauth_protocol_violation): Likewise, the whole + network is not likely to care about IAuth PVs, so only tell opers + with SNO_CONNEXIT. + +2005-07-11 Michael Poole <md...@tr...> + + * doc/readme.features: Document FEAT_CHANNELLEN. + + * doc/example.conf: Give an example of it. + + * ircd/m_join.c (ms_join): Do not clean channel names from remote + servers, to avoid desynchs. + + * ircd/m_names.c (ms_names): Likewise. + +2005-07-11 Stephan Peijnik <spe...@gm...> + + * include/ircd_features.h: Declare new FEAT_CHANNELLEN. + + * include/supported.h: Add it to the ISUPPORT display. + + * ircd/channel.c (clean_channelname): Impose the lower limit + between FEAT_CHANNELLEN and CHANNELLEN. + + * ircd/ircd_features.c: Define FEAT_CHANNELLEN. + +2005-07-11 Reed Loden <re...@re...> + + * include/sys.h: Move FD_SETSIZE redefinition to engine_select.c. + + * ircd/s_bsd.c: Move FD_SETSIZE sanity check to engine_select.c + Remove unused #include <sys/poll.h>. + + * ircd/engine_select.c: Put FD_SETSIZE redefinition and sanity + checks here, since they are not used elsewhere in the daemon. + [Order slightly changed by Michael Poole to compile.] + +2005-07-03 Michael Poole <md...@tr...> + + * ircd/convert-conf.c: New file. + + * ircd/Makefile: Compile it. + +2005-06-27 Michael Poole <md...@tr...> + + * ircd/s_bsd.c (add_connection): Split logic for server versus + client listeners; only do IPcheck for client connections. + + * ircd/s_serv.c (server_estab): There is no longer a need to + remove IPcheck reference, so don't. + +2005-06-27 Michael Poole <md...@tr...> + + * include/client.h (struct Connection): Remove con_dns_reply (and + associated macros). + + * include/res.h (gethost_byname): Change calling signature to + clarify memory ownership. + (gethost_byaddr): Likewise. + + * include/s_bsd.h (release_dns_reply): Remove function. + + * ircd/hash.c: #include "match.h" to quash warning. + + * ircd/ircd_auth.c (struct IAuth): Remove i_query field. + (iauth_dns_callback): Adjust for new gethost_byname signature. + (iauth_reconnect): Likewise. + + * ircd/ircd_res.c (struct reslist): Make elements of query field + inline rather than in a contained structure. + (make_request): Reflect removal of DNSQuery. + (do_query_name): Likewise. + (do_query_number): Likewise. + (make_dnsreply): Remove now-unused function. + (timeout_resolver): Adjust to new callback signature. + (delete_resolver_queries): Reflect removal of DNSQuery. + (gethost_byname): Update to new signature. + (gethost_byaddr): Likewise. + (res_readreply): Reflect removal of DNSReply. + + * ircd/list.c (dealloc_connection): con_dns_reply no longer + exists, so do not free it. + + * ircd/s_auth.c (auth_verify_hostname): constify. + (auth_dns_callback): Adjust to new callback signature. + (start_auth): Adjust to new gethost_byaddr() signature. + + * ircd/s_bsd.c (connect_dns_callback): Adjust to new callback + signature. + (release_dns_reply): Remove unused function. + (connect_server): Adjust to new gethost_byname() signature. + + * ircd/s_conf.c (conf_dns_callback): Adjust to new callback + signature. + (conf_dns_lookup): Adjust to new gethost_byname() signature. + (attach_iline): Use cli_sockhost() instead of DNS reply. + (conf_check_server): Simplify use of DNS results. + + * ircd/s_serv.c (server_estab): Remove call to removed function. + + * ircd/s_user.c (register_user): Remove call to removed function. + +2005-06-27 Michael Poole <md...@tr...> + + * include/s_misc.h (get_sockhost): Remove the unused (and + deceptively named) get_sockhost(). + + * ircd/s_misc.c (get_sockhost): Likewise. + +2005-06-25 Andrew Miller <a1...@am...> + + * ircd/ircd_crypt.c (ircd_crypt): strdup is not allowed, change to + DupStr so memdebug works. + + * doc/debug_memleak_gc.patch : Update to gc6.5 + +2005-06-24 Andrew Miller <a1...@am...> + * ircd/m_invite.c (m_invite): Don't propagate invites to local channels. + +2005-06-21 Andrew Miller <a1...@am...> + + * ircd/m_list.c (param_parse): Add support for channel wildcards. + * ircd/m_list.c (show_usage): Document the new format. + * ircd/hash.c (list_next_channels): Check channel wildcard in list. + * include/channel.h (ListingArgs): Add the wildcard member. + +2005-06-19 Andrew Miller <a1...@am...> + + * ircd/ircd_res.c (proc_answer): Deal with unexpected record types more + gracefully. + + * ircd/ircd_res.c (res_readreply): Check res_ourserver before walking + the pending request list, to make DoS attacks harder. + + * ircd/m_invite.c (m_invite): Give no such channel rather than not on + channel when the channel being invited to does not exist. + +2005-06-18 Michael Poole <md...@tr...> + + * ircd/s_debug.c (count_memory): Consolidate several lines; make + initial letter capitalization consistent. + +2005-06-19 Andrew Miller <a1...@am...> + + * ircd/s_stats.c: Remove the "debug only" label on memusage stats, + since it no longer applies. + +2005-05-16 Michael Poole <md...@tr...> + + * include/channel.h (struct Ban): Make 'who' and 'banstr' direct + arrays, rather than pointers. + + * ircd/channel.c (bans_alloc): New variable to count number of ban + structures allocated. + (bans_inuse): New variable to count number of ban structures + currently in use. + (set_banmask): Adapt to changes in struct Ban. + (make_ban): Likewise, and update ban counts. + (free_ban): Likewise. + (bans_send_meminfo): New function. + (apply_ban): Adapt to changes in struct Ban. + (mode_parse_ban): Likewise. + (mode_process_bans): Likewise. + (mode_parse): Likewise. + (RevealDelayedJoin): Fix brace placement. + (CheckDelayedJoins): Fix brace placement and whitespace. + + * ircd/list.c (struct liststats): Add new fields to eliminate the + separate count variables. + (init_list): Adapt to those changes. + (alloc_client): Likewise. + (dealloc_client): Likewise. + (alloc_connection): Likewise. + (dealloc_connection): Likewise. + (make_server): Likewise. + (remove_client_from_list): Likewise. + (verify_client_list): Likewise. + (make_link): Likewise. + (free_link): Likewise. + (send_liststats): New function. + (send_listinfo): Rewrite to use new struct liststats layout. + + * ircd/m_burst.c (ms_burst): Adapt to changes in struct Ban. + + * ircd/m_clearmode.c (do_clearmode): Adapt to changes in struct + Ban. + + * ircd/s_stats.c (stats_meminfo): Define unconditionally and call + bans_send_meminfo(). + (statsinfo): Always give access to stats_meminfo. + +2005-06-16 Michael Poole <md...@tr...> + + * include/ircd_string.h: Include necessary <string.h> header. + + * ircd/test/.cvsignore: Ignore log output files. + + * ircd/test/Makefile.in: Remove log output files. + + * ircd/test/kill-block-1.cmd: Add sleeps to try to trigger Kills. + + * ircd/test/run-tests.sh: Switch sense of argument. Send an IRC + debug dump to log files. + +2005-06-13 Michael Poole <md...@tr...> + + * ircd/s_user.c (make_user): Unconditionally increment userCount. + (free_user): Unconditionally decrement it here. + + * ircd/s_conf.c (make_conf): Unconditionally increment + GlobalConfCount. + (free_conf): Unconditionally decrement it here. + + * ircd/s_debug.c (count_memory): Fix termination condition for + ban-walking loop. Add missing "e" to "members". + + +2005-06-10 Michael Poole <md...@tr...> + + * ircd/match.c (check_if_ipmask): Strings that contain '?' cannot + be true IP masks. + +2005-05-30 Michael Poole <md...@tr...> + + * ircd/test/Makefile.in: Add LDFLAGS variable for profiling purposes. + + * ircd/test/ircd_match_t.c: Test recovery from backtracking. + + * ircd/test/channel-1.cmd: Modify to improve code coverage. + + * ircd/test/client-1.cmd: Likewise. + + * ircd/test/gline-1.cmd: Likewise. + + * ircd/test/ircd-t1.conf: Likewise. + + * ircd/test/stats-1.cmd: Likewise. + + * ircd/test/run-tests.sh: Explicitly start ircds. Add new test scripts. + + * ircd/test/test-driver.pl: Silently handle more signals from IRC. + + * ircd/test/commands-1.cmd: New test script. + + * ircd/test/feature-1.cmd: New test script. + + * ircd/test/jupe-1.cmd: New test script. + + * ircd/test/kill-block-1.cmd: New test script. + + * ircd/test/ircd-t1-2.conf: New configuration file for test scripts. + + * ircd/test/ircd-t2.conf: Likewise. + +2005-05-30 Michael Poole <md...@tr...> + + * ircd/s_debug.c (count_memory): Use count_listener_memory() to + report memory used by listener structures. + +2005-05-30 Michael Poole <md...@tr...> + + * include/class.h (get_con_freq): Remove unused function. + + * include/list.h (find_user_link): Remove unused function. + + * include/class.c (get_con_freq): Remove. + + * ircd/list.c (find_user_link): Remove. + + * include/string.h (string_is_hostname, string_is_address, + strnChattr): Remove unused functions. + (init_string): Remove function that becomes a noop. + + * ircd/string.h (init_string): Remove. + (string_is_hostname, string_is_address, strnChattr): Likewise. + + * ircd/ircd.c (main): Remove call to init_string(). + +2005-05-30 Michael Poole <md...@tr...> + + * include/numeric.h (RPL_TRACELOG, RPL_MYPORTIS, + RPL_NOTOPERANYMORE): Undefine unused numeric replies. + + * ircd/s_err.c (replyTable): Fix format fields for certain numeric + arguments. Remove some unused entries. + + * ircd/s_stats.c (stats_configured_links): Move invariant + parameters to message format string. + +2005-05-30 Michael Poole <md...@tr...> + + * ircd/client.c (privtab): Add missing LIST_CHAN privilege, move + WIDE_GLINE to reflect its enumerated value. + + * ircd/s_debug.c (count_memory): Use user_count_memory() function + to count User structs in-use. + + * ircd/m_server.c (mr_server): Change "C:line" to "Connect block". + + * ircd/s_bsd.c (connect_server): Likewise. + + * ircd/s_conf.c (conf_check_server): Likewise. + + * ircd/s_err.c (replyTable): Change "O-lines" to "Operator block". + +2005-05-30 Michael Poole <md...@tr...> + + * ircd/match.c (match): Rewrite to handle globs that end in an + escaped wildcard (and hopefully clarify the code). + + * ircd/test/Makefile.in: Add new ircd_match_t test program. + + * ircd/test/ircd_match_t.c: New file. + + * ircd/test/test_stub.c: Emite newlines after log and debug + messages. + +2005-05-25 Reed Loden <re...@re...> + + * ircd/s_err.c (replyTable): Allow for the specification of 'O' or + 'o' in RPL_STATSOLINE. + + * ircd/s_stats.c (stats_configured_links): In /stats o/O, display + 'O' if either the oper block or the connection class has + PRIV_PROPAGATE (global oper) and 'o' if neither has PRIV_PROPAGATE + (local oper). + +2005-05-30 Michael Poole <md...@tr...> + + * ircd/IPcheck.c: Add Debug()s to try to track why the connected + count underflows. + + * ircd/m_endburst.c (ms_endofburst): Avoid dereferencing 'chan' + after it may be freed (in sub1_from_channel). + + * ircd/s_user.c (register_user): Rearrange code to reduce number + of "if (MyConnect(sptr))" checks. + +2005-05-12 Michael Poole <md...@tr...> + + * configure.in: Do not try to outsmart the default CFLAGS. + Simply add parameters explicitly requested by the user. + + * configure: Regenerate. + + * ircd/ircd_crypt_native.c: Use _XOPEN_SOURCE 600 (which is + used in os_generic.c) to get crypt() on NetBSD. + +2005-05-11 Kevin L. Mitchell <kl...@mi...> + + * ircd/ircd.c: if debugging is enabled (both DEBUGMODE defined and + -x given), reserve fd 2 for the use of the debugging log; + otherwise, some engines may attempt to use fd 2, which would end + up getting closed by debug_init() (actually, by + log_debug_reopen(), called by log_debug_init(), called by + debug_init()) + +2005-08-10 Michael Poole <md...@tr...> + + * ircd/channel.c (joinbuf_join): Do not send a MODE +o when a + local user creates a channel. + + * ircd/umkpasswd.c (crypt_pass): Allocate the proper amount of + memory for the tagged output string. + + * ircd/test/test-driver.pl: Add -vhost=... option. + + * ircd/test/ircd-t1.conf: Add new Operator blocks. + + * ircd/test/*.cmd: Rearrange and add more coverage tests. + +2005-08-09 Michael Poole <md...@tr...> + + * ircd/ircd_parser.y: Move error tokens to top level of parse, and + make ';' a synchronizing token for them. This avoids crashes in + situations like missing ';' between two Kill blocks. Move several + ';'s earlier for earlier detection of syntax errors. + + * ircd/motd.c (motd_memory_count): Use size_t for memory counts to + match the format strings used for those variables. + + * ircd/msgq.c (msgq_histogram): tmp.sizes[] is an array of + unsigned int, not unsigned long; use correct format string. + + * ircd/s_stats.c (stats_crule_list): Restore display of 'D' vs 'd' + based on crule type, rather than query type. + (statsinfo): Remove STAT_FLAG_VARPARAM from the "modules" and + "help" stats, which don't use the varparam. + + * ircd/test/test-driver.pl: Interpreter for test scripts.b + + * ircd/test/ircd-t1.conf: Configuration file for test scripts. + + * ircd/test/*.cmd: New test scripts for test-driver.pl. + +2005-05-08 Jukka Ollila <jao...@ni...> + (Adapted slightly by Michael Poole.) + + * ircd/os_generic.c (sockaddr_to_irc): Change to use v4compat + addresses event when !defined(IPV6). + +2005-05-07 Michael Poole <md...@tr...> + + * ircd/channel.c (joinbuf_join): Be smarter about what source to + use when opping a user that joins a channel. + +2005-05-04 Reed Loden <re...@re...> + + * ircd/m_trace.c (do_trace): Show the real nickname instead of the + numnick. + +2005-05-02 Jan Krueger <ja...@he...> + + * ircd/channel.c (member_can_send_to_channel): if the channel can only + be joined by users with accounts (+r), do not allow users without + accounts to speak. + +2005-05-07 Michael Poole <md...@tr...> + + * ircd/numnicks.c (base64toip): Fix bugs in parsing IPv6 + addresses. + * ircd/test/ircd_in_addr_t.c (test_addrs): Add new entry. + (test_address): Test base64toip() as well. + +2005-05-05 Michael Poole <md...@tr...> + + * ircd/s_user.c (umode_str): Only clear the operator flag when not + propagating; never set it. + +2005-05-04 Michael Poole <md...@tr...> + + * ircd/channel.c (joinbuf_join): Include channel manager flag in + determination of oplevel. If opping the user for a non-local + non-create, include oplevel in message to other servers. Send + "MODE +o <client>" to local users whenever opping the client. + + * ircd/m_join.c (m_join): Remove logic that moved into + joinbuf_join(). + (ms_join): Look for level 0 and 1 joins from remote servers + and adjust value of 'flags' appropriately. + +2005-05-04 Michael Poole <md...@tr...> + + * include/numeric.h: Remap oplevel numerics to new range. + + * ircd/s_err.c: Likewise. + +2005-05-03 Michael Poole <md...@tr...> + + * ircd/s_stats.c (stats_access): Update to use new CONF_CLIENT + fields, fixing crash found by nighty. + +2005-05-02 Michael Poole <md...@tr...> + + * include/numeric.h (ERR_UPASS_SAME_APASS): New error message when + trying to set +U pass to the same as the +A pass. + + * ircd/channel.c (mode_parse_upass): Use it. + + * ircd/ircd_auth.c (iauth_exit_client): Only send ExitUser if + there is an active IAuth connection, fixing PR#1193808. + (iauth_dispose_request): Only delete the timer if it is active. + + * ircd/m_invite.c (m_invite): Always forward the invite in the + correct direction, and then skip it as 'one' if announcing. + (ms_invite): Likewise. + + * ircd/numnicks.c (base64toip): Do not interpret AAAAAA as + ::ffff:0.0.0.0; keep it as ::. + + * ircd/s_err.c (replyTable): Add ERR_UPASS_SAME_APASS. + +2005-05-01 Michael Poole <md...@tr...> + + * doc/readme.log: Document IAUTH log target, remove docs for + OLDLOG log target. + + * include/ircd_log.h: Add LS_IAUTH target, remove LS_OLDLOG. + + * ircd/ircd_log.c (logDesc): Likewise. + + * ircd/engine_epoll.c (engine_loop): Handle EPOLLHUP for all + sockets (e.g. when connecting) and do not generate read/write + events in the same pass as error or EOF events. + + * ircd/ircd_auth.c: Convert old sendto and debug messages to use + the LS_IAUTH log target. Consistently use IAUTH_CONNECTED flag + instead of comparing fd to -1. + (iauth_reconnect): If already connected, disconnect and schedule a + reconnect later, since an immediate reconnect can cause assertion + failure in the event engine. Also schedule a reconnect when the + connection attempt fails. + (iauth_read): Reconnect on IO_FAILURE. + (iauth_sock_callback): Disconnect and schedule a reconnect on both + error (after reporting the error) and EOF. + (iauth_start_client): Record the IAuth request in the client. + (iauth_exit_client): Report the client exit. + + * ircd/s_misc.c (exit_one_client): Fix formatting. + +2005-04-30 Michael Poole <md...@tr...> + + * ircd/ircd_auth.c (iauth_connect): Initialize (but do not add) + timer here and set fd to -1. + (iauth_schedule_reconnect): Rewrite to handle previously + initialized timer. + (iauth_reconnect): If server is connected, disconnect first. + Update socket generator fd before calling socket_add(). + (iauth_read): When reading 0 bytes (EOF), reconnect. + +2005-04-27 Michael Poole <md...@tr...> + + * ircd/ircd_parser.y: Report non-existent class names as errors + earlier, and do not fall back to "default" for Client blocks. + +2005-04-25 Reed Loden <re...@re...> + + * ircd/ircd_lexer.l: Add missing header to squash a warning. + +2005-04-25 Michael Poole <md...@tr...> + + * ircd/s_user.c (register_user): Replace call with set_user_mode() + with a direct parsing of user modes. To match this, revert the + initial display of usermode to how it was done before. + +2005-04-24 Michael Poole <md...@tr...> + + * doc/example.conf: Document new autoconnect field of Connect. + + * include/s_conf.h: Add CONF_AUTOCONNECT and field for it. + + * ircd/ircd.c (try_connections): Skip non-autoconnect servers. + + * ircd/ircd_lexer.l: Recognize autoconnect token. + + * ircd/ircd_parser.y: Add autoconnect= option to Connect block. + + * ircd/m_invite.c (m_invite): Avoid sending channel timestamp to + user being invited. + (ms_invite): Likewise. + + * ircd/s_user.c (register_user): Show class name rather than + pointer-as-integer. + +2005-04-24 Michael Poole <md...@tr...> + + * ircd/ircd_parser.y: Rewrite so each error condition gets its own + error message, and so that invalid parameters are printed out. + +2005-04-23 Michael Poole <md...@tr...> + + * ircd/channel.c (apply_ban): Consistently free newban->banstr + when the function fails. + (mode_process_bans): Free banstr for all BAN_DEL bans. + + * ircd/ircd_parser.y: Fix a few memory leaks from previous commit. + +2005-04-23 Michael Poole <md...@tr...> + + * include/patchlevel.h: Bump to being a beta. + + * ircd/ircd_lexer.l (QSTRING): Return a copy of the string so that + parser actions don't have to be immediately after a QSTRING. + + * ircd/ircd_parser.y (FNAME): Remove unused token. + (QSTRING): Adjust for QSTRING being an already-copied version. + +2005-04-23 Michael Poole <md...@tr...> + + * doc/example.conf (UWorld): Illustrate new config extension. + + * ircd/ircd_parser.y (uworldblock): Do the expected thing when + multiple name= entries are present. + +2005-04-22 Michael Poole <md...@tr...> + + * RELEASE.NOTES: Silence exceptions use ~, not -. Oops! + + * doc/example.conf: Fix typo in example Kill block. + + * ircd/channel.c (mode_parse_ban): Use correct test for flag_p. + + * ircd/m_silence.c (apply_silence): Make mask pretty so that later + processing does not convert * to @ (and match no one). + +2005-04-21 Kevin L. Mitchell <kl...@mi...> + + * ircd/m_userip.c (userip_formatter): /userip should *never* + report the user's real IP unless its answering the user + him/herself + + * ircd/m_userhost.c (userhost_formatter): /userhost should *never* + report the user's real host unless its answering the user + him/herself + +2005-04-20 Michael Poole <md...@tr...> + + * ircd/ircd.c (parse_command_line): Update usage text. + + * ircd/numnicks.c (base64toip): Use v4mapped address range instead + of v4compat address range, fixing IPv4-based /who. + +2005-04-19 Michael Poole <md...@tr...> + + * configure.in: When --enable-profile, add -pg to LDFLAGS. + + * configure: Regenerate. + +2005-04-19 Michael Poole <md...@tr...> + + * ircd/match.c (check_if_ipmask): Fix brown-paper-bag typo. + + * ircd/s_conf.c (conf_debug_iline): Look for matching Kill blocks + once a matching Client block is found. + + * ircd/m_whowas.c (m_whowas): Change strcmp() to ircd_strcmp(). + +2005-04-18 Michael Poole <md...@tr...> + + * ircd/match.c (check_if_ipmask): Do not interpret masks that + start with . or / as IP-based host masks. + +2005-04-17 Michael Poole <md...@tr...> + + * ircd/channel.c (mode_process_clients): Only prohibit deops of + users with the same or higher oplevel where apass is set. + Likewise, when opping users, give them MAXOPLEVEL for non-apass + channels. + (joinbuf_join): Give new ops MAXOPLEVEL for non-apass channels. + + * ircd/m_kick.c (m_kick): Only prohibit kicks of users with the + same or higher oplevel where apass is set. + + * ircd/s_user.c (register_user): Fix order of server version vs + various mode strings. + + * tools/linesync/linesync.sh: Add revision id field. + +2005-04-17 Michael Poole <md...@tr...> + + * tools/linesync/linesync.sh: Fix typo comment. Check for + multiple blocks per line in the linesync input. + +2005-04-17 Dan <da...@un...> + + * tools/linesync/linesync.sh: Update to support new syntax and to + avoid rehashing the ircd when the config is the same. + + * tools/linesync/linesync.conf: Update allowed conf items. + +2005-04-16 Michael Poole <md...@tr...> + + * doc/example.conf (Kill): Document newly supported syntax. + + * include/s_conf.h (DenyConf): Split realname mask into its own + field. Remove the unused DENY_FLAGS_{IP,REALNAME}. + + * ircd/ircd_parser.y (Kill): Only require one of usermask, + hostmask, realmask to be set for a valid block. + (killitem): Add new production killusername. + + * ircd/s_conf.c (conf_erase_deny_list): Free realmask field. + (find_kill): Rearrange slightly to clarify control flow. + + * ircd/s_err.c (RPL_STATSKLINE): Stick usermask before hostmask, + so the old usermask field can be adopted for realname mask. Add + double quotes around the realmask field. + + * ircd/s_stats.c (report_deny_list): Do so. + (stats_klines): Likewise. + +2005-04-17 Perry Lorier <is...@un...> + + * tools/convert-conf.py: Fix lots of conversion problems with + oper privielges (now they are converted), + features (deprecated features commented out, most converted to + priviliges), + realname klines (also add host= lines) + quarintines (generate blocks for them), + connect blocks (don't generate empty port config lines) + etc... + +2005-04-16 Michael Poole <md...@tr...> + + * ircd/gline.c (do_gline): Fix typo when activating IP-based + G-lines. + +2005-04-16 Michael Poole <md...@tr...> + + * ircd/class.c (free_class): Free default_umode field. + + * ircd/ircd_parser.y (classblock): Free default_umode field before + overwriting it. + + * ircd/s_conf.c (free_conf): Free username, origin_name, hub_limit + fields. + (find_kill): Realname Kill blocks no longer have $R at the start, + so do not skip over the first two characters of the mask. + +2005-04-15 Michael Poole <md...@tr...> + + * doc/example.conf (Operator): Properly qualify plaintext password. + (Quarantine): Document (new) syntax. + + * ircd/ircd.c: Add <sys/time.h> to make <sys/resource.h> compile + correctly on BSDs. + + * ircd/ircd_parser.y (qconf): Remove global variable. + (killuhost): Null terminate username when present. + (quarantineblock): Replace with a syntax that works. + + * ircd/s_stats.c: #include <querycmds.h> for UserStats. + (stats_server_verbose): Reinstate check for UserStats. + +2005-04-09 Kevin L. Mitchell <kl...@mi...> + + * ircd/ircd.c: conditionally include sys/resource.h; otherwise, + RLIMIT_CORE will not be defined and so set_core_limit() will never + be defined, much less run. + + * configure.in: add sys/resource.h to the list of headers to + search for + + * configure: regenerate configure + + * config.h.in: rerun autoheader to add HAVE_SYS_RESOURCE_H to + config.h.in + +2005-04-08 Michael Poole <md...@tr...> + + * include/s_conf.h (conf_debug_iline): Declare new function. + + * ircd/ircd.c (dbg_client): New file-scoped variable. + (parse_command_line): Set it from the new -c option. + (main): If dbg_client is set during chkconf, use it. + + * ircd/ircd_string.c (ircd_aton): Generate IPv4-mapped addresses, + not IPv4-compatible addresses, to match ipmask_parse(). + + * ircd/m_whowas.c (m_whowas): Split display of real host to a + separate line, in hopes of not confusing opers in the future. + + * ircd/s_conf.c (conf_debug_iline): Implement new function. + +2005-04-06 Michael Poole <md...@tr...> + + * ircd/m_burst.c (ms_burst): Clear channel manager bit when wiping + out locally opped and voiced channel members. + +2005-04-06 Michael Poole <md...@tr...> + + * include/numeric.h (RPL_APASSWARN): Replace with three distinct + values. + (ERR_NOMANAGER_LONG): Assign new numeric. + (ERR_NOMANAGER_SHORT): Assign new numeric. + + * ircd/channel.c (parse_mode_upass): Adapt to new formats for + ERR_NOTMANAGER separation. + (parse_mode_apass): Likewise. Also adapt to RPL_APASSWARN split. + + * ircd/s_err.c (RPL_APASSWARN): Replace with three message + strings, to avoid embedding long message strings in the logic + implementation. + (ERR_NOTMANAGER): Likewise (but not the same strings). + +2005-04-06 Michael Poole <md...@tr...> + + * ircd/ircd_parser.y (clientblock): Use the password field. + + * ircd/s_user.c (register_user): Allow aconf->password to be a + single digit, since per-IP limit is now in a separate field. + +2005-04-06 Michael Poole <md...@tr...> + + * acinclude.m4 (unet_PIPE_CFLAGS): Remove; -pipe is obsolete in + current gcc releases and is slower than files for previous + releases on most OSes. + + * configure.in (AC_PREREQ): Bump to 2.59 because of AS_HELP_STRING. + (unet_PIPE_CFLAGS): Remove use of macro. + + * aclocal.m4: Regenerate. + + * configure: Likewise. + +2005-04-04 Michael Poole <md...@tr...> + + * configure.in: For developers' ease, allow passing an option to + configure to persistently set optimization CFLAGS. + + * configure: Regenerate. + +2005-04-04 Michael Poole <md...@tr...> + + * doc/example.conf (Jupe): Make the default Jupe block follow + CFV-0255. (Thanks to FrankP for pointing me at this and to DinTn + for getting me a copy of the CFV.) + +2005-04-04 Michael Poole <md...@tr...> + + * include/capab.h (CAPFL_STICKY): Define. + (CAPLIST): Remove the entries used for testing. + + * include/client.h (Connection): Clarify comment about the + distinction between con_capab and con_active. + + * ircd/m_cap.c: Add doxygen comments and replace the long + discussion of m_handler functions with an xref to it. + (send_caplist): Add new parameters and change the terminal vs + non-terminal line distinction to make compliant with current draft + specification. + (cap_empty): Rename to cap_ls(). + (cap_req): Track modified capabilities bitwise, so that the + responding ACK contains all the appropriate flags. + (cap_ack): Add comment explaining why there is no response. + (cap_clear): Build and send a list of cleared capabilities, as + required by the current draft. + (cap_list): Send capability list using LIST subcommand. + (cmdlist): Add handler for LS subcommand. Remove entries for the + empty and LSL subcommands, which are no longer allowed. + (m_cap): Require at least one argument from user. + +2005-04-01 Michael Poole <md...@tr...> + + * include/s_conf.h (SMAP_FAST): Define. + (s_map): Add 'flags' field. + + * ircd/ircd_lexer.l: Recognize 'FAST' token. + + * ircd/ircd_parser.y (FAST): New token. + (pseudoitem): Add pseudoflags alternative. + (pseudoflags): New production, recognizing FAST token. + + * ircd/parse.c (register_mapping): Set MFLG_SLOW conditionally. + Remove outdated comment. + +2005-04-01 Michael Poole <md...@tr...> + + * include/handlers.h (ms_privs): Declare. + + * include/msg.h (TOK_PRIVS): Assign token. + (CMD_PRIVS): Define. + + * ircd/m_privs.c: Add doxygen comments and replace the long + discussion of m_handler functions with an xref to it. + (mo_privs): Forward requests for non-local users + to their own server. + (ms_privs): Implement. + + * ircd/parse.c (PRIVS): Dispatch to ms_privs when a server sends + the message. + +2005-03-30 Michael Poole <md...@tr...> + + * include/client.h (struct Client): Explain where cli_username + comes from. + + * include/struct.h (struct User): Explain where this username + comes from, too + + * ircd/ircd_res.c (timeout_resolver): Update parameter name in + Doxygen comment, too. + + * ircd/s_misc.c (get_client_name): Reorganize to have less + indentation and behave like 2.10.11 when client is not idented. + +2005-03-29 Michael Poole <md...@tr...> + + * doc/example.conf: Remove no-longer-used HIS_STATS_h. + + * doc/readme.features: Likewise. + + * include/ircd_features.h: Likewise. + + * ircd/ircd_features.c: Likewise. + +2005-03-20 Reed Loden <re...@re...> + + * include/ircd_features.h: Alphabetize HIS_STATS_? features. + + * ircd/ircd_features.c: Likewise. + +2005-03-29 Michael Poole <md...@tr...> + (The previously unapplied part of another patch (by Carlo Wood?).) + + * ircd/m_part.c (ms_part): Remove a check that should already be + done by the user's own server. + +2005-03-29 Michael Poole <md...@tr...> + + * doc/example.conf: Add HIS_STATS_J entry. + + * doc/readme.features: Likewise. + +2005-03-25 Reed Loden <re...@re...> + + * include/hash.h: Add needed prototypes for new + stats_nickjupes() function. + + * include/ircd_features.h: Add FEAT_HIS_STATS_J. + + * include/numeric.h: Add RPL_STATSJLINE (222) for new nick + jupes stats. Correct a typo in a comment. + + * ircd/hash.c: Add stats_nickjupes() function to report all + nick jupes to an oper. Because of the nature of hash tables, + there is no way to sort this list so the results look weird. + + * ircd/ircd_features.c: Add FEAT_HIS_STATS_J (default: TRUE). + + * ircd/s_err.c: Add RPL_STATSJLINE (222) for new nick jupes + stats. + + * ircd/s_stats.c: Add RPL_STATSJLINE (222) for new nick jupes + stats. Make 'j' case sensitive. Modify the comment for stats + uworld. + +2005-03-27 Michael Poole <md...@tr...> + + * ircd/m_burst.c (ms_burst): Do not send numeric oplevels in a -A + channel when forwarding a channel burst line. + +2005-03-25 Michael Poole <md...@tr...> + + * ircd/m_server.c (set_server_flags): New function. Unlike the + old code, this recognizes the IPv6 flag. (Spotted by Reed.) + (mr_server): Use the new function. + (ms_server): Likewise. Also don't show "Net junction:" message if + any closer server is still bursting (also spotted by Reed). + Finally, forward the +6 flag to other servers. + + * ircd/s_serv.c (server_estab): Forward the +6 flag here, too. + + * ircd/s_bsd.c (client_sock_callback): Re-set cli_error() after it + may be cleared by completed_connection(). + +2005-03-23 Michael Poole <md...@tr...> + + * ircd/m_burst.c (ms_burst): Remove limit and keys when a channel + is wiped out during burst. + +2005-03-22 Michael Poole <md...@tr...> + + * ircd/ircd_res.c (check_resolver_timeout): I give up. Use the + kludgy earlier version of the timeout fix. + +2005-03-22 Michael Poole <md...@tr...> + + * ircd/channel.c (send_channel_modes): Fix test for when to send + membership mode suffix, to avoid sending it more than once. + +2005-03-22 Michael Poole <md...@tr...> + (Many thanks to nex and Reed for helping hunt this down and + doing the testing of various patches.) + + * ircd/ircd_events.c (timer_chg): Properly change a timer that is + in the middle of executing its expiration event. + + * ircd/ircd_res.c (check_resolver_timeout): Simplify the test for + whether to use timer_chg() or timer_add(). + On second thought, use timer_add() unconditionally; the server + connection loop does. + (timeout_resolver): Do not try to re-schedule the DNS timeout + unless it is the expiration event. + (do_query_number): Properly initialize request->state. + (res_readreply): Mention the response code that was bad. + +2005-03-22 Michael Poole <md...@tr...> + + * ircd/engine_kqueue.c (engine_delete): The kernel removes + close()'d FDs from the activity list, so don't try to remove the + FD here (the caller may have already close()'d it). + +2005-03-20 Michael Poole <md...@tr...> + + * ircd/IPcheck.c: Fix typos in comments and strings to reduce + future slumming for credit. + + * ircd/channel.c, ircd/crule.c, ircd/engine_epoll.c: Likewise. + * ircd/fileio.c, ircd/hash.c, ircd/ircd.c: Likewise. + * ircd/ircd_auth.c, ircd/ircd_crypt.c: Likewise. + * ircd/ircd_crypt_native.c, ircd/ircd_crypt_smd5.c: Likewise. + * ircd/ircd_features.c, ircd/ircd_log.c: Likewise. + * ircd/ircd_parser.y, ircd/ircd_res.c: Likewise. + * ircd/ircd_reslib.c, ircd/ircd_string.c, ircd/list.c: Likewise. + * ircd/m_burst.c, ircd/m_clearmode.c, ircd/m_destruct.c: Likewise. + * ircd/m_invite.c, ircd/m_ison.c, ircd/m_kill.c: Likewise. + * ircd/m_server.c, ircd/m_squit.c, ircd/m_topic.c: Likewise. + * ircd/m_who.c, ircd/m_whois.c, ircd/m_whowas.c: Likewise. + * ircd/match.c, ircd/msgq.c, ircd/numnicks.c: Likewise. + * ircd/os_generic.c, ircd/parse.c, ircd/s_auth.c: Likewise. + * ircd/s_bsd.c, ircd/s_conf.c, ircd/s_debug.c: Likewise. + * ircd/s_misc.c, ircd/s_numeric.c, ircd/s_serv.c: Likewise. + * ircd/s_stats.c, ircd/s_user.c, ircd/table_gen.c: Likewise. + * ircd/umkpasswd.c, ircd/uping.c, ircd/whowas.c: Likewise. + + * ircd/test/test_stub.c: Make exit_client() argument list + consistent with that in s_misc.c so doxygen is not confused. + +2005-03-20 Michael Poole <md...@tr...> + (Thanks to Reed Loden for pointing these out.) + + * ircd/channel.c: Fix typos in comments. + + * ircd/m_create.c: Likewise. + + * ircd/m_list.c: Likewise. + + * ircd/m_names.c: Likewise. + + * ircd/numnicks.c: Likewise. + + * ircd/s_bsd.c: Likewise. + +2005-03-20 Michael Poole <md...@tr...> + (Thanks to Reed Loden for pointing these out.) + + * doc/Configure.help: Remove outdated file. + + * doc/exaconf.2: Likewise. + + * doc/snomask.html: Add missing <tr>, SNO_AUTO, SNO_DEBUG, and + update SNO_OPERDEFAULT list. + + * tools/mkpasswd.c: Remove outdated file (use ircd/umkpasswd + instead). + + * tools/Makefile.crypt: Remove outdated file. + + * tools/mkpasswd.c: Likewise. + + * tools/transition: Likewise. + +2005-03-19 Michael Poole <md...@tr...> + + * ircd/channel.c (sub1_from_channel): Check apass rather than mode + to determine whether an apass is set (MODE_KEY/APASS/UPASS are not + set in mode.mode). + (send_channel_modes): Use the same change when determining how to + send oplevels for channels. + +2005-03-19 Michael Poole <md...@tr...> + + * include/IPcheck.h (IPcheck_connect_fail): Take a Client + parameter instead of irc_in_addr. + + * ircd/IPcheck.c (IPcheck_connect_fail): Likewise. Assert that + the client has been IP-checked. + (IPcheck_remote_connect): Assert that the client has not yet been + charged for connecting. + (IPcheck_connect_succeeded): Assert that the client has been + charged for connecting. + (IPcheck_disconnect): Likewise. + + * ircd/m_nick.c (m_nick): Pass rejected client to + IPcheck_connect_fail() when somebody takes the nick first. + (ms_nick): Likewise. + + * ircd/s_serv.c (server_estab): Pass new server to + IPcheck_connect_fail(). + + * ircd/s_user.c (register_user): When rejecting a user, pass + the struct Client to IPcheck_connect_fail(). + +2005-03-19 Michael Poole <md...@tr...> + + * doc/example.conf (Connect): Remove a buggy comment about leaf + directives; refer the reader to the Connect block instead. + + * tools/convert-conf.py: Set "leaf;" rather than "leaf = yes;" + +2005-03-19 Michael Poole <md...@tr...> + + * doc/example.conf (Operator): Correct the comment explaining + hashed passwords. + + * ircd/m_oper.c (oper_password_match): Check correct variable to + determine whether the hashed password matched. + 2005-03-08 Michael Poole <md...@tr...> * ircd/match.c (ipmask_parse): Explicitly zero-initialize the mask ----------------------- End of diff ----------------------- |
From: Toni G. <zo...@us...> - 2005-09-01 11:34:14
|
CVSROOT : /cvsroot/irc-dev Module : ircd-ircdev Commit time: 2005-09-01 11:34:08 UTC Modified files: TODO.es Log message: Mas TODO ---------------------- diff included ---------------------- Index: ircd-ircdev/TODO.es diff -u ircd-ircdev/TODO.es:1.28 ircd-ircdev/TODO.es:1.29 --- ircd-ircdev/TODO.es:1.28 Wed Jun 22 03:01:25 2005 +++ ircd-ircdev/TODO.es Thu Sep 1 04:33:58 2005 @@ -1,7 +1,7 @@ # # TODO para ircd-ircdev # -# $Id: TODO.es,v 1.28 2005/06/22 10:01:25 zolty Exp $ +# $Id: TODO.es,v 1.29 2005/09/01 11:33:58 zolty Exp $ # # Insertar las nuevas entradas al principio de la lista TODO. # @@ -15,7 +15,7 @@ ALTA PRIORIDAD -------------------------------------------------------------------------------------- - [G] Soporte de E-lines (excepciones a K-lines). - - [G] Modo +X de ver ips. + - [G] Modo +X de ver ips. Hacerlo por privilegios daria problemas. - [G] Modo +R de usuarios. - [G] ¿Modo +M de canales?. - [G] Poner uuna Feature para elegir entre salir o no el nombre del servidor en los @@ -98,7 +98,8 @@ -------------------------------------------------------------------------------------- 15/Mar/2005 - [G] Bajo en ciertas circunstancias desconocidas del ircd.conf no pueden - entrar clientes al IRCD. Investigar eso. + entrar clientes al IRCD. Investigar eso. Parece ser que si se pilla el + sample en castellano y no funciona pero... si comentas lo iauth entonces ya funciona. 26/May/2005 - [D] Los cambios de modos en canal, a veces hay desyncs. Investigar el origen - [D] Antes de un netjoin, un /mode #canal mostraba +r, despues ya no. ----------------------- End of diff ----------------------- |
From: Toni G. <zo...@us...> - 2005-09-01 11:25:59
|
CVSROOT : /cvsroot/irc-dev Module : ircd-ircdev Commit time: 2005-09-01 11:25:52 UTC Modified files: ChangeLog ChangeLog.es RELEASE.NOTES RELEASE.NOTES.es configure configure.in doc/ircd.sample-en.conf doc/ircd.sample-es.conf doc/en/features.txt doc/en/log.txt doc/en/api/features.txt doc/en/api/modebuf.txt doc/en/api/motd.txt include/channel.h include/ircd_features.h include/numeric.h include/patchlevel.h include/s_conf.h include/supported.h include/sys.h ircd/IPcheck.c ircd/channel.c ircd/class.c ircd/engine_epoll.c ircd/engine_select.c ircd/gline.c ircd/ircd.c ircd/ircd_auth.c ircd/ircd_features.c ircd/ircd_log.c ircd/ircd_parser.y ircd/listener.c ircd/m_burst.c ircd/m_join.c ircd/m_kick.c ircd/m_trace.c ircd/parse.c ircd/s_bsd.c ircd/s_conf.c ircd/s_err.c Log message: Author: zoltan <zo...@ir...> Log message: 2005-09-01 Toni García <zo...@ir...> 1.0.alpha43 * Sincronización Undernet ---------------------- diff included ---------------------- Index: ircd-ircdev/ChangeLog diff -u ircd-ircdev/ChangeLog:1.44 ircd-ircdev/ChangeLog:1.45 --- ircd-ircdev/ChangeLog:1.44 Sun Jul 3 13:21:41 2005 +++ ircd-ircdev/ChangeLog Thu Sep 1 04:25:42 2005 @@ -1,10 +1,13 @@ # # ChangeLog for ircd-ircdev # -# $Id: ChangeLog,v 1.44 2005/07/03 20:21:41 zolty Exp $ +# $Id: ChangeLog,v 1.45 2005/09/01 11:25:42 zolty Exp $ # # Insert new changes at beginning of the change list. # +2005-09-01 Toni García <zo...@ir...> 1.0.alpha43 + * Undernet synchronization + 2005-07-03 Toni García <zo...@ir...> 1.0.alpha42 * Undernet synchronization Index: ircd-ircdev/ChangeLog.es diff -u ircd-ircdev/ChangeLog.es:1.44 ircd-ircdev/ChangeLog.es:1.45 --- ircd-ircdev/ChangeLog.es:1.44 Sun Jul 3 13:21:41 2005 +++ ircd-ircdev/ChangeLog.es Thu Sep 1 04:25:42 2005 @@ -1,10 +1,13 @@ # # Log de Cambios para ircd-ircdev # -# $Id: ChangeLog.es,v 1.44 2005/07/03 20:21:41 zolty Exp $ +# $Id: ChangeLog.es,v 1.45 2005/09/01 11:25:42 zolty Exp $ # # Insertar los nuevos cambios al principio de esta lista de cambios. # +2005-09-01 Toni García <zo...@ir...> 1.0.alpha43 + * Sincronización Undernet + 2005-07-03 Toni García <zo...@ir...> 1.0.alpha42 * Sincronización Undernet Index: ircd-ircdev/RELEASE.NOTES diff -u ircd-ircdev/RELEASE.NOTES:1.2 ircd-ircdev/RELEASE.NOTES:1.3 --- ircd-ircdev/RELEASE.NOTES:1.2 Sat Apr 23 08:57:00 2005 +++ ircd-ircdev/RELEASE.NOTES Thu Sep 1 04:25:42 2005 @@ -8,7 +8,7 @@ ircu2.10.07 (based on IRC-Hispano ircdh and Terraircu). IRC-Dev ircd is only compatible with servers that implement the P10 protocol. It has been tested to link against old ircds, but some features (notably -IPv6 support) are not supported by old ircds. +IPv6 support and oplevels) are not supported by old ircds. Enhancements: @@ -34,6 +34,19 @@ and allows that external program to assign an account stamp to the incoming user. +A new channel mode, +D, has been added for auditorium-style channels. +These are channels where most users listen but do not speak or receive +ops or voice. The effect of +D is that the server waits to send the +JOIN message for new users until the user gets ops or voice or sends a +message to the channel. A list of join-delayed users in a channel may +be retrieved by using /NAMES -d #channel. The response to /NAMES -d +uses the same format as numeric 353, but uses numeric 355 instead. If +an op removes +D while there are still join-delayed users, the server +automatically sets mode +d, and removes +d when the last user's join +is shown. It is not possible to set channel mode +d manually; its +purpose is to warn channel users that there are "hidden" users in the +channel. + More than one hashing mechanism is now supported for oper passwords, and a new tool (ircd/umkpasswd) is provided to generate them. Index: ircd-ircdev/RELEASE.NOTES.es diff -u ircd-ircdev/RELEASE.NOTES.es:1.2 ircd-ircdev/RELEASE.NOTES.es:1.3 --- ircd-ircdev/RELEASE.NOTES.es:1.2 Sat Apr 23 08:57:02 2005 +++ ircd-ircdev/RELEASE.NOTES.es Thu Sep 1 04:25:42 2005 @@ -9,7 +9,7 @@ Terraircu). El ircd de IRC-Dev es compatible solamente con servidores que tengan implementado el protocolo P10. Ha sido probado el link con ircds antiguos, pero muchas caracteristicas (notablemente el soporte -IPv6) no están soportadas por ircds viejos. +IPv6 y oplevels) no están soportadas por ircds viejos. Implementaciones: @@ -36,6 +36,20 @@ el servidor y permite que ese programa externo asigne una cuenta de acceso al usuario entrante. +Un nuevo modo de canal, +d, se ha agregado para los canales estilo +auditorio. Estos son canales donde la mayoría de los usuarios escuchan +pero no hablan ni reciben ops o voz. El efecto de +D es que el servidor +espera para enviar el mensaje del JOIN para los nuevos usuarios hasta +que el usuario consigue ops o voz o envía un mensaje al canal. La lista +de usuarios con entrada retrasada en un canal se puede sacar usando +/NAMES -d #canal. La respuesta al /NAMES -d utiliza el mismo formato que +el numérico 353, pero usa el numérico 355. Si un op quita el +D mientras +que todavía hay usuarios con entrada retrasada, el servidor ajusta el modo ++d automáticamente, y quita +d cuando se muestra la entrada del ultimo +usuario. No es posible fijar el modo +d del canal manualmente; su +próposito es advertir a los usuarios del canal de que hay usuarios +"ocultos" en el canal. + Más de un mecanismo del hashing está soportado ahora para las contraseñas de operador (IRCOP), y se proporciona una herramienta nueva (ircd/umkpasswd) para generarlas. Index: ircd-ircdev/configure diff -u ircd-ircdev/configure:1.18 ircd-ircdev/configure:1.19 --- ircd-ircdev/configure:1.18 Mon May 16 04:22:48 2005 +++ ircd-ircdev/configure Thu Sep 1 04:25:42 2005 @@ -7765,6 +7765,71 @@ echo "$as_me: error: Cannot find a type with size of 64 bits" >&2;} { (exit 1); exit 1; }; } fi +echo "$as_me:$LINENO: checking for struct sockaddr_in6" >&5 +echo $ECHO_N "checking for struct sockaddr_in6... $ECHO_C" >&6 +if test "${ac_cv_type_struct_sockaddr_in6+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <sys/types.h> +#include <netinet/in.h> + +int +main () +{ +if ((struct sockaddr_in6 *) 0) + return 0; +if (sizeof (struct sockaddr_in6)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_struct_sockaddr_in6=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_struct_sockaddr_in6=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_struct_sockaddr_in6" >&5 +echo "${ECHO_T}$ac_cv_type_struct_sockaddr_in6" >&6 +if test $ac_cv_type_struct_sockaddr_in6 = yes; then + unet_have_sockaddr_in6="yes" +else + unet_have_sockaddr_in6="no" +fi + + echo "$as_me:$LINENO: checking for socklen_t" >&5 echo $ECHO_N "checking for socklen_t... $ECHO_C" >&6 if test "${ac_cv_type_socklen_t+set}" = set; then @@ -7776,7 +7841,9 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default +#include <sys/types.h> +#include<sys/socket.h> + int main () { @@ -7825,33 +7892,29 @@ : else -cat >>confdefs.h <<_ACEOF -#define socklen_t unsigned int -_ACEOF - -fi - -echo "$as_me:$LINENO: checking for struct sockaddr_in6" >&5 -echo $ECHO_N "checking for struct sockaddr_in6... $ECHO_C" >&6 -if test "${ac_cv_type_struct_sockaddr_in6+set}" = set; then + echo "$as_me:$LINENO: checking for socklen_t equivalent" >&5 +echo $ECHO_N "checking for socklen_t equivalent... $ECHO_C" >&6 + if test "${curl_cv_socklen_t_equiv+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF + + curl_cv_socklen_t_equiv= + for arg2 in "struct sockaddr" void ; do + for t in int size_t unsigned long "unsigned long" ; do + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <sys/types.h> -#include <netinet/in.h> - +#include <sys/socket.h> +int getpeername (int $arg2 *, $t *); int main () { -if ((struct sockaddr_in6 *) 0) - return 0; -if (sizeof (struct sockaddr_in6)) - return 0; +$t len; + getpeername(0, 0, &len); ; return 0; } @@ -7878,21 +7941,26 @@ ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_type_struct_sockaddr_in6=yes + curl_cv_socklen_t_equiv="$t" + break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_struct_sockaddr_in6=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done + done + fi -echo "$as_me:$LINENO: result: $ac_cv_type_struct_sockaddr_in6" >&5 -echo "${ECHO_T}$ac_cv_type_struct_sockaddr_in6" >&6 -if test $ac_cv_type_struct_sockaddr_in6 = yes; then - unet_have_sockaddr_in6="yes" -else - unet_have_sockaddr_in6="no" + + echo "$as_me:$LINENO: result: $curl_cv_socklen_t_equiv" >&5 +echo "${ECHO_T}$curl_cv_socklen_t_equiv" >&6 + +cat >>confdefs.h <<_ACEOF +#define socklen_t $curl_cv_socklen_t_equiv +_ACEOF + fi Index: ircd-ircdev/configure.in diff -u ircd-ircdev/configure.in:1.17 ircd-ircdev/configure.in:1.18 --- ircd-ircdev/configure.in:1.17 Mon May 16 04:22:49 2005 +++ ircd-ircdev/configure.in Thu Sep 1 04:25:42 2005 @@ -22,7 +22,7 @@ dnl along with this program; if not, write to the Free Software dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA dnl -dnl $Id: configure.in,v 1.17 2005/05/16 11:22:49 zolty Exp $ +dnl $Id: configure.in,v 1.18 2005/09/01 11:25:42 zolty Exp $ dnl dnl Make sure we are in the correct directory (someone could have run @@ -79,10 +79,35 @@ AC_STRUCT_TM AC_TYPE_UID_T unet_CHECK_TYPE_SIZES -AC_CHECK_TYPE(socklen_t, unsigned int) AC_CHECK_TYPE(struct sockaddr_in6, [unet_have_sockaddr_in6="yes"], [unet_have_sockaddr_in6="no"], [#include <sys/types.h> #include <netinet/in.h>]) +dnl Check for socklen_t. In traditional BSD this is an int, but some +dnl OSes use a different type. Test until we find something that will +dnl work properly. Test borrowed from a patch submitted for Python. +AC_CHECK_TYPE([socklen_t], ,[ + AC_MSG_CHECKING([for socklen_t equivalent]) + AC_CACHE_VAL([curl_cv_socklen_t_equiv], + [ +dnl Systems have either "struct sockaddr*" or "void*" as second +dnl arg to getpeername. + curl_cv_socklen_t_equiv= + for arg2 in "struct sockaddr" void ; do + for t in int size_t unsigned long "unsigned long" ; do + AC_TRY_COMPILE([#include <sys/types.h> +#include <sys/socket.h> +int getpeername (int $arg2 *, $t *);],[$t len; + getpeername(0, 0, &len);], [curl_cv_socklen_t_equiv="$t" + break]) + done + done + ]) + AC_MSG_RESULT($curl_cv_socklen_t_equiv) + AC_DEFINE_UNQUOTED(socklen_t, $curl_cv_socklen_t_equiv, + [type to use in place of socklen_t if not defined])], + [#include <sys/types.h> +#include<sys/socket.h>]) + dnl Checks for library functions. AC_CHECK_FUNCS([kqueue setrlimit getrusage times]) Index: ircd-ircdev/doc/en/api/features.txt diff -u ircd-ircdev/doc/en/api/features.txt:1.2 ircd-ircdev/doc/en/api/features.txt:1.3 --- ircd-ircdev/doc/en/api/features.txt:1.2 Wed Jan 5 08:38:12 2005 +++ ircd-ircdev/doc/en/api/features.txt Thu Sep 1 04:25:42 2005 @@ -1,4 +1,4 @@ -$Id: features.txt,v 1.2 2005/01/05 16:38:12 zolty Exp $ +$Id: features.txt,v 1.3 2005/09/01 11:25:42 zolty Exp $ As of u2.10.11, most of the compile-time configuration options present in previous versions of ircu have been provided via the configuration @@ -63,13 +63,13 @@ Marking Features When the configuration file is read, there must be some way to -determine if a particular F-line has been removed since the last time -the configuration file was read. The way this is done in the features -subsystem is to have a "mark" for each feature. Prior to reading the -configuration file, all marks are cleared for all features (and all -"unmark" call-backs are called). As each F-line is encountered and -processed, that feature's mark is set. Finally, when the -configuration file has been fully read, all remaining unmarked +determine if a particular Feature entry has been removed since the +last time the configuration file was read. The way this is done in +the features subsystem is to have a "mark" for each feature. Prior to +reading the configuration file, all marks are cleared for all features +(and all "unmark" call-backs are called). As each Feature entry is +encountered and processed, that feature's mark is set. Finally, when +the configuration file has been fully read, all remaining unmarked features are reset to their default values (and all "mark" call-backs are called). @@ -150,8 +150,8 @@ <function> void feature_report(struct Client* to); -Reports all F-lines to a user using RPL_STATSFLINE, except those which -the user is not permitted to see due to flag settings. +Reports all Feature entries to a user using RPL_STATSFLINE, except +those which the user is not permitted to see due to flag settings. </function> <function> Index: ircd-ircdev/doc/en/api/modebuf.txt diff -u ircd-ircdev/doc/en/api/modebuf.txt:1.2 ircd-ircdev/doc/en/api/modebuf.txt:1.3 --- ircd-ircdev/doc/en/api/modebuf.txt:1.2 Wed Jan 5 08:38:12 2005 +++ ircd-ircdev/doc/en/api/modebuf.txt Thu Sep 1 04:25:42 2005 @@ -1,4 +1,4 @@ -$Id: modebuf.txt,v 1.2 2005/01/05 16:38:12 zolty Exp $ +$Id: modebuf.txt,v 1.3 2005/09/01 11:25:42 zolty Exp $ Generating and parsing channel mode strings is often a very complicated process. The ModeBuf interface, along with the associated @@ -103,10 +103,10 @@ <macro> #define MODEBUF_DEST_HACK4 0x8000 /* Send a HACK(4) notice, TS == 0 */ -Some servers are special. When a server that has a U-line issues a -mode change, we send a "HACK(4)" message to differentiate it from an -ordinary server changing a channel mode. This is the flag that must -be passed to modebuf_init() to cause that behavior. +Some servers are special. When a server that has a Uworld entry +issues a mode change, we send a "HACK(4)" message to differentiate it +from an ordinary server changing a channel mode. This is the flag +that must be passed to modebuf_init() to cause that behavior. </macro> <function> Index: ircd-ircdev/doc/en/api/motd.txt diff -u ircd-ircdev/doc/en/api/motd.txt:1.2 ircd-ircdev/doc/en/api/motd.txt:1.3 --- ircd-ircdev/doc/en/api/motd.txt:1.2 Wed Jan 5 08:38:12 2005 +++ ircd-ircdev/doc/en/api/motd.txt Thu Sep 1 04:25:42 2005 @@ -1,4 +1,4 @@ -$Id: motd.txt,v 1.2 2005/01/05 16:38:12 zolty Exp $ +$Id: motd.txt,v 1.3 2005/09/01 11:25:42 zolty Exp $ The server has a Message of the Day (MOTD) which is often used for describing the Acceptable Usage Policy, where to get help if you have @@ -21,12 +21,11 @@ This function sends an appropriate MOTD to the client specified by _cptr_. If _cptr_ is not a local client, the remote MOTD will be -sent; otherwise, an attempt will be made to find a T-line in the -configuration file that matches the client. If no T-line can be +sent; otherwise, an attempt will be made to find a Motd entry in the +configuration file that matches the client. If no Motd entry can be found, the default MOTD will be sent to the client. This function returns 0 for the convenience of other functions that must have an -integer return value. -</function> +integer return value. </function> <function> void motd_signon(struct Client* cptr); @@ -62,7 +61,7 @@ <function> void motd_report(struct Client *to); -The motd_report() function sends a list of the T-lines stored in +The motd_report() function sends a list of the Motd entries stored in memory to the client specified by _to_. Access control should be handled by the caller. </function> Index: ircd-ircdev/doc/en/features.txt diff -u ircd-ircdev/doc/en/features.txt:1.2 ircd-ircdev/doc/en/features.txt:1.3 --- ircd-ircdev/doc/en/features.txt:1.2 Wed Jan 26 09:19:41 2005 +++ ircd-ircdev/doc/en/features.txt Thu Sep 1 04:25:42 2005 @@ -1,9 +1,9 @@ -$Id: features.txt,v 1.2 2005/01/26 17:19:41 zolty Exp $ +$Id: features.txt,v 1.3 2005/09/01 11:25:42 zolty Exp $ Many of the old compile-time options are now configured through the server configuration file, ircd.conf. This file is intended to document each of these features. Logging, although also configured -through the use of "Features" Block, is documented in doc/*/log.txt. +through the use of Feature entries, is documented in doc/*/log.txt. NOTE THAT THESE NAMES ARE CASE SENSITIVE! Values are not case sensitive unless stated otherwise in the documentation for that feature. @@ -343,6 +343,15 @@ in nickname length for a network. +CHANNELLEN + * Type: integer + * Default: 200 + +This is the allowed length of locally created channels. It may not be +larger than the CHANNELLEN #define. Like the NICKLEN feature, this is +intended to ease changes in channel name length across a network. + + AVBANLEN * Type: integer * Default: 40 @@ -439,8 +448,8 @@ This is the default frequency that the server attempts to reconnect with its uplink server if it is set to auto connect to it. Note that -this value is overridden by a "Class" block in ircd.conf if the "Connect" -block in ircd.conf assign a specific class to the connection (recommended). +this value is overridden by a "Class" block in ircd.conf if the Connect +entries in ircd.conf assign a specific class to the connection (recommended). DEFAULTMAXSENDQLENGTH @@ -449,9 +458,7 @@ This is the default value of the maximum sendQ length of connection classes (see doc/ircd.sample-*.conf for details on "Class" blocks). You will -probably always override this value in your "ircd.conf" with the -"Class" block. The given value used to be an often used value for client -sendQs. +generally override this value in your "ircd.conf" with a Class block. GLINEMAXUSERCOUNT @@ -604,13 +611,12 @@ * Type: boolean * Default: FALSE -For u2.10.11, several new oper-only features have been added that -involve changes to the server<->server protocol. Until the entire -network is running the new version, these features cannot be enabled. -This configuration option provides a single switch to prevent the use -of these features until the entire network has been upgraded. It is -not required that all servers set this to "TRUE" in order for the -features to be used. +Since u2.10.11, several new oper-only features have been added that +involve changes to the server<->server protocol. This configuration +option provides a single switch to prevent the use of these features +until the entire network has been upgraded. It is not required that +all servers set this to "TRUE" in order for the features to be used, +as long as all servers are running u2.10.11 or above. HIS_SNOTICES Index: ircd-ircdev/doc/en/log.txt diff -u ircd-ircdev/doc/en/log.txt:1.2 ircd-ircdev/doc/en/log.txt:1.3 --- ircd-ircdev/doc/en/log.txt:1.2 Sat May 7 15:23:39 2005 +++ ircd-ircdev/doc/en/log.txt Thu Sep 1 04:25:42 2005 @@ -1,10 +1,10 @@ -$Id: log.txt,v 1.2 2005/05/07 22:23:39 zolty Exp $ +$Id: log.txt,v 1.3 2005/09/01 11:25:42 zolty Exp $ Older versions of ircd had no consistent way of logging various actions. Some things, such as G-lines, were written out to log files with names compiled into the server. Others could only be logged through syslog. Some required that their log files exist beforehand. -For u2.10.11, this situation has changed dramatically. +Starting with u2.10.11, this situation has changed dramatically. All logging in the server is now unified through a single logging subsystem. Unfortunately, the server still does not generate all the @@ -139,30 +139,31 @@ The IRC server has a default facility that it uses when sending log messages to syslog. The default facility may be overridden for each individual subsystem, but the default itself can be changed with an -appropriate F-line in the configuration file. The facility normally -defaults to "USER," but may be configured to be any of AUTH, CRON, -DAEMON, LOCAL0, LOCAL1, LOCAL2, LOCAL3, LOCAL4, LOCAL5, LOCAL6, +appropriate Feature entry in the configuration file. The facility +normally defaults to "USER," but may be configured to be any of AUTH, +CRON, DAEMON, LOCAL0, LOCAL1, LOCAL2, LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7, LPR, MAIL, NEWS, USER, or UUCP. Some systems also have the -AUTHPRIV facility. To configure this default, add an F-line to the -configuration file that looks like "F:LOG:<facility>"; <facility> -should be replaced with the string for the desired default syslog -facility. +AUTHPRIV facility. To configure this default, add a Feature line to +the configuration file that looks like "LOG" = "<facility>"; +<facility> should be replaced with the string for the desired default +syslog facility. Log Files Each subsystem may be configured to send its log messages to any -single log file with an F-line like "F:LOG:<subsys>:FILE:<file>"; -<subsys> should be replaced with one of the subsystem names described -above, and <file> should be a file name for the log file. The file -name may be relative to the server's data directory ("DPATH"), or it -may be an absolute path name. Note that if you're using chroot, these -absolute path names will be relative to the server's root directory. +single log file with a Feature entry like "LOG" = "<subsys>" "FILE" +"<file>"; <subsys> should be replaced with one of the subsystem names +described above, and <file> should be a file name for the log file. +The file name may be relative to the server's data directory +("DPATH"), or it may be an absolute path name. Note that if you're +using chroot, these absolute path names will be relative to the +server's root directory. Logging to Syslog By default, except for the CONFIG subsystem, no logs are sent to -syslog. This can be overridden using an F-line like -"F:LOG:<subsys>:FACILITY:<facility>"; <subsys>, as above, should be +syslog. This can be overridden using an Feature entry like "LOG" = +"<subsys>" "FACILITY" "<facility>"; <subsys>, as above, should be replaced with one of the subsystem names described above, and <facility> must be one of the facility strings mentioned under "Default Syslog Facility." The facility string may also be "NONE," to @@ -182,14 +183,14 @@ are OLDSNO, SERVKILL, OPERKILL, HACK2, HACK3, UNAUTH, TCPCOMMON, TOOMANY, HACK4, GLINE, NETWORK, IPMISMATCH, THROTTLE, OLDREALOP, CONNEXIT, and DEBUG. The special mask name "NONE" inhibits sending of -server notices for a particular subsystem. The F-line for this -configuration looks like "F:LOG:<subsys>:SNOMASK:<mask>"; again, +server notices for a particular subsystem. The Feature entry for this +configuration looks like "LOG" = "<subsys>" "SNOMASK" "<mask>"; again, <subsys> is one of the subsystems described above, and <mask> is one of the mask names. Setting Minimum Logging Level The minimum log level for a particular subsystem may be set with an -F-line like "F:LOG:<subsys>:LEVEL:<level>"; here, <subsys> is yet -again one of the subsystems described above, and <level> is one of the -level names, also described above. +Feature entry like "LOG" = "<subsys>" "LEVEL" "<level>"; here, +<subsys> is yet again one of the subsystems described above, and +<level> is one of the level names, also described above. Index: ircd-ircdev/doc/ircd.sample-en.conf diff -u ircd-ircdev/doc/ircd.sample-en.conf:1.21 ircd-ircdev/doc/ircd.sample-en.conf:1.22 --- ircd-ircdev/doc/ircd.sample-en.conf:1.21 Sat May 7 15:32:20 2005 +++ ircd-ircdev/doc/ircd.sample-en.conf Thu Sep 1 04:25:42 2005 @@ -1,6 +1,6 @@ # ircd.conf - configuration file for IRC-Dev's IRCD. # -# Last Updated: 8, May 2005. +# Last Updated: 1, Sep 2005. # # Written by Niels <ni...@un...>, based on the original example.conf, # server code and some real-life (ahem) experience. @@ -64,7 +64,7 @@ # be the address of a physical interface on the host. This address is # used for outgoing connections if the "Connect" block does not override # it. See "Port" block for listener virtual hosting. If in doubt, -# leave it out. +# leave it out -- or use "*", which has the same meaning as no vhost. # # You may specify both an IPv4 virtual host and an IPv6 virtual host, # to indicate which address should be used for outbound connections @@ -160,6 +160,12 @@ maxlinks = 100; usermode = "+iw"; }; +Class { + name = "Other"; + pingfreq = 1 minutes 30 seconds; + sendq = 160000; + maxlinks = 400; +}; Client { class = "Other"; @@ -172,12 +178,6 @@ maxlinks = 5; }; Class { - name = "Other"; - pingfreq = 1 minutes 30 seconds; - sendq = 160000; - maxlinks = 400; -}; -Class { name = "Opers"; pingfreq = 1 minutes 30 seconds; sendq = 160000; @@ -460,9 +460,9 @@ # # # The default reason is: "You are banned from this server" -# Note that K-lines are local to the server; if you ban a person or a +# Note that Kill blocks are local to the server; if you ban a person or a # whole domain from your server, they can get on IRC via any other server -# that doesn't have them K-lined (yet). +# that doesn't have them Killed (yet). # # With a simple comment, using quotes: Kill { host = "*.au"; reason = "Please use a nearer server"; }; @@ -785,6 +785,7 @@ # "KILLCHASETIMELIMIT" = "30"; # "MAXCHANNELSPERUSER" = "10"; # "NICKLEN" = "12"; +# "CHANNELLEN" = "200"; # "AVBANLEN" = "40"; # "MAXBANS" = "45"; # "MAXSILES" = "15"; Index: ircd-ircdev/doc/ircd.sample-es.conf diff -u ircd-ircdev/doc/ircd.sample-es.conf:1.16 ircd-ircdev/doc/ircd.sample-es.conf:1.17 --- ircd-ircdev/doc/ircd.sample-es.conf:1.16 Sat May 7 15:32:20 2005 +++ ircd-ircdev/doc/ircd.sample-es.conf Thu Sep 1 04:25:42 2005 @@ -1,6 +1,6 @@ # ircd.conf - archivo de configuración para el IRCD de IRC-Dev. # -# Ultima actualización: 8, May 2005. +# Ultima actualización: 1, Sep 2005. # # Escrito por Niels <ni...@un...>, basado en el archivo example.conf # original, en el código del servidor y la experiencia de la vida real. @@ -70,7 +70,8 @@ # La dirección DEBE ser la dirección de una interfaz física en el host. # Esta dirección se utiliza para las conexiones salientes si el bloque # "Connect" no la elimina. Veáse el bloque "Port" para la escucha con -# virtual hosting. En caso de duda no pongas nada. +# virtual hosting. En caso de duda no pongas nada o usa "*" que tiene el +# mismo significado que no tener vhost. # # Puedes especificar un virtualhost de IPv4 y un virtualhost de IPv6, # para indicar cuál de las direcciones se debe utilizar para las @@ -169,6 +170,12 @@ maxlinks = 100; usermode = "+iw"; }; +Class { + name = "Otros"; + pingfreq = 1 minutes 30 seconds; + sendq = 160000; + maxlinks = 400; +}; Client { class = "Otros"; @@ -181,12 +188,6 @@ maxlinks = 5; }; Class { - name = "Otros"; - pingfreq = 1 minutes 30 seconds; - sendq = 160000; - maxlinks = 400; -}; -Class { name = "Opers"; pingfreq = 1 minutes 30 seconds; sendq = 160000; @@ -482,9 +483,9 @@ # # # La razón por defecto es: "You are banned from this server" -# Notese que las "K-lines" son locales al servidor; si se prohibe a una -# persona o un dominio entero de tu servidor, aun pueden entrar al IRC -# por otro servidor que no tengan "K-lined" (aun). +# Notese que los bloques "Kill" son locales al servidor; si se prohibe +# a una persona o un dominio entero de tu servidor, aun pueden entrar +# al IRC por otro servidor que no tengan "Killed" (aun). # # Con un simple comentario, usando comillas: Kill { host = "*.au"; reason = "Por favor, use un servidor más cercano"; }; @@ -495,7 +496,7 @@ # El archivo puede contener, por ejemplo, una razón, un enlace a las normas # del servidor y una dirección de contacto. Observe la combinación del username -y el host en el campo "host". +#y el host en el campo "host". Kill { host = "*lu...@un..."; @@ -822,6 +823,7 @@ # "KILLCHASETIMELIMIT" = "30"; # "MAXCHANNELSPERUSER" = "10"; # "NICKLEN" = "12"; +# "CHANNELLEN" = "200"; # "AVBANLEN" = "40"; # "MAXBANS" = "45"; # "MAXSILES" = "15"; Index: ircd-ircdev/include/channel.h diff -u ircd-ircdev/include/channel.h:1.12 ircd-ircdev/include/channel.h:1.13 --- ircd-ircdev/include/channel.h:1.12 Wed Jun 22 02:58:52 2005 +++ ircd-ircdev/include/channel.h Thu Sep 1 04:25:42 2005 @@ -22,7 +22,7 @@ */ /** @file * @brief Channel management and maintenance. - * @version $Id: channel.h,v 1.12 2005/06/22 09:58:52 zolty Exp $ + * @version $Id: channel.h,v 1.13 2005/09/01 11:25:42 zolty Exp $ */ #ifndef INCLUDED_channel_h #define INCLUDED_channel_h @@ -49,9 +49,6 @@ #define MODEBUFLEN 200 /**< Maximum length of a mode */ #define KEYLEN 23 /**< Maximum length of a key */ -#if defined(UNDERNET) -#define PASSLEN 23 /**< Maximum length of a password */ -#endif #define CHANNELLEN 200 /**< Maximum length of a channel */ #define MAXJOINARGS 15 /**< number of slots for join buffer */ @@ -305,8 +302,8 @@ unsigned int limit; char key[KEYLEN + 1]; #if defined(UNDERNET) - char upass[PASSLEN + 1]; - char apass[PASSLEN + 1]; + char upass[KEYLEN + 1]; + char apass[KEYLEN + 1]; #endif }; Index: ircd-ircdev/include/ircd_features.h diff -u ircd-ircdev/include/ircd_features.h:1.12 ircd-ircdev/include/ircd_features.h:1.13 --- ircd-ircdev/include/ircd_features.h:1.12 Sat Apr 2 11:47:34 2005 +++ ircd-ircdev/include/ircd_features.h Thu Sep 1 04:25:42 2005 @@ -21,7 +21,7 @@ */ /** @file * @brief Public interfaces and declarations for dealing with configurable features. - * @version $Id: ircd_features.h,v 1.12 2005/04/02 19:47:34 zolty Exp $ + * @version $Id: ircd_features.h,v 1.13 2005/09/01 11:25:42 zolty Exp $ */ #ifndef INCLUDED_features_h #define INCLUDED_features_h @@ -29,6 +29,8 @@ struct Client; struct StatDesc; +extern struct Client his; + /** Contains all feature settings for ircu. * For documentation of each, see doc/readme.features. */ @@ -66,6 +68,7 @@ FEAT_KILLCHASETIMELIMIT, FEAT_MAXCHANNELSPERUSER, FEAT_NICKLEN, + FEAT_AVBANLEN, FEAT_MAXBANS, FEAT_MAXSILES, @@ -83,6 +86,7 @@ FEAT_IPCHECK_CLONE_LIMIT, FEAT_IPCHECK_CLONE_PERIOD, FEAT_IPCHECK_CLONE_DELAY, + FEAT_CHANNELLEN, /* Some misc. default paths */ FEAT_MPATH, Index: ircd-ircdev/include/numeric.h diff -u ircd-ircdev/include/numeric.h:1.14 ircd-ircdev/include/numeric.h:1.15 --- ircd-ircdev/include/numeric.h:1.14 Wed Jun 22 00:54:29 2005 +++ ircd-ircdev/include/numeric.h Thu Sep 1 04:25:42 2005 @@ -21,7 +21,7 @@ */ /** @file * @brief Declarations of numeric replies and supporting functions. - * @version $Id: numeric.h,v 1.14 2005/06/22 07:54:29 zolty Exp $ + * @version $Id: numeric.h,v 1.15 2005/09/01 11:25:42 zolty Exp $ */ #ifndef INCLUDED_numeric_h #define INCLUDED_numeric_h @@ -467,8 +467,8 @@ #define ERR_CHANSECURED 562 /* Undernet extension */ #define ERR_UPASSSET 563 /* Undernet extension */ #define ERR_UPASSNOTSET 564 /* Undernet extension */ -#define ERR_NOMANAGER_LONG 565 /* Undernet extension */ -#define ERR_NOMANAGER_SHORT 566 /* Undernet extension */ +/* ERR_NOMANAGER_LONG 565 no longer used */ +#define ERR_NOMANAGER 566 /* Undernet extension */ #define ERR_UPASS_SAME_APASS 567 /* Undernet extension */ #define RPL_LOGON 600 /* Dalnet extension */ Index: ircd-ircdev/include/patchlevel.h diff -u ircd-ircdev/include/patchlevel.h:1.43 ircd-ircdev/include/patchlevel.h:1.44 --- ircd-ircdev/include/patchlevel.h:1.43 Sun Jul 3 13:21:41 2005 +++ ircd-ircdev/include/patchlevel.h Thu Sep 1 04:25:42 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.43 2005/07/03 20:21:41 zolty Exp $ + * $Id: patchlevel.h,v 1.44 2005/09/01 11:25:42 zolty Exp $ * */ -#define PATCHLEVEL ".alpha42" +#define PATCHLEVEL ".alpha43" #define RELEASE "1.0" Index: ircd-ircdev/include/s_conf.h diff -u ircd-ircdev/include/s_conf.h:1.12 ircd-ircdev/include/s_conf.h:1.13 --- ircd-ircdev/include/s_conf.h:1.12 Thu Apr 28 15:00:08 2005 +++ ircd-ircdev/include/s_conf.h Thu Sep 1 04:25:42 2005 @@ -21,7 +21,7 @@ */ /** @file s_conf.h * @brief ircd configuration file API. - * @version $Id: s_conf.h,v 1.12 2005/04/28 22:00:08 zolty Exp $ + * @version $Id: s_conf.h,v 1.13 2005/09/01 11:25:42 zolty Exp $ */ #ifndef INCLUDED_s_conf_h #define INCLUDED_s_conf_h @@ -208,6 +208,7 @@ extern void lookup_confhost(struct ConfItem *aconf); extern void conf_parse_userhost(struct ConfItem *aconf, char *host); extern struct ConfItem *conf_debug_iline(const char *client); +extern void free_mapping(struct s_map *smap); extern void yyerror(const char *msg); Index: ircd-ircdev/include/supported.h diff -u ircd-ircdev/include/supported.h:1.8 ircd-ircdev/include/supported.h:1.9 --- ircd-ircdev/include/supported.h:1.8 Wed May 25 09:56:23 2005 +++ ircd-ircdev/include/supported.h Thu Sep 1 04:25:42 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: supported.h,v 1.8 2005/05/25 16:56:23 zolty Exp $ + * $Id: supported.h,v 1.9 2005/09/01 11:25:42 zolty Exp $ * */ #ifndef INCLUDED_supported_h @@ -37,6 +37,7 @@ */ #define FEATURES1 \ "AWAYLEN=%i" \ + " MAXCHANNELLEN=%i" \ " CHANNELLEN=%i" \ " MAXNICKLEN=%i" \ " NICKLEN=%i" \ @@ -71,12 +72,12 @@ " SAFELIST" -#define FEATURESVALUES1 AWAYLEN, CHANNELLEN, NICKLEN, feature_int(FEAT_NICKLEN), TOPICLEN +#define FEATURESVALUES1 AWAYLEN, CHANNELLEN, feature_int(FEAT_CHANNELLEN), NICKLEN, feature_int(FEAT_NICKLEN), TOPICLEN #if defined(DDB) || defined(SERVICES) -#define FEATURESVALUES2 "b,k,l,imnpstrRD", feature_bool(FEAT_LOCAL_CHANNELS) ? "#&" : "#", "(qov).@+", ".@+" +#define FEATURESVALUES2 "b,k,l,imnpstrRDd", feature_bool(FEAT_LOCAL_CHANNELS) ? "#&" : "#", "(qov).@+", ".@+" #else -#define FEATURESVALUES2 "b,k,l,imnpstRD", feature_bool(FEAT_LOCAL_CHANNELS) ? "#&" : "#", "(ov)@+", "@+" +#define FEATURESVALUES2 "b,k,l,imnpstRDd", feature_bool(FEAT_LOCAL_CHANNELS) ? "#&" : "#", "(ov)@+", "@+" #endif #define FEATURESVALUES3 feature_int(FEAT_MAXCHANNELSPERUSER), feature_int(FEAT_MAXBANS), \ Index: ircd-ircdev/include/sys.h diff -u ircd-ircdev/include/sys.h:1.4 ircd-ircdev/include/sys.h:1.5 --- ircd-ircdev/include/sys.h:1.4 Mon Jan 10 04:22:00 2005 +++ ircd-ircdev/include/sys.h Thu Sep 1 04:25:42 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: sys.h,v 1.4 2005/01/10 12:22:00 zolty Exp $ + * $Id: sys.h,v 1.5 2005/09/01 11:25:42 zolty Exp $ * */ #ifndef INCLUDED_sys_h @@ -31,13 +31,6 @@ */ #define MAXCLIENTS (MAXCONNECTIONS-24) -/* Define FD_SETSIZE to what we want before including sys/types.h on BSD */ -#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__bsdi__) -#if ((!defined(USE_POLL)) && (!defined(FD_SETSIZE))) -#define FD_SETSIZE ((MAXCONNECTIONS)+4) -#endif -#endif - #define IRCD_MAX(a, b) ((a) > (b) ? (a) : (b)) #define IRCD_MIN(a, b) ((a) < (b) ? (a) : (b)) Index: ircd-ircdev/ircd/IPcheck.c diff -u ircd-ircdev/ircd/IPcheck.c:1.11 ircd-ircdev/ircd/IPcheck.c:1.12 --- ircd-ircdev/ircd/IPcheck.c:1.11 Wed Jun 22 00:54:29 2005 +++ ircd-ircdev/ircd/IPcheck.c Thu Sep 1 04:25:42 2005 @@ -21,7 +21,7 @@ */ /** @file * @brief Code to count users connected from particular IP addresses. - * @version $Id: IPcheck.c,v 1.11 2005/06/22 07:54:29 zolty Exp $ + * @version $Id: IPcheck.c,v 1.12 2005/09/01 11:25:42 zolty Exp $ */ #include "config.h" @@ -163,7 +163,7 @@ * For members that have a sensible default value, that is used. * @return Newly allocated registry entry. */ -static struct IPRegistryEntry* ip_registry_new_entry() +static struct IPRegistryEntry* ip_registry_new_entry(void) { struct IPRegistryEntry* entry = freeList; if (entry) Index: ircd-ircdev/ircd/channel.c diff -u ircd-ircdev/ircd/channel.c:1.24 ircd-ircdev/ircd/channel.c:1.25 --- ircd-ircdev/ircd/channel.c:1.24 Wed Jun 22 00:54:29 2005 +++ ircd-ircdev/ircd/channel.c Thu Sep 1 04:25:42 2005 @@ -21,7 +21,7 @@ */ /** @file * @brief Channel management and maintanance - * @version $Id: channel.c,v 1.24 2005/06/22 07:54:29 zolty Exp $ + * @version $Id: channel.c,v 1.25 2005/09/01 11:25:42 zolty Exp $ */ #include "config.h" @@ -267,23 +267,15 @@ #if defined(UNDERNET) chptr->users = 0; - /* - * Also channels without Apass set need to be kept alive, - * otherwise Bad Guys(tm) would be able to takeover - * existing channels too easily, and then set an Apass! - * However, if a channel without Apass becomes empty - * then we try to be kind to them and remove possible - * limiting modes. - */ - chptr->mode.mode &= ~MODE_INVITEONLY; - chptr->mode.limit = 0; - /* - * We do NOT reset a possible key or bans because when - * the 'channel owners' can't get in because of a key - * or ban then apparently there was a fight/takeover - * on the channel and we want them to contact IRC opers - * who then will educate them on the use of Apass/upass. - */ + /* There is a semantics problem here: Assuming no fragments across a + * split, a channel without Apass could be maliciously destroyed and + * recreated, and someone could set apass on the new instance. + * + * This could be fixed by preserving the empty non-Apass channel for + * the same time as if it had an Apass (but removing +i and +l), and + * reopping the first user to rejoin. However, preventing net rides + * requires a backwards-incompatible protocol change.. + */ if (!chptr->mode.apass[0]) /* If no Apass, destroy now. */ destruct_channel(chptr); @@ -477,7 +469,7 @@ member->user = who; member->channel = chptr; member->status = flags; - member->oplevel = oplevel; + SetOpLevel(member, oplevel); member->next_member = chptr->members; if (member->next_member) @@ -708,15 +700,16 @@ #if defined(UNDERNET) /* Discourage using the Apass to get op. They should use the upass. */ - if (IsChannelManager(member) && *member->channel->mode.upass) + if (IsChannelManager(member) && member->channel->mode.apass[0]) return 0; #endif if (IsVoicedOrOpped(member)) return 1; + /* * If it's moderated, and you aren't a privileged user, you can't - * speak. + * speak. */ if (member->channel->mode.mode & MODE_MODERATED) return 0; @@ -1255,9 +1248,10 @@ user = mask; host = ++ptr; } - else if (*ptr == '.') + else if (*ptr == '.' || *ptr == ':') { - /* Case 2: Found last '.' (without finding a '!' or '@' yet) */ + /* Case 2: Found character specific to IP or hostname (without + * finding a '!' or '@' yet) */ last_dot = ptr; continue; } @@ -1435,7 +1429,8 @@ int i; for (i = 0; cn[i]; i++) { - if (i >= CHANNELLEN || !IsChannelChar(cn[i])) { + if (i >= IRCD_MIN(CHANNELLEN, feature_int(FEAT_CHANNELLEN)) + || !IsChannelChar(cn[i])) { cn[i] = '\0'; return; } @@ -2588,14 +2583,24 @@ } } +/** Helper function to clean key-like parameters. */ +static void +clean_key(char *s) +{ + int t_len = KEYLEN; + + while (*s > ' ' && *s != ':' && *s != ',' && t_len--) + s++; + *s = '\0'; +} + /* * Helper function to convert keys */ static void mode_parse_key(struct ParseState *state, int *flag_p) { - char *t_str, *s; - int t_len; + char *t_str; if (MyUser(state->sptr) && state->max_args <= 0) /* drop if too many args */ return; @@ -2621,15 +2626,9 @@ return; state->done |= DONE_KEY; - t_len = KEYLEN; - /* clean up the key string */ - s = t_str; - while (*s > ' ' && *s != ':' && *s != ',' && t_len--) - s++; - *s = '\0'; - - if (!*t_str) { /* warn if empty */ + clean_key(t_str); + if (!*t_str || *t_str == ':') { /* warn if empty */ if (MyUser(state->sptr)) need_more_params(state->sptr, state->dir == MODE_ADD ? "MODE +k" : "MODE -k"); @@ -2683,8 +2682,7 @@ static void mode_parse_upass(struct ParseState *state, int *flag_p) { - char *t_str, *s; - int t_len; + char *t_str; if (MyUser(state->sptr) && state->max_args <= 0) /* drop if too many args */ return; @@ -2719,10 +2717,8 @@ if (*state->chptr->mode.apass) { send_reply(state->sptr, ERR_NOTMANAGER, state->chptr->chname, state->chptr->chname); - } else if (TStime() - state->chptr->creationtime >= 171000) { - send_reply(state->sptr, ERR_NOMANAGER_LONG, state->chptr->chname); } else { - send_reply(state->sptr, ERR_NOMANAGER_SHORT, state->chptr->chname); + send_reply(state->sptr, ERR_NOMANAGER, state->chptr->chname); } return; } @@ -2731,15 +2727,9 @@ return; state->done |= DONE_UPASS; - t_len = PASSLEN + 1; - /* clean up the upass string */ - s = t_str; - while (*++s > ' ' && *s != ':' && --t_len) - ; - *s = '\0'; - - if (!*t_str) { /* warn if empty */ + clean_key(t_str); + if (!*t_str || *t_str == ':') { /* warn if empty */ if (MyUser(state->sptr)) need_more_params(state->sptr, state->dir == MODE_ADD ? "MODE +U" : "MODE -U"); @@ -2784,7 +2774,7 @@ if (state->flags & MODE_PARSE_SET) { if (state->dir == MODE_ADD) /* set the new upass */ - ircd_strncpy(state->chptr->mode.upass, t_str, PASSLEN); + ircd_strncpy(state->chptr->mode.upass, t_str, KEYLEN); else /* remove the old upass */ *state->chptr->mode.upass = '\0'; } @@ -2796,8 +2786,8 @@ static void mode_parse_apass(struct ParseState *state, int *flag_p) { - char *t_str, *s; - int t_len; + struct Membership *memb; + char *t_str; if (MyUser(state->sptr) && state->max_args <= 0) /* drop if too many args */ return; @@ -2828,7 +2818,9 @@ } /* Don't allow to change the Apass if the channel is older than 48 hours. */ - if (TStime() - state->chptr->creationtime >= 172800 && !IsAnOper(state->sptr)) { + if (MyUser(state->sptr) + && TStime() - state->chptr->creationtime >= 172800 + && !IsAnOper(state->sptr)) { send_reply(state->sptr, ERR_CHANSECURED, state->chptr->chname); return; } @@ -2838,10 +2830,8 @@ if (*state->chptr->mode.apass) { send_reply(state->sptr, ERR_NOTMANAGER, state->chptr->chname, state->chptr->chname); - } else if (TStime() - state->chptr->creationtime >= 171000) { - send_reply(state->sptr, ERR_NOMANAGER_LONG, state->chptr->chname); } else { - send_reply(state->sptr, ERR_NOMANAGER_SHORT, state->chptr->chname); + send_reply(state->sptr, ERR_NOMANAGER, state->chptr->chname); } return; } @@ -2850,15 +2840,9 @@ return; state->done |= DONE_APASS; - t_len = PASSLEN + 1; - /* clean up the apass string */ - s = t_str; - while (*++s > ' ' && *s != ':' && --t_len) - ; - *s = '\0'; - - if (!*t_str) { /* warn if empty */ + clean_key(t_str); + if (!*t_str || *t_str == ':') { /* warn if empty */ if (MyUser(state->sptr)) need_more_params(state->sptr, state->dir == MODE_ADD ? "MODE +A" : "MODE -A"); @@ -2898,16 +2882,24 @@ if (state->flags & MODE_PARSE_SET) { if (state->dir == MODE_ADD) { /* set the new apass */ /* Make it VERY clear to the user that this is a one-time password */ - ircd_strncpy(state->chptr->mode.apass, t_str, PASSLEN); + ircd_strncpy(state->chptr->mode.apass, t_str, KEYLEN); if (MyUser(state->sptr)) { send_reply(state->sptr, RPL_APASSWARN_SET, state->chptr->mode.apass); send_reply(state->sptr, RPL_APASSWARN_SECRET, state->chptr->chname, state->chptr->mode.apass); } + /* Give the channel manager level 0 ops. */ + if (!(state->flags & MODE_PARSE_FORCE) && IsChannelManager(state->member)) + SetOpLevel(state->member, 0); } else { /* remove the old apass */ *state->chptr->mode.apass = '\0'; if (MyUser(state->sptr)) send_reply(state->sptr, RPL_APASSWARN_CLEAR); + /* Revert everyone to MAXOPLEVEL. */ + for (memb = state->chptr->members; memb; memb = memb->next_member) { + if (memb->status & MODE_CHANOP) + SetOpLevel(memb, MAXOPLEVEL); + } } } } @@ -3064,7 +3056,7 @@ newban->flags = ((state->dir == MODE_ADD) ? BAN_ADD : BAN_DEL) | (*flag_p == MODE_BAN ? 0 : BAN_EXCEPTION); set_ban_mask(newban, collapse(pretty_mask(t_str))); - ircd_strncpy(newban->who, cli_name(state->sptr), HOSTLEN); + ircd_strncpy(newban->who, IsUser(state->sptr) ? cli_name(state->sptr) : "*", NICKLEN); newban->when = TStime(); apply_ban(&state->chptr->banlist, newban, 0); } @@ -3294,14 +3286,14 @@ /* set op-level of member being opped */ if ((state->cli_change[i].flag & (MODE_ADD | MODE_CHANOP)) == (MODE_ADD | MODE_CHANOP)) { - /* If being opped by an outsider, get oplevel 0 for an apass + /* If being opped by an outsider, get oplevel 1 for an apass * channel, else MAXOPLEVEL. * Otherwise, if not an apass channel, or state->member has * MAXOPLEVEL, get oplevel MAXOPLEVEL. * Otherwise, get state->member's oplevel+1. */ if (!state->member) - SetOpLevel(member, state->chptr->mode.apass[0] ? 0 : MAXOPLEVEL); + SetOpLevel(member, state->chptr->mode.apass[0] ? 1 : MAXOPLEVEL); else if (!state->chptr->mode.apass[0] || OpLevel(state->member) == MAXOPLEVEL) SetOpLevel(member, MAXOPLEVEL); else @@ -3481,12 +3473,12 @@ #if defined(UNDERNET) case 'A': /* deal with Admin passes */ - if (feature_bool(FEAT_OPLEVELS)) + if (IsServer(cptr) || feature_bool(FEAT_OPLEVELS)) mode_parse_apass(&state, flag_p); break; case 'U': /* deal with user passes */ - if (feature_bool(FEAT_OPLEVELS)) + if (IsServer(cptr) || feature_bool(FEAT_OPLEVELS)) mode_parse_upass(&state, flag_p); break; #endif @@ -3703,10 +3695,11 @@ if (jbuf->jb_type != JOINBUF_TYPE_CREATE && !IsLocalChannel(chan->chname)) { #if defined(UNDERNET) - if (flags & CHFL_CHANOP) + if (flags & CHFL_CHANOP) { + assert(oplevel == 0 || oplevel == 1); sendcmdto_serv_butone(jbuf->jb_source, CMD_JOIN, jbuf->jb_connect, "%u:%H %Tu", oplevel, chan, chan->creationtime); - else + } else #elif defined(DDB) if (flags & CHFL_OWNER) sendcmdto_serv_butone(jbuf->jb_source, CMD_JOIN, jbuf->jb_connect, Index: ircd-ircdev/ircd/class.c diff -u ircd-ircdev/ircd/class.c:1.8 ircd-ircdev/ircd/class.c:1.9 --- ircd-ircdev/ircd/class.c:1.8 Wed Jun 22 00:54:29 2005 +++ ircd-ircdev/ircd/class.c Thu Sep 1 04:25:42 2005 @@ -21,7 +21,7 @@ */ /** @file * @brief Implementation of connection class handling functions. - * @version $Id: class.c,v 1.8 2005/06/22 07:54:29 zolty Exp $ + * @version $Id: class.c,v 1.9 2005/09/01 11:25:42 zolty Exp $ */ #include "config.h" @@ -104,7 +104,7 @@ MaxLinks(connClassList) = feature_int(FEAT_MAXIMUM_LINKS); MaxSendq(connClassList) = feature_int(FEAT_DEFAULTMAXSENDQLENGTH); connClassList->valid = 1; - Links(connClassList) = 0; + Links(connClassList) = 1; connClassList->next = 0; } @@ -260,7 +260,7 @@ for (cltmp = connClassList; cltmp; cltmp = cltmp->next) send_reply(sptr, RPL_STATSYLINE, 'Y', ConClass(cltmp), PingFreq(cltmp), ConFreq(cltmp), MaxLinks(cltmp), MaxSendq(cltmp), - Links(cltmp)); + Links(cltmp) - 1); } /** Return maximum SendQ length for a client. Index: ircd-ircdev/ircd/engine_epoll.c diff -u ircd-ircdev/ircd/engine_epoll.c:1.10 ircd-ircdev/ircd/engine_epoll.c:1.11 --- ircd-ircdev/ircd/engine_epoll.c:1.10 Sat May 7 15:23:40 2005 +++ ircd-ircdev/ircd/engine_epoll.c Thu Sep 1 04:25:42 2005 @@ -21,7 +21,7 @@ */ /** @file * @brief Linux epoll_*() event engine. - * @version $Id: engine_epoll.c,v 1.10 2005/05/07 22:23:40 zolty Exp $ + * @version $Id: engine_epoll.c,v 1.11 2005/09/01 11:25:42 zolty Exp $ */ #include "config.h" @@ -51,11 +51,7 @@ /* Oh, did we mention that some glibc releases do not even define the * syscall numbers? */ #if !defined(__NR_epoll_create) -#if defined(__i386__) -#define __NR_epoll_create 254 -#define __NR_epoll_ctl 255 -#define __NR_epoll_wait 256 -#elif defined(__ia64__) +#if defined(__ia64__) #define __NR_epoll_create 1243 #define __NR_epoll_ctl 1244 #define __NR_epoll_wait 1245 @@ -63,6 +59,34 @@ #define __NR_epoll_create 214 #define __NR_epoll_ctl 233 #define __NR_epoll_wait 232 +#elif defined(__sparc64__) || defined(__sparc__) +#define __NR_epoll_create 193 +#define __NR_epoll_ctl 194 +#define __NR_epoll_wait 195 +#elif defined(__s390__) || defined(__m68k__) +#define __NR_epoll_create 249 +#define __NR_epoll_ctl 250 +#define __NR_epoll_wait 251 +#elif defined(__ppc64__) || defined(__ppc__) +#define __NR_epoll_create 236 +#define __NR_epoll_ctl 237 +#define __NR_epoll_wait 238 +#elif defined(__parisc__) || defined(__arm26__) || defined(__arm__) +#define __NR_epoll_create 224 +#define __NR_epoll_ctl 225 +#define __NR_epoll_wait 226 +#elif defined(__alpha__) +#define __NR_epoll_create 407 +#define __NR_epoll_ctl 408 +#define __NR_epoll_wait 409 +#elif defined(__sh64__) +#define __NR_epoll_create 282 +#define __NR_epoll_ctl 283 +#define __NR_epoll_wait 284 +#elif defined(__i386__) || defined(__sh__) || defined(__m32r__) || defined(__h8300__) || defined(__frv__) +#define __NR_epoll_create 254 +#define __NR_epoll_ctl 255 +#define __NR_epoll_wait 256 #else /* cpu types */ #error No system call numbers defined for epoll family. #endif /* cpu types */ Index: ircd-ircdev/ircd/engine_select.c diff -u ircd-ircdev/ircd/engine_select.c:1.5 ircd-ircdev/ircd/engine_select.c:1.6 --- ircd-ircdev/ircd/engine_select.c:1.5 Mon Jan 10 04:22:58 2005 +++ ircd-ircdev/ircd/engine_select.c Thu Sep 1 04:25:42 2005 @@ -21,23 +21,23 @@ */ /** @file * @brief BSD sockets select() event engine. - * @version $Id: engine_select.c,v 1.5 2005/01/10 12:22:58 zolty Exp $ + * @version $Id: engine_select.c,v 1.6 2005/09/01 11:25:42 zolty Exp $ */ #include "config.h" -#include "ircd_events.h" - -#include "ircd.h" -#include "ircd_log.h" -#include "s_debug.h" - /* On BSD, define FD_SETSIZE to what we want before including sys/types.h */ #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__bsdi__) # if !defined(FD_SETSIZE) -# define FD_SETSIZE MAXCONNECTIONS +# define FD_SETSIZE ((MAXCONNECTIONS)+4) # endif #endif +#include "ircd_events.h" + +#include "ircd.h" +#include "ircd_log.h" +#include "s_debug.h" + /* #include <assert.h> -- Now using assert in ircd_log.h */ #include <errno.h> #include <string.h> /* needed for bzero() on OS X */ @@ -47,6 +47,20 @@ #include <time.h> #include <unistd.h> +#if FD_SETSIZE < (MAXCONNECTIONS + 4) +/* + * Sanity check + * + * All operating systems work when MAXCONNECTIONS <= 252. + * Most operating systems work when MAXCONNECTIONS <= 1020 and FD_SETSIZE is + * updated correctly in the system headers (on BSD systems sys/types.h might + * have abruptly redefined it so the check is still done), you might + * already need to recompile your kernel. + * For larger FD_SETSIZE your mileage may vary (kernel patches may be needed). + */ +# error FD_SETSIZE is too small or MAXCONNECTIONS too large. +#endif + #define SELECT_ERROR_THRESHOLD 20 /**< after 20 select errors, restart */ #define ERROR_EXPIRE_TIME 3600 /**< expire errors after an hour */ Index: ircd-ircdev/ircd/gline.c diff -u ircd-ircdev/ircd/gline.c:1.14 ircd-ircdev/ircd/gline.c:1.15 --- ircd-ircdev/ircd/gline.c:1.14 Fri Apr 22 09:22:13 2005 +++ ircd-ircdev/ircd/gline.c Thu Sep 1 04:25:42 2005 @@ -23,7 +23,7 @@ */ /** @file * @brief Implementation of Gline manipulation functions. - * @version $Id: gline.c,v 1.14 2005/04/22 16:22:13 zolty Exp $ + * @version $Id: gline.c,v 1.15 2005/09/01 11:25:42 zolty Exp $ */ #include "config.h" @@ -404,7 +404,12 @@ /* uh, what to do here? */ /* The answer, my dear Watson, is we throw a protocol_violation() -- hikari */ - return protocol_violation(sptr,"%s has been smoking the sweet leaf and sent me a whacky gline",cli_name(sptr)); + if (IsServer(cptr)) + return protocol_violation(sptr,"%s has been smoking the sweet leaf and sent me a whacky gline",cli_name(sptr)); + else { + sendto_opmask_butone(NULL, SNO_GLINE, "%s has been smoking the sweet leaf and sent me a whacky gline", cli_name(sptr)); + return 0; + } break; } user = (*userhost =='$' ? userhost : userhost+2); Index: ircd-ircdev/ircd/ircd.c diff -u ircd-ircdev/ircd/ircd.c:1.20 ircd-ircdev/ircd/ircd.c:1.21 --- ircd-ircdev/ircd/ircd.c:1.20 Wed Jun 22 00:54:29 2005 +++ ircd-ircdev/ircd/ircd.c Thu Sep 1 04:25:42 2005 @@ -21,7 +21,7 @@ */ /** @file * @brief Entry point and other initialization functions for the daemon. - * @version $Id: ircd.c,v 1.20 2005/06/22 07:54:29 zolty Exp $ + * @version $Id: ircd.c,v 1.21 2005/09/01 11:25:42 zolty Exp $ */ #include "config.h" @@ -495,6 +495,9 @@ #ifdef USE_DEVPOLL printf("/dev/poll "); #endif +#ifdef USE_EPOLL + printf("epoll_*() "); +#endif #ifdef USE_POLL printf("poll()"); #else Index: ircd-ircdev/ircd/ircd_auth.c diff -u ircd-ircdev/ircd/ircd_auth.c:1.7 ircd-ircdev/ircd/ircd_auth.c:1.8 --- ircd-ircdev/ircd/ircd_auth.c:1.7 Sun Jul 3 13:21:42 2005 +++ ircd-ircdev/ircd/ircd_auth.c Thu Sep 1 04:25:42 2005 @@ -22,7 +22,7 @@ */ /** @file * @brief IAuth client implementation for an IRC server. - * @version $Id: ircd_auth.c,v 1.7 2005/07/03 20:21:42 zolty Exp $ + * @version $Id: ircd_auth.c,v 1.8 2005/09/01 11:25:42 zolty Exp $ */ #include "config.h" #include "client.h" @@ -367,7 +367,7 @@ assert(format != 0); vd.vd_format = format; va_start(vd.vd_args, format); - sendwallto_group_butone(&me, WALL_DESYNCH, NULL, "IAuth protocol violation: %v", &vd); + sendto_opmask_butone(NULL, SNO_CONNEXIT, "IAuth protocol violation: %v", &vd); va_end(vd.vd_args); } Index: ircd-ircdev/ircd/ircd_features.c diff -u ircd-ircdev/ircd/ircd_features.c:1.14 ircd-ircdev/ircd/ircd_features.c:1.15 --- ircd-ircdev/ircd/ircd_features.c:1.14 Sat Apr 2 11:47:35 2005 +++ ircd-ircdev/ircd/ircd_features.c Thu Sep 1 04:25:42 2005 @@ -21,7 +21,7 @@ */ /** @file * @brief Implementation of configurable feature support. - * @version $Id: ircd_features.c,v 1.14 2005/04/02 19:47:35 zolty Exp $ + * @version $Id: ircd_features.c,v 1.15 2005/09/01 11:25:42 zolty Exp $ */ #include "config.h" @@ -323,6 +323,7 @@ F_I(IPCHECK_CLONE_LIMIT, 0, 4, 0), F_I(IPCHECK_CLONE_PERIOD, 0, 40, 0), F_I(IPCHECK_CLONE_DELAY, 0, 600, 0), + F_I(CHANNELLEN, 0, 200, 0), /* Some misc. default paths */ F_S(MPATH, FEAT_CASE | FEAT_MYOPER, "ircd.motd", motd_init), Index: ircd-ircdev/ircd/ircd_log.c diff -u ircd-ircdev/ircd/ircd_log.c:1.11 ircd-ircdev/ircd/ircd_log.c:1.12 --- ircd-ircdev/ircd/ircd_log.c:1.11 Mon May 16 03:17:27 2005 +++ ircd-ircdev/ircd/ircd_log.c Thu Sep 1 04:25:42 2005 @@ -22,7 +22,7 @@ */ /** @file * @brief IRC logging implementation. - * @version $Id: ircd_log.c,v 1.11 2005/05/16 10:17:27 zolty Exp $ + * @version $Id: ircd_log.c,v 1.12 2005/09/01 11:25:42 zolty Exp $ */ #include "config.h" @@ -198,10 +198,8 @@ { /* only open the file if we haven't already */ if (lf && lf->fd < 0) { - alarm(3); /* if NFS hangs, we hang only for 3 seconds */ lf->fd = open(lf->file, O_WRONLY | O_CREAT | O_APPEND, S_IRUSR | S_IWUSR); - alarm(0); } } Index: ircd-ircdev/ircd/ircd_parser.y diff -u ircd-ircdev/ircd/ircd_parser.y:1.21 ircd-ircdev/ircd/ircd_parser.y:1.22 --- ircd-ircdev/ircd/ircd_parser.y:1.21 Mon May 16 04:22:50 2005 +++ ircd-ircdev/ircd/ircd_parser.y Thu Sep 1 04:25:42 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.21 2005/05/16 11:22:50 zolty Exp $ + * $Id: ircd_parser.y,v 1.22 2005/09/01 11:25:42 zolty Exp $ * */ %{ @@ -262,11 +262,14 @@ jupenick: NICK '=' QSTRING ';' { addNickJupes($3); - MyFree($3); -}; + MyFree($3);}; -generalblock: GENERAL '{' generalitems '}' ';' +generalblock: GENERAL { + /* Zero out the vhost addresses, in case they were removed. */ + memset(&VirtualHost_v4.addr, 0, sizeof(VirtualHost_v4.addr)); + memset(&VirtualHost_v6.addr, 0, sizeof(VirtualHost_v6.addr)); +} '{' generalitems '}' ';' { if (localConf.name == NULL) parse_error("Your General block must contain a name."); if (localConf.numeric == 0) @@ -305,8 +308,11 @@ generalvhost: VHOST '=' QSTRING ';' { struct irc_in_addr addr; - if (!ircd_aton(&addr, $3)) - parse_error("Invalid virtual host '%s'.", $3); + if (!strcmp($3, "*")) { + /* This traditionally meant bind to all interfaces and connect + * from the default. */ + } else if (!ircd_aton(&addr, $3)) + parse_error("Invalid virtual host '%s'.", $3); else if (irc_in_addr_is_ipv4(&addr)) memcpy(&VirtualHost_v4.addr, &addr, sizeof(addr)); else @@ -955,16 +961,7 @@ } else { - struct nick_host *nh, *next; - for (nh = smap->services; nh; nh = next) - { - next = nh->next; - MyFree(nh); - } - MyFree(smap->name); - MyFree(smap->command); - MyFree(smap->prepend); - MyFree(smap); + free_mapping(smap); } smap = NULL; }; Index: ircd-ircdev/ircd/listener.c diff -u ircd-ircdev/ircd/listener.c:1.8 ircd-ircdev/ircd/listener.c:1.9 --- ircd-ircdev/ircd/listener.c:1.8 Mon Jan 10 04:23:01 2005 +++ ircd-ircdev/ircd/listener.c Thu Sep 1 04:25:42 2005 @@ -21,7 +21,7 @@ */ /** @file * @brief Implementation for handling listening sockets. - * @version $Id: listener.c,v 1.8 2005/01/10 12:23:01 zolty Exp $ + * @version $Id: listener.c,v 1.9 2005/09/01 11:25:42 zolty Exp $ */ #include "config.h" @@ -333,7 +333,7 @@ } /** Close all inactive listeners. */ -void close_listeners() +void close_listeners(void) { struct Listener* listener; struct Listener* listener_next = 0; Index: ircd-ircdev/ircd/m_burst.c diff -u ircd-ircdev/ircd/m_burst.c:1.12 ircd-ircdev/ircd/m_burst.c:1.13 --- ircd-ircdev/ircd/m_burst.c:1.12 Wed Jun 22 00:54:29 2005 +++ ircd-ircdev/ircd/m_burst.c Thu Sep 1 04:25:42 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: m_burst.c,v 1.12 2005/06/22 07:54:29 zolty Exp $ + * $Id: m_burst.c,v 1.13 2005/09/01 11:25:42 zolty Exp $ * */ @@ -548,7 +548,7 @@ member->status |= CHFL_BURST_ALREADY_VOICED; /* Synchronize with the burst. */ member->status |= CHFL_BURST_JOINED | (current_mode & (CHFL_CHANOP|CHFL_VOICE)); - member->oplevel = oplevel; + SetOpLevel(member, oplevel); } Index: ircd-ircdev/ircd/m_join.c diff -u ircd-ircdev/ircd/m_join.c:1.12 irc... [truncated message content] |
From: Toni G. <zo...@us...> - 2005-07-03 20:22:01
|
CVSROOT : /cvsroot/irc-dev Module : ircd-ircdev Commit time: 2005-07-03 20:21:52 UTC Modified files: ChangeLog ChangeLog.es include/client.h include/patchlevel.h include/res.h include/s_bsd.h include/s_misc.h ircd/hash.c ircd/ircd_auth.c ircd/ircd_crypt.c ircd/ircd_res.c ircd/list.c ircd/m_invite.c ircd/s_auth.c ircd/s_bsd.c ircd/s_conf.c ircd/s_misc.c ircd/s_serv.c ircd/s_user.c Log message: Author: zoltan <zo...@ir...> Log message: 2005-07-03 Toni García <zo...@ir...> 1.0.alpha42 * Sincronización Undernet ---------------------- diff included ---------------------- Index: ircd-ircdev/ChangeLog diff -u ircd-ircdev/ChangeLog:1.43 ircd-ircdev/ChangeLog:1.44 --- ircd-ircdev/ChangeLog:1.43 Sun Jul 3 11:44:51 2005 +++ ircd-ircdev/ChangeLog Sun Jul 3 13:21:41 2005 @@ -1,10 +1,13 @@ # # ChangeLog for ircd-ircdev # -# $Id: ChangeLog,v 1.43 2005/07/03 18:44:51 zolty Exp $ +# $Id: ChangeLog,v 1.44 2005/07/03 20:21:41 zolty Exp $ # # Insert new changes at beginning of the change list. # +2005-07-03 Toni García <zo...@ir...> 1.0.alpha42 + * Undernet synchronization + 2005-07-03 Toni García <zo...@ir...> 1.0.alpha41 * Crypted ips (only IPv4) Index: ircd-ircdev/ChangeLog.es diff -u ircd-ircdev/ChangeLog.es:1.43 ircd-ircdev/ChangeLog.es:1.44 --- ircd-ircdev/ChangeLog.es:1.43 Sun Jul 3 11:44:51 2005 +++ ircd-ircdev/ChangeLog.es Sun Jul 3 13:21:41 2005 @@ -1,10 +1,13 @@ # # Log de Cambios para ircd-ircdev # -# $Id: ChangeLog.es,v 1.43 2005/07/03 18:44:51 zolty Exp $ +# $Id: ChangeLog.es,v 1.44 2005/07/03 20:21:41 zolty Exp $ # # Insertar los nuevos cambios al principio de esta lista de cambios. # +2005-07-03 Toni García <zo...@ir...> 1.0.alpha42 + * Sincronización Undernet + 2005-07-03 Toni García <zo...@ir...> 1.0.alpha41 * IPs cifradas (sólo IPv4) Index: ircd-ircdev/include/client.h diff -u ircd-ircdev/include/client.h:1.15 ircd-ircdev/include/client.h:1.16 --- ircd-ircdev/include/client.h:1.15 Mon Apr 11 01:44:59 2005 +++ ircd-ircdev/include/client.h Sun Jul 3 13:21:41 2005 @@ -21,7 +21,7 @@ */ /** @file * @brief Structures and functions for handling local clients. - * @version $Id: client.h,v 1.15 2005/04/11 08:44:59 zolty Exp $ + * @version $Id: client.h,v 1.16 2005/07/03 20:21:41 zolty Exp $ */ #ifndef INCLUDED_client_h #define INCLUDED_client_h @@ -225,8 +225,6 @@ struct SLink* con_confs; /**< Associated configuration records. */ HandlerType con_handler; /**< Message index into command table for parsing. */ - struct DNSReply* con_dns_reply; /**< DNS reply received during client - registration. */ struct ListingArgs* con_listing; /**< Current LIST status. */ unsigned long con_unreg; /**< Indicate what still needs to be done */ unsigned int con_max_sendq; /**< cached max send queue for client */ @@ -382,8 +380,6 @@ #define cli_confs(cli) con_confs(cli_connect(cli)) /** Get handler type for client. */ #define cli_handler(cli) con_handler(cli_connect(cli)) -/** Get DNS reply for client. */ -#define cli_dns_reply(cli) con_dns_reply(cli_connect(cli)) /** Get LIST status for client. */ #define cli_listing(cli) con_listing(cli_connect(cli)) /** Get cached max SendQ for client. */ @@ -463,8 +459,6 @@ #define con_confs(con) ((con)->con_confs) /** Get command handler for the connection. */ #define con_handler(con) ((con)->con_handler) -/** Get DNS reply for the connection. */ -#define con_dns_reply(con) ((con)->con_dns_reply) /** Get the LIST status for the connection. */ #define con_listing(con) ((con)->con_listing) /** Get remining steps before registration completes. */ Index: ircd-ircdev/include/patchlevel.h diff -u ircd-ircdev/include/patchlevel.h:1.42 ircd-ircdev/include/patchlevel.h:1.43 --- ircd-ircdev/include/patchlevel.h:1.42 Wed Jun 22 03:01:25 2005 +++ ircd-ircdev/include/patchlevel.h Sun Jul 3 13:21:41 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.42 2005/06/22 10:01:25 zolty Exp $ + * $Id: patchlevel.h,v 1.43 2005/07/03 20:21:41 zolty Exp $ * */ -#define PATCHLEVEL ".alpha41" +#define PATCHLEVEL ".alpha42" #define RELEASE "1.0" Index: ircd-ircdev/include/res.h diff -u ircd-ircdev/include/res.h:1.7 ircd-ircdev/include/res.h:1.8 --- ircd-ircdev/include/res.h:1.7 Mon Jan 10 04:22:00 2005 +++ ircd-ircdev/include/res.h Sun Jul 3 13:21:41 2005 @@ -22,7 +22,7 @@ */ /** @file * @brief IRC resolver API. - * @version $Id: res.h,v 1.7 2005/01/10 12:22:00 zolty Exp $ + * @version $Id: res.h,v 1.8 2005/07/03 20:21:41 zolty Exp $ */ #ifndef INCLUDED_res_h @@ -88,19 +88,8 @@ unsigned short port; /**< Port number, host-endian. */ }; -/** DNS reply structure. */ -struct DNSReply -{ - char *h_name; /**< Hostname. */ - struct irc_in_addr addr; /**< IP address. */ -}; - -/** DNS callback structure. */ -struct DNSQuery -{ - void *vptr; /**< pointer used by callback to identify request */ - void (*callback)(void* vptr, struct DNSReply *reply); /**< callback to call */ -}; +/** DNS callback function signature. */ +typedef void (*dns_callback_f)(void *vptr, const struct irc_in_addr *addr, const char *h_name); /** DNS query and response header. */ typedef struct @@ -145,8 +134,8 @@ extern size_t cres_mem(struct Client* cptr); extern void delete_resolver_queries(const void *vptr); extern void report_dns_servers(struct Client *source_p, const struct StatDesc *sd, char *param); -extern void gethost_byname(const char *name, const struct DNSQuery *query); -extern void gethost_byaddr(const struct irc_in_addr *addr, const struct DNSQuery *query); +extern void gethost_byname(const char *name, dns_callback_f callback, void *ctx); +extern void gethost_byaddr(const struct irc_in_addr *addr, dns_callback_f callback, void *ctx); /** Evaluate to non-zero if \a ADDR is a valid address (not all 0s and not all 1s). */ #define irc_in_addr_valid(ADDR) (((ADDR)->in6_16[0] && ~(ADDR)->in6_16[0]) \ Index: ircd-ircdev/include/s_bsd.h diff -u ircd-ircdev/include/s_bsd.h:1.6 ircd-ircdev/include/s_bsd.h:1.7 --- ircd-ircdev/include/s_bsd.h:1.6 Mon Jan 10 04:22:00 2005 +++ ircd-ircdev/include/s_bsd.h Sun Jul 3 13:21:41 2005 @@ -21,7 +21,7 @@ */ /** @file s_bsd.h * @brief Wrapper functions to avoid direct use of BSD APIs. - * @version $Id: s_bsd.h,v 1.6 2005/01/10 12:22:00 zolty Exp $ + * @version $Id: s_bsd.h,v 1.7 2005/07/03 20:21:41 zolty Exp $ */ #ifndef INCLUDED_s_bsd_h #define INCLUDED_s_bsd_h @@ -81,7 +81,6 @@ */ extern unsigned int deliver_it(struct Client *cptr, struct MsgQ *buf); extern int connect_server(struct ConfItem* aconf, struct Client* by); -extern void release_dns_reply(struct Client* cptr); extern int net_close_unregistered_connections(struct Client* source); extern void close_connection(struct Client *cptr); extern void add_connection(struct Listener* listener, int fd); Index: ircd-ircdev/include/s_misc.h diff -u ircd-ircdev/include/s_misc.h:1.4 ircd-ircdev/include/s_misc.h:1.5 --- ircd-ircdev/include/s_misc.h:1.4 Mon Jan 10 04:22:00 2005 +++ ircd-ircdev/include/s_misc.h Sun Jul 3 13:21:41 2005 @@ -21,7 +21,7 @@ */ /** @file s_misc.h * @brief Miscellaneous support functions and declarations. - * @version $Id: s_misc.h,v 1.4 2005/01/10 12:22:00 zolty Exp $ + * @version $Id: s_misc.h,v 1.5 2005/07/03 20:21:41 zolty Exp $ */ #ifndef INCLUDED_s_misc_h #define INCLUDED_s_misc_h @@ -105,7 +105,6 @@ struct Client *sptr, const char *pattern, ...); extern void initstats(void); extern char *date(time_t clock); -extern void get_sockhost(struct Client *cptr, char *host); extern int vexit_client_msg(struct Client *cptr, struct Client *bcptr, struct Client *sptr, const char *pattern, va_list vl); extern void tstats(struct Client *cptr, const struct StatDesc *sd, Index: ircd-ircdev/ircd/hash.c diff -u ircd-ircdev/ircd/hash.c:1.11 ircd-ircdev/ircd/hash.c:1.12 --- ircd-ircdev/ircd/hash.c:1.11 Wed Jun 22 02:58:52 2005 +++ ircd-ircdev/ircd/hash.c Sun Jul 3 13:21:42 2005 @@ -22,7 +22,7 @@ */ /** @file * @brief Hash table management. - * @version $Id: hash.c,v 1.11 2005/06/22 09:58:52 zolty Exp $ + * @version $Id: hash.c,v 1.12 2005/07/03 20:21:42 zolty Exp $ * * This file used to use some very complicated hash function. Now it * uses CRC-32, but effectively remaps each input byte according to a @@ -40,6 +40,7 @@ #include "ircd_reply.h" #include "ircd_string.h" #include "ircd.h" +#include "match.h" #include "msg.h" #include "numeric.h" #include "random.h" Index: ircd-ircdev/ircd/ircd_auth.c diff -u ircd-ircdev/ircd/ircd_auth.c:1.6 ircd-ircdev/ircd/ircd_auth.c:1.7 --- ircd-ircdev/ircd/ircd_auth.c:1.6 Sat May 7 15:23:40 2005 +++ ircd-ircdev/ircd/ircd_auth.c Sun Jul 3 13:21:42 2005 @@ -22,7 +22,7 @@ */ /** @file * @brief IAuth client implementation for an IRC server. - * @version $Id: ircd_auth.c,v 1.6 2005/05/07 22:23:40 zolty Exp $ + * @version $Id: ircd_auth.c,v 1.7 2005/07/03 20:21:42 zolty Exp $ */ #include "config.h" #include "client.h" @@ -84,7 +84,6 @@ struct Timer i_reconn_timer; /**< when to reconnect the connection */ struct Timer i_request_timer; /**< when the current request times out */ struct IAuthFlags i_flags; /**< connection state/status/flags */ - struct DNSQuery i_query; /**< DNS lookup for iauth server */ unsigned int i_recvM; /**< messages received */ unsigned int i_sendM; /**< messages sent */ unsigned int i_recvK; /**< kilobytes received */ @@ -408,13 +407,13 @@ * @param[in] vptr Pointer to the IAuth struct. * @param[in] he DNS reply parameters. */ -static void iauth_dns_callback(void *vptr, struct DNSReply *he) +static void iauth_dns_callback(void *vptr, const struct irc_in_addr *addr, const char *h_name) { struct IAuth *iauth = vptr; - if (!he) { + if (!addr) { log_write(LS_IAUTH, L_NOTICE, 0, "IAuth connection to %s failed: host lookup failed", i_host(iauth)); } else { - memcpy(&i_addr(iauth).addr, &he->addr, sizeof(i_addr(iauth).addr)); + memcpy(&i_addr(iauth).addr, &addr, sizeof(i_addr(iauth).addr)); if (!irc_in_addr_valid(&i_addr(iauth).addr)) { log_write(LS_IAUTH, L_NOTICE, 0, "IAuth connection to %s failed: host came back as unresolved", i_host(iauth)); return; @@ -463,9 +462,7 @@ log_write(LS_IAUTH, L_DEBUG, 0, "IAuth attempt connection to %s port %p.", i_host(iauth), i_port(iauth)); if (!irc_in_addr_valid(&i_addr(iauth).addr) && !ircd_aton(&i_addr(iauth).addr, i_host(iauth))) { - i_query(iauth).vptr = iauth; - i_query(iauth).callback = iauth_dns_callback; - gethost_byname(i_host(iauth), &i_query(iauth)); + gethost_byname(i_host(iauth), iauth_dns_callback, iauth); return; } local = irc_in_addr_is_ipv4(&i_addr(iauth).addr) ? &VirtualHost_v4 : &VirtualHost_v6; Index: ircd-ircdev/ircd/ircd_crypt.c diff -u ircd-ircdev/ircd/ircd_crypt.c:1.4 ircd-ircdev/ircd/ircd_crypt.c:1.5 --- ircd-ircdev/ircd/ircd_crypt.c:1.4 Mon Mar 21 10:39:07 2005 +++ ircd-ircdev/ircd/ircd_crypt.c Sun Jul 3 13:21:42 2005 @@ -22,7 +22,7 @@ /** * @file * @brief Core password encryption routines. - * @version $Id: ircd_crypt.c,v 1.4 2005/03/21 18:39:07 zolty Exp $ + * @version $Id: ircd_crypt.c,v 1.5 2005/07/03 20:21:42 zolty Exp $ * * This is a new look crypto API for ircu, it can handle different * password formats by the grace of magic tokens at the beginning of the @@ -202,9 +202,13 @@ /* try to use native crypt for an old-style (untagged) password */ if (strlen(salt) > 2) { + char *s; temp_hashed_pass = (char*)ircd_crypt_native(key, salt); if (!ircd_strcmp(temp_hashed_pass, salt)) - return strdup(temp_hashed_pass); + { + DupString(s, temp_hashed_pass); + return s; + } } return NULL; Index: ircd-ircdev/ircd/ircd_res.c diff -u ircd-ircdev/ircd/ircd_res.c:1.9 ircd-ircdev/ircd/ircd_res.c:1.10 --- ircd-ircdev/ircd/ircd_res.c:1.9 Wed Jun 22 00:54:29 2005 +++ ircd-ircdev/ircd/ircd_res.c Sun Jul 3 13:21:42 2005 @@ -41,7 +41,7 @@ */ /** @file * @brief IRC resolver functions. - * @version $Id: ircd_res.c,v 1.9 2005/06/22 07:54:29 zolty Exp $ + * @version $Id: ircd_res.c,v 1.10 2005/07/03 20:21:42 zolty Exp $ */ #include "client.h" #include "ircd_alloc.h" @@ -137,17 +137,19 @@ time_t timeout; /**< When this request times out. */ struct irc_in_addr addr; /**< Address for this request. */ char *name; /**< Hostname for this request. */ - struct DNSQuery query; /**< Query callback for this request. */ + dns_callback_f callback; /**< Callback function on completion. */ + void *callback_ctx; /**< Context pointer for callback. */ }; /** Base of request list. */ static struct dlink request_list; static void rem_request(struct reslist *request); -static struct reslist *make_request(const struct DNSQuery *query); -static void do_query_name(const struct DNSQuery *query, + +static struct reslist *make_request(dns_callback_f callback, void *ctx); +static void do_query_name(dns_callback_f callback, void *ctx, const char* name, struct reslist *request, int); -static void do_query_number(const struct DNSQuery *query, +static void do_query_number(dns_callback_f callback, void *ctx, const struct irc_in_addr *, struct reslist *request); static void query_name(const char *name, int query_class, int query_type, @@ -156,7 +158,6 @@ static void resend_query(struct reslist *request); static int proc_answer(struct reslist *request, HEADER *header, char *, char *); static struct reslist *find_id(int id); -static struct DNSReply *make_dnsreply(struct reslist *request); static void res_readreply(struct Event *ev); static void timeout_resolver(struct Event *notused); @@ -270,7 +271,7 @@ * @return Newly allocated and linked-in reslist. */ static struct reslist * -make_request(const struct DNSQuery* query) +make_request(dns_callback_f callback, void *ctx) { struct reslist *request; @@ -286,7 +287,8 @@ request->resend = 1; request->timeout = feature_int(FEAT_IRCD_RES_TIMEOUT); memset(&request->addr, 0, sizeof(request->addr)); - memcpy(&request->query, query, sizeof(request->query)); + request->callback = callback; + request->callback_ctx = ctx; add_dlink(&request->node, &request_list); return(request); @@ -335,7 +337,7 @@ if (--request->retries <= 0) { Debug((DEBUG_DNS, "Request %p out of retries; destroying", request)); - (*request->query.callback)(request->query.vptr, 0); + (*request->callback)(request->callback_ctx, NULL, NULL); rem_request(request); continue; } @@ -374,7 +376,7 @@ { next_ptr = ptr->next; request = (struct reslist*)ptr; - if (vptr == request->query.vptr) { + if (vptr == request->callback_ctx) { Debug((DEBUG_DNS, "Removing request %p with vptr %p", request, vptr)); rem_request(request); } @@ -439,9 +441,9 @@ * @param[in] query Callback information. */ void -gethost_byname(const char *name, const struct DNSQuery *query) +gethost_byname(const char *name, dns_callback_f callback, void *ctx) { - do_query_name(query, name, NULL, T_AAAA); + do_query_name(callback, ctx, name, NULL, T_AAAA); } /** Try to look up hostname for an address. @@ -449,9 +451,9 @@ * @param[in] query Callback information. */ void -gethost_byaddr(const struct irc_in_addr *addr, const struct DNSQuery *query) +gethost_byaddr(const struct irc_in_addr *addr, dns_callback_f callback, void *ctx) { - do_query_number(query, addr, NULL); + do_query_number(callback, ctx, addr, NULL); } /** Send a query to look up the address for a name. @@ -461,7 +463,7 @@ * @param[in] type Preferred request type. */ static void -do_query_name(const struct DNSQuery *query, const char *name, +do_query_name(dns_callback_f callback, void *ctx, const char *name, struct reslist *request, int type) { char host_name[HOSTLEN + 1]; @@ -471,7 +473,7 @@ if (request == NULL) { - request = make_request(query); + request = make_request(callback, ctx); DupString(request->name, host_name); #ifdef IPV6 if (type != T_A) @@ -492,7 +494,7 @@ * @param[in] request DNS lookup structure (may be NULL). */ static void -do_query_number(const struct DNSQuery *query, const struct irc_in_addr *addr, +do_query_number(dns_callback_f callback, void *ctx, const struct irc_in_addr *addr, struct reslist *request) { char ipbuf[128]; @@ -537,7 +539,7 @@ } if (request == NULL) { - request = make_request(query); + request = make_request(callback, ctx); request->state= REQ_PTR; request->type = T_PTR; memcpy(&request->addr, addr, sizeof(request->addr)); @@ -597,15 +599,15 @@ switch(request->type) { case T_PTR: - do_query_number(NULL, &request->addr, request); + do_query_number(NULL, NULL, &request->addr, request); break; case T_A: - do_query_name(NULL, request->name, request, request->type); + do_query_name(NULL, NULL, request->name, request, request->type); break; case T_AAAA: /* didn't work, try A */ if (request->state == REQ_AAAA) - do_query_name(NULL, request->name, request, T_A); + do_query_name(NULL, NULL, request->name, request, T_A); default: break; } @@ -774,7 +776,6 @@ char buf[sizeof(HEADER) + MAXPACKET]; HEADER *header; struct reslist *request = NULL; - struct DNSReply *reply = NULL; unsigned int rc; int answer_count; @@ -837,7 +838,7 @@ * send any more (no retries granted). */ Debug((DEBUG_DNS, "Request %p has bad response (state %d type %d rcode %d)", request, request->state, request->type, header->rcode)); - (*request->query.callback)(request->query.vptr, 0); + (*request->callback)(request->callback_ctx, NULL, NULL); rem_request(request); } } @@ -861,7 +862,7 @@ * don't bother trying again, the client address doesn't resolve */ Debug((DEBUG_DNS, "Request %p PTR had empty name", request)); - (*request->query.callback)(request->query.vptr, reply); + (*request->callback)(request->callback_ctx, NULL, NULL); rem_request(request); return; } @@ -872,10 +873,10 @@ */ #ifdef IPV6 if (!irc_in_addr_is_ipv4(&request->addr)) - do_query_name(&request->query, request->name, NULL, T_AAAA); + do_query_name(request->callback, request->callback_ctx, request->name, NULL, T_AAAA); else #endif - do_query_name(&request->query, request->name, NULL, T_A); + do_query_name(request->callback, request->callback_ctx, request->name, NULL, T_A); Debug((DEBUG_DNS, "Request %p switching to forward resolution", request)); rem_request(request); } @@ -884,8 +885,7 @@ /* * got a name and address response, client resolved */ - reply = make_dnsreply(request); - (*request->query.callback)(request->query.vptr, (reply) ? reply : 0); + (*request->callback)(request->callback_ctx, &request->addr, request->name); Debug((DEBUG_DNS, "Request %p got forward resolution", request)); rem_request(request); } @@ -903,23 +903,6 @@ } } -/** Build a DNSReply for a completed request. - * @param[in] request Completed DNS request. - * @return Newly allocated DNSReply containing host name and address. - */ -static struct DNSReply * -make_dnsreply(struct reslist *request) -{ - struct DNSReply *cp; - assert(request != 0); - - cp = (struct DNSReply *)MyMalloc(sizeof(struct DNSReply)); - - DupString(cp->h_name, request->name); - memcpy(&cp->addr, &request->addr, sizeof(cp->addr)); - return(cp); -} - /** Statistics callback to list DNS servers. * @param[in] source_p Client requesting statistics. * @param[in] sd Stats descriptor for request (ignored). Index: ircd-ircdev/ircd/list.c diff -u ircd-ircdev/ircd/list.c:1.8 ircd-ircdev/ircd/list.c:1.9 --- ircd-ircdev/ircd/list.c:1.8 Wed Jun 22 00:54:29 2005 +++ ircd-ircdev/ircd/list.c Sun Jul 3 13:21:42 2005 @@ -21,7 +21,7 @@ */ /** @file * @brief Singly and doubly linked list manipulation implementation. - * @version $Id: list.c,v 1.8 2005/06/22 07:54:29 zolty Exp $ + * @version $Id: list.c,v 1.9 2005/07/03 20:21:42 zolty Exp $ */ #include "config.h" @@ -168,10 +168,6 @@ Debug((DEBUG_LIST, "Deallocating connection %p", con)); - if (con_dns_reply(con)) { - MyFree(con_dns_reply(con)); - con_dns_reply(con) = 0; - } if (-1 < con_fd(con)) close(con_fd(con)); MsgQClear(&(con_sendQ(con))); Index: ircd-ircdev/ircd/m_invite.c diff -u ircd-ircdev/ircd/m_invite.c:1.12 ircd-ircdev/ircd/m_invite.c:1.13 --- ircd-ircdev/ircd/m_invite.c:1.12 Wed Jun 22 00:54:29 2005 +++ ircd-ircdev/ircd/m_invite.c Sun Jul 3 13:21:42 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.12 2005/06/22 07:54:29 zolty Exp $ + * $Id: m_invite.c,v 1.13 2005/07/03 20:21:42 zolty Exp $ * */ @@ -179,7 +179,7 @@ if (MyConnect(acptr)) { add_invite(acptr, chptr); sendcmdto_one(sptr, CMD_INVITE, acptr, "%s %H", cli_name(acptr), chptr); - } else { + } else if (!IsLocalChannel(chptr->chname)) { sendcmdto_one(sptr, CMD_INVITE, acptr, "%s %H %Tu", cli_name(acptr), chptr, chptr->creationtime); } Index: ircd-ircdev/ircd/s_auth.c diff -u ircd-ircdev/ircd/s_auth.c:1.11 ircd-ircdev/ircd/s_auth.c:1.12 --- ircd-ircdev/ircd/s_auth.c:1.11 Mon Mar 21 10:39:11 2005 +++ ircd-ircdev/ircd/s_auth.c Sun Jul 3 13:21:42 2005 @@ -22,7 +22,7 @@ */ /** @file * @brief Implementation of DNS and ident lookups. - * @version $Id: s_auth.c,v 1.11 2005/03/21 18:39:11 zolty Exp $ + * @version $Id: s_auth.c,v 1.12 2005/07/03 20:21:42 zolty Exp $ */ #include "config.h" @@ -106,7 +106,7 @@ * @return Non-zero if the hostname is valid. */ static int -auth_verify_hostname(char *host, int maxlen) +auth_verify_hostname(const char *host, int maxlen) { int i; @@ -299,7 +299,7 @@ * @param vptr The pending struct AuthRequest. * @param hp Pointer to the DNS reply (or NULL, if lookup failed). */ -static void auth_dns_callback(void* vptr, struct DNSReply* hp) +static void auth_dns_callback(void* vptr, const struct irc_in_addr *addr, const char *h_name) { struct AuthRequest* auth = (struct AuthRequest*) vptr; assert(auth); @@ -310,31 +310,30 @@ */ ClearDNSPending(auth); - if (hp) { + if (addr) { /* * Verify that the host to ip mapping is correct both ways and that * the ip#(s) for the socket is listed for the host. */ - if (irc_in_addr_cmp(&hp->addr, &cli_ip(auth->client))) { + if (irc_in_addr_cmp(addr, &cli_ip(auth->client))) { if (IsUserPort(auth->client)) sendheader(auth->client, REPORT_IP_MISMATCH); sendto_opmask_butone(0, SNO_IPMISMATCH, "IP# Mismatch: %s != %s[%s]", - cli_sock_ip(auth->client), hp->h_name, - ircd_ntoa(&hp->addr)); + cli_sock_ip(auth->client), h_name, + ircd_ntoa(addr)); if (feature_bool(FEAT_KILL_IPMISMATCH)) { auth_kill_client(auth); return; } } - else if (!auth_verify_hostname(hp->h_name, HOSTLEN)) + else if (!auth_verify_hostname(h_name, HOSTLEN)) { if (IsUserPort(auth->client)) sendheader(auth->client, REPORT_INVAL_DNS); } else { - cli_dns_reply(auth->client) = hp; - ircd_strncpy(cli_sockhost(auth->client), hp->h_name, HOSTLEN); + ircd_strncpy(cli_sockhost(auth->client), h_name, HOSTLEN); if (IsUserPort(auth->client)) sendheader(auth->client, REPORT_FIN_DNS); } @@ -549,15 +548,9 @@ if (irc_in_addr_is_loopback(&cli_ip(client))) strcpy(cli_sockhost(client), cli_name(&me)); else { - struct DNSQuery query; - - query.vptr = auth; - query.callback = auth_dns_callback; - if (IsUserPort(auth->client)) sendheader(client, REPORT_DO_DNS); - - gethost_byaddr(&cli_ip(client), &query); + gethost_byaddr(&cli_ip(client), auth_dns_callback, auth); SetDNSPending(auth); } } Index: ircd-ircdev/ircd/s_bsd.c diff -u ircd-ircdev/ircd/s_bsd.c:1.15 ircd-ircdev/ircd/s_bsd.c:1.16 --- ircd-ircdev/ircd/s_bsd.c:1.15 Wed Jun 22 00:54:30 2005 +++ ircd-ircdev/ircd/s_bsd.c Sun Jul 3 13:21:42 2005 @@ -21,7 +21,7 @@ */ /** @file * @brief Functions that now (or in the past) relied on BSD APIs. - * @version $Id: s_bsd.c,v 1.15 2005/06/22 07:54:30 zolty Exp $ + * @version $Id: s_bsd.c,v 1.16 2005/07/03 20:21:42 zolty Exp $ */ #include "config.h" @@ -175,14 +175,13 @@ * @param vptr The struct ConfItem representing the Connect block. * @param hp A pointer to the DNS lookup results (NULL on failure). */ -static void connect_dns_callback(void* vptr, struct DNSReply* hp) +static void connect_dns_callback(void* vptr, const struct irc_in_addr *addr, const char *h_name) { struct ConfItem* aconf = (struct ConfItem*) vptr; assert(aconf); aconf->dns_pending = 0; - if (hp) { - memcpy(&aconf->address, &hp->addr, sizeof(aconf->address)); - MyFree(hp); + if (addr) { + memcpy(&aconf->address, addr, sizeof(aconf->address)); connect_server(aconf, 0); } else @@ -326,21 +325,6 @@ return bytes_written; } -/** Free the client's DNS reply, if any. - * @param cptr Client to operate on. - */ -void release_dns_reply(struct Client* cptr) -{ - assert(0 != cptr); - assert(MyConnect(cptr)); - - if (cli_dns_reply(cptr)) { - MyFree(cli_dns_reply(cptr)->h_name); - MyFree(cli_dns_reply(cptr)); - cli_dns_reply(cptr) = 0; - } -} - /** Complete non-blocking connect()-sequence. Check access and * terminate connection, if trouble detected. * @param cptr Client to which we have connected, with all ConfItem structs attached. @@ -541,27 +525,32 @@ */ os_disable_options(fd); - /* - * Add this local client to the IPcheck registry. - * - * If they're throttled, murder them, but tell them why first. - */ - if (!IPcheck_local_connect(&addr.addr, &next_target) && !listener->server) + if (listener->server) { - ++ServerStats->is_ref; - write(fd, throttle_message, strlen(throttle_message)); - close(fd); - return; + new_client = make_client(0, STAT_UNKNOWN_SERVER); + } + else + { + /* + * Add this local client to the IPcheck registry. + * + * If they're throttled, murder them, but tell them why first. + */ + if (!IPcheck_local_connect(&addr.addr, &next_target)) + { + ++ServerStats->is_ref; + write(fd, throttle_message, strlen(throttle_message)); + close(fd); + return; + } + new_client = make_client(0, STAT_UNKNOWN_USER); + SetIPChecked(new_client); } - - new_client = make_client(0, ((listener->server) ? - STAT_UNKNOWN_SERVER : STAT_UNKNOWN_USER)); /* * Copy ascii address to 'sockhost' just in case. Then we have something * valid to put into error messages... */ - SetIPChecked(new_client); ircd_ntoa_r(cli_sock_ip(new_client), &addr.addr); strcpy(cli_sockhost(new_client), cli_sock_ip(new_client)); memcpy(&cli_ip(new_client), &addr.addr, sizeof(cli_ip(new_client))); @@ -766,14 +755,8 @@ if (!irc_in_addr_valid(&aconf->address.addr) && !ircd_aton(&aconf->address.addr, aconf->host)) { char buf[HOSTLEN + 1]; - struct DNSQuery query; - - query.vptr = aconf; - query.callback = connect_dns_callback; host_from_uh(buf, aconf->host, HOSTLEN); - buf[HOSTLEN] = '\0'; - - gethost_byname(buf, &query); + gethost_byname(buf, connect_dns_callback, aconf); aconf->dns_pending = 1; return 0; } Index: ircd-ircdev/ircd/s_conf.c diff -u ircd-ircdev/ircd/s_conf.c:1.19 ircd-ircdev/ircd/s_conf.c:1.20 --- ircd-ircdev/ircd/s_conf.c:1.19 Sun Jul 3 11:44:52 2005 +++ ircd-ircdev/ircd/s_conf.c Sun Jul 3 13:21:42 2005 @@ -21,7 +21,7 @@ */ /** @file * @brief ircd configuration file driver - * @version $Id: s_conf.c,v 1.19 2005/07/03 18:44:52 zolty Exp $ + * @version $Id: s_conf.c,v 1.20 2005/07/03 20:21:42 zolty Exp $ */ #include "config.h" @@ -232,16 +232,13 @@ * @param vptr Pointer to struct ConfItem for the block. * @param hp DNS reply, or NULL if the lookup failed. */ -static void conf_dns_callback(void* vptr, struct DNSReply* hp) +static void conf_dns_callback(void* vptr, const struct irc_in_addr *addr, const char *h_name) { struct ConfItem* aconf = (struct ConfItem*) vptr; assert(aconf); aconf->dns_pending = 0; - if (hp) - { - memcpy(&aconf->address.addr, &hp->addr, sizeof(aconf->address.addr)); - MyFree(hp); - } + if (addr) + memcpy(&aconf->address.addr, addr, sizeof(aconf->address.addr)); } /** Start a nameserver lookup of the conf host. If the conf entry is @@ -252,13 +249,8 @@ { if (!aconf->dns_pending) { char buf[HOSTLEN + 1]; - struct DNSQuery query; - query.vptr = aconf; - query.callback = conf_dns_callback; host_from_uh(buf, aconf->host, HOSTLEN); - buf[HOSTLEN] = '\0'; - - gethost_byname(buf, &query); + gethost_byname(buf, conf_dns_callback, aconf); aconf->dns_pending = 1; } } @@ -402,11 +394,9 @@ enum AuthorizationCheckResult attach_iline(struct Client* cptr) { struct ConfItem* aconf; - struct DNSReply* hp; assert(0 != cptr); - hp = cli_dns_reply(cptr); for (aconf = GlobalConfList; aconf; aconf = aconf->next) { if (aconf->status != CONF_CLIENT) continue; @@ -420,7 +410,7 @@ if (match(aconf->username, cli_username(cptr))) continue; } - if (aconf->host && (!hp || match(aconf->host, hp->h_name))) + if (aconf->host && match(aconf->host, cli_sockhost(cptr))) continue; if ((aconf->addrbits >= 0) && !ipmask_check(&cli_ip(cptr), &aconf->address.addr, aconf->addrbits)) @@ -1171,28 +1161,10 @@ } } - if (!c_conf) { - if (cli_dns_reply(cptr)) { - struct DNSReply* hp = cli_dns_reply(cptr); - const char* name = hp->h_name; - /* - * If we are missing a C or N line from above, search for - * it under all known hostnames we have for this ip#. - */ - if ((c_conf = find_conf_byhost(lp, hp->h_name, CONF_SERVER))) - ircd_strncpy(cli_sockhost(cptr), name, HOSTLEN); - else - c_conf = find_conf_byip(lp, &hp->addr, CONF_SERVER); - } - else { - /* - * Check for C lines with the hostname portion the ip number - * of the host the server runs on. This also checks the case where - * there is a server connecting from 'localhost'. - */ - c_conf = find_conf_byhost(lp, cli_sockhost(cptr), CONF_SERVER); - } - } + /* Try finding the Connect block by DNS name and IP next. */ + if (!c_conf && !(c_conf = find_conf_byhost(lp, cli_sockhost(cptr), CONF_SERVER))) + c_conf = find_conf_byip(lp, &cli_ip(cptr), CONF_SERVER); + /* * Attach by IP# only if all other checks have failed. * It is quite possible to get here with the strange things that can Index: ircd-ircdev/ircd/s_misc.c diff -u ircd-ircdev/ircd/s_misc.c:1.10 ircd-ircdev/ircd/s_misc.c:1.11 --- ircd-ircdev/ircd/s_misc.c:1.10 Sat May 7 15:23:40 2005 +++ ircd-ircdev/ircd/s_misc.c Sun Jul 3 13:21:42 2005 @@ -21,7 +21,7 @@ */ /** @file * @brief Miscellaneous support functions. - * @version $Id: s_misc.c,v 1.10 2005/05/07 22:23:40 zolty Exp $ + * @version $Id: s_misc.c,v 1.11 2005/07/03 20:21:42 zolty Exp $ */ #include "config.h" @@ -172,22 +172,6 @@ return nbuf; } -/** Set cli_sockhost(cptr) from \a host. - * If \a host contains an '@', copy starting after that byte. - * Otherwise copy all of \a host. - * @param cptr Client to operate on. - * @param host hostname or user\@hostname string. - */ -void get_sockhost(struct Client *cptr, char *host) -{ - char *s; - if ((s = strchr(host, '@'))) - s++; - else - s = host; - ircd_strncpy(cli_sockhost(cptr), s, HOSTLEN); -} - /** * Exit one client, local or remote. Assuming for local client that * all dependents already have been removed, and socket is closed. Index: ircd-ircdev/ircd/s_serv.c diff -u ircd-ircdev/ircd/s_serv.c:1.13 ircd-ircdev/ircd/s_serv.c:1.14 --- ircd-ircdev/ircd/s_serv.c:1.13 Wed Jun 22 00:54:30 2005 +++ ircd-ircdev/ircd/s_serv.c Sun Jul 3 13:21:42 2005 @@ -21,7 +21,7 @@ */ /** @file * @brief Miscellaneous server support functions. - * @version $Id: s_serv.c,v 1.13 2005/06/22 07:54:30 zolty Exp $ + * @version $Id: s_serv.c,v 1.14 2005/07/03 20:21:42 zolty Exp $ */ #include "config.h" @@ -139,13 +139,6 @@ cli_serv(cptr)->timestamp, MAJOR_PROTOCOL, NumServCap(&me), feature_bool(FEAT_HUB) ? "h" : "", *(cli_info(&me)) ? cli_info(&me) : "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); } det_confs_butmask(cptr, CONF_SERVER | CONF_UWORLD); @@ -155,9 +148,6 @@ SetServer(cptr); cli_handler(cptr) = SERVER_HANDLER; Count_unknownbecomesserver(UserStats); - - release_dns_reply(cptr); - SetBurst(cptr); /* nextping = CurrentTime; */ Index: ircd-ircdev/ircd/s_user.c diff -u ircd-ircdev/ircd/s_user.c:1.23 ircd-ircdev/ircd/s_user.c:1.24 --- ircd-ircdev/ircd/s_user.c:1.23 Sun Jul 3 11:44:52 2005 +++ ircd-ircdev/ircd/s_user.c Sun Jul 3 13:21:42 2005 @@ -21,7 +21,7 @@ */ /** @file * @brief Miscellaneous user-related helper functions. - * @version $Id: s_user.c,v 1.23 2005/07/03 18:44:52 zolty Exp $ + * @version $Id: s_user.c,v 1.24 2005/07/03 20:21:42 zolty Exp $ */ #include "config.h" @@ -565,7 +565,6 @@ SetUser(sptr); cli_handler(sptr) = CLIENT_HANDLER; - release_dns_reply(sptr); SetLocalNumNick(sptr); send_reply(sptr, RPL_WELCOME, ----------------------- End of diff ----------------------- |
From: Toni G. <zo...@us...> - 2005-07-03 18:45:09
|
CVSROOT : /cvsroot/irc-dev Module : ircd-ircdev Commit time: 2005-07-03 18:45:02 UTC Modified files: ChangeLog ChangeLog.es include/ddb.h include/s_user.h ircd/ddb.c ircd/ddb_events.c ircd/s_conf.c ircd/s_user.c Log message: Author: zoltan <zo...@ir...> Log message: 2005-07-03 Toni García <zo...@ir...> 1.0.alpha41 * IPs cifradas (sólo IPv4) ---------------------- diff included ---------------------- Index: ircd-ircdev/ChangeLog diff -u ircd-ircdev/ChangeLog:1.42 ircd-ircdev/ChangeLog:1.43 --- ircd-ircdev/ChangeLog:1.42 Wed Jun 22 02:58:52 2005 +++ ircd-ircdev/ChangeLog Sun Jul 3 11:44:51 2005 @@ -1,10 +1,13 @@ # # ChangeLog for ircd-ircdev # -# $Id: ChangeLog,v 1.42 2005/06/22 09:58:52 zolty Exp $ +# $Id: ChangeLog,v 1.43 2005/07/03 18:44:51 zolty Exp $ # # Insert new changes at beginning of the change list. # +2005-07-03 Toni García <zo...@ir...> 1.0.alpha41 + * Crypted ips (only IPv4) + 2005-06-22 Toni García <zo...@ir...> 1.0.alpha40 * Vhosts table v * /LIST with wildcards Index: ircd-ircdev/ChangeLog.es diff -u ircd-ircdev/ChangeLog.es:1.42 ircd-ircdev/ChangeLog.es:1.43 --- ircd-ircdev/ChangeLog.es:1.42 Wed Jun 22 02:58:52 2005 +++ ircd-ircdev/ChangeLog.es Sun Jul 3 11:44:51 2005 @@ -1,10 +1,13 @@ # # Log de Cambios para ircd-ircdev # -# $Id: ChangeLog.es,v 1.42 2005/06/22 09:58:52 zolty Exp $ +# $Id: ChangeLog.es,v 1.43 2005/07/03 18:44:51 zolty Exp $ # # Insertar los nuevos cambios al principio de esta lista de cambios. # +2005-07-03 Toni García <zo...@ir...> 1.0.alpha41 + * IPs cifradas (sólo IPv4) + 2005-06-22 Toni García <zo...@ir...> 1.0.alpha40 * Tabla v de Vhosts * /LIST con comodines Index: ircd-ircdev/include/ddb.h diff -u ircd-ircdev/include/ddb.h:1.11 ircd-ircdev/include/ddb.h:1.12 --- ircd-ircdev/include/ddb.h:1.11 Wed Jun 22 02:58:52 2005 +++ ircd-ircdev/include/ddb.h Sun Jul 3 11:44:51 2005 @@ -21,7 +21,7 @@ */ /** @file * @brief Distributed DataBases structures, macros and functions. - * @version $Id: ddb.h,v 1.11 2005/06/22 09:58:52 zolty Exp $ + * @version $Id: ddb.h,v 1.12 2005/07/03 18:44:51 zolty Exp $ */ #ifndef INCLUDED_ddb_h #define INCLUDED_ddb_h @@ -70,7 +70,8 @@ #define DDB_CONFIGDB_MAX_CLONES_PER_IP "maxclones" /** Message to clients with too many clones from your ip */ #define DDB_CONFIGDB_MSG_TOO_MANY_FROM_IP "msgmanyperip" - +/** Key to crypt ips */ +#define DDB_CONFIGDB_IP_CRYPT_KEY "ipcryptkey" /* * PseudoBots @@ -163,6 +164,12 @@ extern void ddb_db_hash_write(unsigned char table); extern void ddb_db_end(void); +/* PROVISIONAL */ +extern int max_clones; +extern char *msg_many_clones; +extern char *ip_crypt_key; +extern unsigned int binary_ip_crypt_key[2]; + #endif /* defined(DDB) */ #endif /* INCLUDED_ddb_h */ Index: ircd-ircdev/include/s_user.h diff -u ircd-ircdev/include/s_user.h:1.7 ircd-ircdev/include/s_user.h:1.8 --- ircd-ircdev/include/s_user.h:1.7 Thu Mar 31 04:58:03 2005 +++ ircd-ircdev/include/s_user.h Sun Jul 3 11:44:51 2005 @@ -21,7 +21,7 @@ */ /** @file s_user.h * @brief Miscellaneous user-related helper functions. - * @version $Id: s_user.h,v 1.7 2005/03/31 12:58:03 zolty Exp $ + * @version $Id: s_user.h,v 1.8 2005/07/03 18:44:51 zolty Exp $ */ #ifndef INCLUDED_s_user_h #define INCLUDED_s_user_h @@ -123,7 +123,7 @@ extern void send_user_info(struct Client* to, char* names, int rpl, InfoFormatter fmt); -extern int hide_hostmask(struct Client *cptr, unsigned int flags); +extern int hide_hostmask(struct Client *cptr, const char *vhost, unsigned int flags); extern int set_user_mode(struct Client *cptr, struct Client *sptr, int parc, char *parv[]); extern int is_silenced(struct Client *sptr, struct Client *acptr); Index: ircd-ircdev/ircd/ddb.c diff -u ircd-ircdev/ircd/ddb.c:1.12 ircd-ircdev/ircd/ddb.c:1.13 --- ircd-ircdev/ircd/ddb.c:1.12 Wed Jun 22 02:58:52 2005 +++ ircd-ircdev/ircd/ddb.c Sun Jul 3 11:44:52 2005 @@ -22,7 +22,7 @@ */ /** @file * @brief Implementation of Distributed DataBase. - * @version $Id: ddb.c,v 1.12 2005/06/22 09:58:52 zolty Exp $ + * @version $Id: ddb.c,v 1.13 2005/07/03 18:44:52 zolty Exp $ */ #include "config.h" @@ -344,9 +344,7 @@ else ddb_del_key(table, keytemp); - /* TODO */ - /* Ejecutamos los eventos */ - /* if (!cptr && ddb_events_table[table]) */ +/* if (cptr && ddb_events_table[table]) */ if (ddb_events_table[table]) ddb_events_table[table](key, content, update); } Index: ircd-ircdev/ircd/ddb_events.c diff -u ircd-ircdev/ircd/ddb_events.c:1.8 ircd-ircdev/ircd/ddb_events.c:1.9 --- ircd-ircdev/ircd/ddb_events.c:1.8 Wed Jun 22 02:58:52 2005 +++ ircd-ircdev/ircd/ddb_events.c Sun Jul 3 11:44:52 2005 @@ -21,7 +21,7 @@ */ /** @file * @brief Events of Distributed DataBases. - * @version $Id: ddb_events.c,v 1.8 2005/06/22 09:58:52 zolty Exp $ + * @version $Id: ddb_events.c,v 1.9 2005/07/03 18:44:52 zolty Exp $ */ #include "config.h" @@ -38,6 +38,7 @@ #include "send.h" #include <stdio.h> +#include <stdlib.h> #include <string.h> /** It indicates events is initialized */ @@ -51,6 +52,11 @@ static void ddb_events_table_v(char *key, char *content, int update); static void ddb_events_table_z(char *key, char *content, int update); +/* PROVISIONAL */ +int max_clones; +char *msg_many_clones; +char *ip_crypt_key; +unsigned int binary_ip_crypt_key[2]; /** Initialize events module of %DDB Distributed DataBases. */ @@ -359,24 +365,18 @@ /* Droping Key */ if (!content) { - /* if (IsHiddenHost(cptr)) { - ircd_snprintf(0, cli_user(cptr)->host, HOSTLEN, "SINIP"); - hide_hostmask(cptr, FLAG_HIDDENHOST); - + hide_hostmask(cptr, 0, FLAG_NICKREG); } - */ } - else if (content) + else if (content && update) { - if (IsHiddenHost(cptr)) - { - ircd_snprintf(0, cli_user(cptr)->host, HOSTLEN, content); - hide_hostmask(cptr, FLAG_NICKREG); - - } - } + if (strcmp(content, cli_user(cptr)->host)) + hide_hostmask(cptr, content, FLAG_NICKREG); + } + else + hide_hostmask(cptr, content, FLAG_NICKREG); } } @@ -388,4 +388,38 @@ static void ddb_events_table_z(char *key, char *content, int update) { + if (content) + { + if (!strcmp(key, DDB_CONFIGDB_MAX_CLONES_PER_IP)) + max_clones = atoi(content); + else if (!strcmp(key, DDB_CONFIGDB_MSG_TOO_MANY_FROM_IP)) + msg_many_clones = content; + else if (!strcmp(key, DDB_CONFIGDB_IP_CRYPT_KEY)) + { + char keytmp[12 + 1]; + char c; + + ip_crypt_key = content; + strncpy(keytmp, content, 12); + keytmp[12] = '\0'; + c = keytmp[6]; + keytmp[6] = '\0'; + binary_ip_crypt_key[0] = base64toint(keytmp); + keytmp[6] = c; + binary_ip_crypt_key[1] = base64toint(keytmp + 6); + } + } + else + { + if (!strcmp(key, DDB_CONFIGDB_MAX_CLONES_PER_IP)) + max_clones = 0; + else if (!strcmp(key, DDB_CONFIGDB_MSG_TOO_MANY_FROM_IP)) + msg_many_clones = NULL; + else if (!strcmp(key, DDB_CONFIGDB_IP_CRYPT_KEY)) + { + ip_crypt_key = NULL; + binary_ip_crypt_key[0] = 0; + binary_ip_crypt_key[1] = 0; + } + } } Index: ircd-ircdev/ircd/s_conf.c diff -u ircd-ircdev/ircd/s_conf.c:1.18 ircd-ircdev/ircd/s_conf.c:1.19 --- ircd-ircdev/ircd/s_conf.c:1.18 Wed Jun 22 00:54:30 2005 +++ ircd-ircdev/ircd/s_conf.c Sun Jul 3 11:44:52 2005 @@ -21,7 +21,7 @@ */ /** @file * @brief ircd configuration file driver - * @version $Id: s_conf.c,v 1.18 2005/06/22 07:54:30 zolty Exp $ + * @version $Id: s_conf.c,v 1.19 2005/07/03 18:44:52 zolty Exp $ */ #include "config.h" @@ -375,20 +375,17 @@ ddb = ddb_find_key(DDB_ILINEDB, (char *)ircd_ntoa(&cli_ip(cptr))); if (ddb && (clones = atoi(ddb_content(ddb)))) maxclones = clones; - else if ((ddb = ddb_find_key(DDB_CONFIGDB, DDB_CONFIGDB_MAX_CLONES_PER_IP)) - && (clones = atoi(ddb_content(ddb)))) - maxclones = clones; + else if (max_clones) /* DDB */ + maxclones = max_clones; else maxclones = aconf->maximum; if (IPcheck_nr(cptr) > maxclones) { - ddb = ddb_find_key(DDB_CONFIGDB, DDB_CONFIGDB_MSG_TOO_MANY_FROM_IP); - sendcmdto_one(&me, CMD_NOTICE, cptr, "%C :In the %s IRC Network only allows %d clones for your IP (%s)%s%s", cptr, feature_str(FEAT_NETWORK), maxclones, ircd_ntoa(&cli_ip(cptr)), - ddb ? ". " : "", ddb ? ddb_content(ddb) : ""); + msg_many_clones ? ". " : "", msg_many_clones ? msg_many_clones : ""); return ACR_TOO_MANY_FROM_IP; } #else Index: ircd-ircdev/ircd/s_user.c diff -u ircd-ircdev/ircd/s_user.c:1.22 ircd-ircdev/ircd/s_user.c:1.23 --- ircd-ircdev/ircd/s_user.c:1.22 Wed Jun 22 02:58:52 2005 +++ ircd-ircdev/ircd/s_user.c Sun Jul 3 11:44:52 2005 @@ -21,7 +21,7 @@ */ /** @file * @brief Miscellaneous user-related helper functions. - * @version $Id: s_user.c,v 1.22 2005/06/22 09:58:52 zolty Exp $ + * @version $Id: s_user.c,v 1.23 2005/07/03 18:44:52 zolty Exp $ */ #include "config.h" @@ -1165,10 +1165,8 @@ } } if (ddbv) - { - ircd_snprintf(0, cli_user(sptr)->host, HOSTLEN, ddb_content(ddbv)); - hide_hostmask(sptr, FLAG_HIDDENHOST); - } + hide_hostmask(sptr, ddb_content(ddbv), FLAG_HIDDENHOST); + #endif /* defined(DDB) */ /* Notify change nick local/remote user */ @@ -1406,11 +1404,12 @@ /** Set \a flag on \a cptr and possibly hide the client's hostmask. * @param[in,out] cptr User who is getting a new flag. + * @param[in] vhost Vhost of the user. * @param[in] flag Some flag that affects host-hiding (FLAG_HIDDENHOST, FLAG_ACCOUNT). * @return Zero. */ int -hide_hostmask(struct Client *cptr, unsigned int flag) +hide_hostmask(struct Client *cptr, const char *vhost, unsigned int flag) { struct Membership *chan; @@ -1443,7 +1442,8 @@ #if defined(UNDERNET) if (!HasFlag(cptr, FLAG_HIDDENHOST) || !HasFlag(cptr, FLAG_ACCOUNT)) #elsif defined(DDB) || defined(SERVICES) - if (!HasFlag(cptr, FLAG_HIDDENHOST) || !HasFlag(cptr, FLAG_NICKREG)) + /* if (!HasFlag(cptr, FLAG_HIDDENHOST) || !HasFlag(cptr, FLAG_NICKREG)) */ + if (1 == 0) #else if (!HasFlag(cptr, FLAG_HIDDENHOST)) #endif @@ -1459,6 +1459,53 @@ # endif #else sendcmdto_common_channels_butone(cptr, CMD_QUIT, cptr, ":Changing virtualhost"); + if (!vhost) + { + char ipcrypted[HOSTLEN + 1]; + + if (!ip_crypt_key) + { + strncpy(ipcrypted, "No.there.is.a.crypt.key", HOSTLEN); + } + /* IPv4 */ + else if (irc_in_addr_is_ipv4(&cli_ip(cptr))) + { + unsigned int v[2], x[2]; + unsigned int ts = 0; + + do { + x[0] = x[1] = 0; + v[0] = (binary_ip_crypt_key[0] & 0xffff0000) + ts; + v[1] = (ntohl(cli_ip(cptr).in6_16[6]) << 16) | ntohl(cli_ip(cptr).in6_16[7]); + + ircd_tea(v, binary_ip_crypt_key, x); + + /* Virtualhost format: qWeRty.AsDfGh.v4 */ + inttobase64(ipcrypted, x[0], 6); + ipcrypted[6] = '.'; + inttobase64(ipcrypted + 7, x[1], 6); + strncpy(ipcrypted + 13, ".v4", HOSTLEN); + log_write(LS_SYSTEM, L_CRIT, 0, "%u - %u", x[0], x[1]); + + /* No debería ocurrir nunca... */ + if (++ts == 65535) + { + strncpy(ipcrypted, cli_user(cptr)->realhost, HOSTLEN); + strncat(ipcrypted, ".v4", HOSTLEN); + break; + } + } while (strchr(ipcrypted, ']') || strchr(ipcrypted, '[')); + } + /* IPv6 */ + else + { + strncpy(ipcrypted, cli_user(cptr)->realhost, HOSTLEN); + strncat(ipcrypted, ".v6", HOSTLEN); + } + ircd_snprintf(0, cli_user(cptr)->host, HOSTLEN, ipcrypted); + } + else + ircd_snprintf(0, cli_user(cptr)->host, HOSTLEN, vhost); #endif /* ok, the client is now fully hidden, so let them know -- hikari */ @@ -1480,19 +1527,25 @@ #if defined(DDB) || defined(SERVICES) if (IsChanOwner(chan) || IsChanOp(chan) || HasVoice(chan)) + /* TODO-zoltan: Optimizar esto */ sendcmdto_channel_butserv_butone(&me, CMD_MODE, chan->channel, cptr, 0, - "%H +%s%s%s %C %C", chan->channel, cptr, + "%H +%s%s%s %s%s%s%s%s", chan->channel, IsChanOwner(chan) ? "q" : "", IsChanOp(chan) ? "o" : "", HasVoice(chan) ? "v" : "", - cptr); + IsChanOwner(chan) ? cli_name(cptr) : "", + IsChanOwner(chan) ? " " : "", + IsChanOp(chan) ? cli_name(cptr) : "", + IsChanOp(chan) ? " " : "", + HasVoice(chan) ? cli_name(cptr) : ""); #else - if (IsChanOp(chan) || HasVoice(chan)) + if (IsChanOp(chan) && HasVoice(chan)) sendcmdto_channel_butserv_butone(&me, CMD_MODE, chan->channel, cptr, 0, - "%H +%s%s %C %C", chan->channel, cptr, - IsChanOp(chan) ? "o" : "", - HasVoice(chan) ? "v" : "", + "%H +ov %C %C", chan->channel, cptr, cptr); + else if (IsChanOp(chan) || HasVoice(chan)) + sendcmdto_channel_butserv_butone(&me, CMD_MODE, chan->channel, cptr, 0, + "%H +%c %C", chan->channel, IsChanOp(chan) ? 'o' : 'v', cptr); #endif } return 0; @@ -1768,7 +1821,7 @@ if (!FlagHas(&setflags, FLAG_INVISIBLE) && IsInvisible(sptr)) ++UserStats.inv_clients; if (!FlagHas(&setflags, FLAG_HIDDENHOST) && do_host_hiding) - hide_hostmask(sptr, FLAG_HIDDENHOST); + hide_hostmask(sptr, 0, FLAG_HIDDENHOST); /* TODO-ZOLTAN */ send_umode_out(cptr, sptr, &setflags, prop); return 0; ----------------------- End of diff ----------------------- |
From: Toni G. <zo...@us...> - 2005-06-22 10:01:41
|
CVSROOT : /cvsroot/irc-dev Module : ircd-ircdev Commit time: 2005-06-22 10:01:35 UTC Modified files: TODO.es include/patchlevel.h Log message: actualizacion todo ---------------------- diff included ---------------------- Index: ircd-ircdev/TODO.es diff -u ircd-ircdev/TODO.es:1.27 ircd-ircdev/TODO.es:1.28 --- ircd-ircdev/TODO.es:1.27 Thu May 26 08:49:56 2005 +++ ircd-ircdev/TODO.es Wed Jun 22 03:01:25 2005 @@ -1,7 +1,7 @@ # # TODO para ircd-ircdev # -# $Id: TODO.es,v 1.27 2005/05/26 15:49:56 zolty Exp $ +# $Id: TODO.es,v 1.28 2005/06/22 10:01:25 zolty Exp $ # # Insertar las nuevas entradas al principio de la lista TODO. # @@ -20,7 +20,6 @@ - [G] ¿Modo +M de canales?. - [G] Poner uuna Feature para elegir entre salir o no el nombre del servidor en los notices de auth y dnslookup al conectar. - - [D] Virtualhost personalizado a traves de la DDB. - [D] U-lines a traves de la DDB. - [D] Mejorar la inicializacion de las DDB con los eventos. Index: ircd-ircdev/include/patchlevel.h diff -u ircd-ircdev/include/patchlevel.h:1.41 ircd-ircdev/include/patchlevel.h:1.42 --- ircd-ircdev/include/patchlevel.h:1.41 Wed Jun 22 02:58:52 2005 +++ ircd-ircdev/include/patchlevel.h Wed Jun 22 03:01:25 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.41 2005/06/22 09:58:52 zolty Exp $ + * $Id: patchlevel.h,v 1.42 2005/06/22 10:01:25 zolty Exp $ * */ -#define PATCHLEVEL ".alpha40" +#define PATCHLEVEL ".alpha41" #define RELEASE "1.0" ----------------------- End of diff ----------------------- |
From: Toni G. <zo...@us...> - 2005-06-22 09:59:10
|
CVSROOT : /cvsroot/irc-dev Module : ircd-ircdev Commit time: 2005-06-22 09:59:03 UTC Modified files: ChangeLog ChangeLog.es include/channel.h include/ddb.h include/patchlevel.h ircd/ddb.c ircd/ddb_events.c ircd/hash.c ircd/m_list.c ircd/s_user.c Log message: Author: zoltan <zo...@ir...> Log message: 2005-06-22 Toni García <zo...@ir...> 1.0.alpha40 * Tabla v de Vhosts * /LIST con comodines ---------------------- diff included ---------------------- Index: ircd-ircdev/ChangeLog diff -u ircd-ircdev/ChangeLog:1.41 ircd-ircdev/ChangeLog:1.42 --- ircd-ircdev/ChangeLog:1.41 Wed Jun 22 00:54:28 2005 +++ ircd-ircdev/ChangeLog Wed Jun 22 02:58:52 2005 @@ -1,10 +1,14 @@ # # ChangeLog for ircd-ircdev # -# $Id: ChangeLog,v 1.41 2005/06/22 07:54:28 zolty Exp $ +# $Id: ChangeLog,v 1.42 2005/06/22 09:58:52 zolty Exp $ # # Insert new changes at beginning of the change list. # +2005-06-22 Toni García <zo...@ir...> 1.0.alpha40 + * Vhosts table v + * /LIST with wildcards + 2005-06-22 Toni García <zo...@ir...> 1.0.alpha39 * Cleanups * Estetic bugfixes Index: ircd-ircdev/ChangeLog.es diff -u ircd-ircdev/ChangeLog.es:1.41 ircd-ircdev/ChangeLog.es:1.42 --- ircd-ircdev/ChangeLog.es:1.41 Wed Jun 22 00:54:29 2005 +++ ircd-ircdev/ChangeLog.es Wed Jun 22 02:58:52 2005 @@ -1,10 +1,14 @@ # # Log de Cambios para ircd-ircdev # -# $Id: ChangeLog.es,v 1.41 2005/06/22 07:54:29 zolty Exp $ +# $Id: ChangeLog.es,v 1.42 2005/06/22 09:58:52 zolty Exp $ # # Insertar los nuevos cambios al principio de esta lista de cambios. # +2005-06-22 Toni García <zo...@ir...> 1.0.alpha40 + * Tabla v de Vhosts + * /LIST con comodines + 2005-06-22 Toni García <zo...@ir...> 1.0.alpha39 * Limpieza * Fixs de bugs estéticos Index: ircd-ircdev/include/channel.h diff -u ircd-ircdev/include/channel.h:1.11 ircd-ircdev/include/channel.h:1.12 --- ircd-ircdev/include/channel.h:1.11 Wed Jun 22 00:54:29 2005 +++ ircd-ircdev/include/channel.h Wed Jun 22 02:58:52 2005 @@ -22,7 +22,7 @@ */ /** @file * @brief Channel management and maintenance. - * @version $Id: channel.h,v 1.11 2005/06/22 07:54:29 zolty Exp $ + * @version $Id: channel.h,v 1.12 2005/06/22 09:58:52 zolty Exp $ */ #ifndef INCLUDED_channel_h #define INCLUDED_channel_h @@ -192,6 +192,7 @@ #define LISTARG_TOPICLIMITS 0x0001 #define LISTARG_SHOWSECRET 0x0002 +#define LISTARG_NEGATEWILDCARD 0x0004 /** * Maximum acceptable lag time in seconds: A channel younger than @@ -361,6 +362,7 @@ time_t max_topic_time; time_t min_topic_time; unsigned int bucket; + char wildcard[CHANNELLEN]; }; struct ModeBuf { Index: ircd-ircdev/include/ddb.h diff -u ircd-ircdev/include/ddb.h:1.10 ircd-ircdev/include/ddb.h:1.11 --- ircd-ircdev/include/ddb.h:1.10 Wed Jun 22 00:54:29 2005 +++ ircd-ircdev/include/ddb.h Wed Jun 22 02:58:52 2005 @@ -21,7 +21,7 @@ */ /** @file * @brief Distributed DataBases structures, macros and functions. - * @version $Id: ddb.h,v 1.10 2005/06/22 07:54:29 zolty Exp $ + * @version $Id: ddb.h,v 1.11 2005/06/22 09:58:52 zolty Exp $ */ #ifndef INCLUDED_ddb_h #define INCLUDED_ddb_h @@ -55,6 +55,8 @@ #define DDB_ILINEDB 'i' /** Nicks table of %DDB Distributed Databases. */ #define DDB_NICKDB 'n' +/** Vhost table of %DDB Distributed Databases. */ +#define DDB_VHOSTDB 'v' /** Config table of %DDB Distributed Databases. */ #define DDB_CONFIGDB 'z' /** Last table of %DDB Distributed Databases. */ Index: ircd-ircdev/include/patchlevel.h diff -u ircd-ircdev/include/patchlevel.h:1.40 ircd-ircdev/include/patchlevel.h:1.41 --- ircd-ircdev/include/patchlevel.h:1.40 Wed Jun 22 00:54:29 2005 +++ ircd-ircdev/include/patchlevel.h Wed Jun 22 02:58:52 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.40 2005/06/22 07:54:29 zolty Exp $ + * $Id: patchlevel.h,v 1.41 2005/06/22 09:58:52 zolty Exp $ * */ -#define PATCHLEVEL ".alpha39" +#define PATCHLEVEL ".alpha40" #define RELEASE "1.0" Index: ircd-ircdev/ircd/ddb.c diff -u ircd-ircdev/ircd/ddb.c:1.11 ircd-ircdev/ircd/ddb.c:1.12 --- ircd-ircdev/ircd/ddb.c:1.11 Wed Jun 22 00:54:29 2005 +++ ircd-ircdev/ircd/ddb.c Wed Jun 22 02:58:52 2005 @@ -22,7 +22,7 @@ */ /** @file * @brief Implementation of Distributed DataBase. - * @version $Id: ddb.c,v 1.11 2005/06/22 07:54:29 zolty Exp $ + * @version $Id: ddb.c,v 1.12 2005/06/22 09:58:52 zolty Exp $ */ #include "config.h" @@ -151,7 +151,7 @@ unsigned int buffer[129 * sizeof(unsigned int)]; unsigned int *p = buffer; unsigned int x[2], v[2], k[2]; - char *p2; +/* char *p2; */ char buf[1024]; /* ID Mask Key Content */ @@ -208,6 +208,7 @@ ddb_resident_table[DDB_CHANDB2] = 32768; ddb_resident_table[DDB_ILINEDB] = 256; ddb_resident_table[DDB_NICKDB] = 32768; + ddb_resident_table[DDB_VHOSTDB] = 256; ddb_resident_table[DDB_CONFIGDB] = 256; for (table = DDB_INIT; table <= DDB_END; table++) Index: ircd-ircdev/ircd/ddb_events.c diff -u ircd-ircdev/ircd/ddb_events.c:1.7 ircd-ircdev/ircd/ddb_events.c:1.8 --- ircd-ircdev/ircd/ddb_events.c:1.7 Wed Jun 22 00:54:29 2005 +++ ircd-ircdev/ircd/ddb_events.c Wed Jun 22 02:58:52 2005 @@ -21,7 +21,7 @@ */ /** @file * @brief Events of Distributed DataBases. - * @version $Id: ddb_events.c,v 1.7 2005/06/22 07:54:29 zolty Exp $ + * @version $Id: ddb_events.c,v 1.8 2005/06/22 09:58:52 zolty Exp $ */ #include "config.h" @@ -48,6 +48,7 @@ static void ddb_events_table_c(char *key, char *content, int update); static void ddb_events_table_d(char *key, char *content, int update); static void ddb_events_table_n(char *key, char *content, int update); +static void ddb_events_table_v(char *key, char *content, int update); static void ddb_events_table_z(char *key, char *content, int update); @@ -63,6 +64,7 @@ ddb_events_table[DDB_CHANDB2] = ddb_events_table_d; ddb_events_table[DDB_ILINEDB] = 0; ddb_events_table[DDB_NICKDB] = ddb_events_table_n; + ddb_events_table[DDB_VHOSTDB] = ddb_events_table_v; ddb_events_table[DDB_CONFIGDB] = ddb_events_table_z; events_init = 1; @@ -342,6 +344,42 @@ } } +/** Handle events on Vhosts Table. + * @param[in] key Key of registry. + * @param[in] content Content of registry. + * @param[in] update Update of registry or no. + */ +static void +ddb_events_table_v(char *key, char *content, int update) +{ + struct Client *cptr; + + if (((cptr = FindUser(key))) && IsNickRegistered(cptr)) + { + /* Droping Key */ + if (!content) + { + /* + if (IsHiddenHost(cptr)) + { + ircd_snprintf(0, cli_user(cptr)->host, HOSTLEN, "SINIP"); + hide_hostmask(cptr, FLAG_HIDDENHOST); + + } + */ + } + else if (content) + { + if (IsHiddenHost(cptr)) + { + ircd_snprintf(0, cli_user(cptr)->host, HOSTLEN, content); + hide_hostmask(cptr, FLAG_NICKREG); + + } + } + } + +} /** Handle events on Config Table. * @param[in] key Key of registry. * @param[in] content Content of registry. Index: ircd-ircdev/ircd/hash.c diff -u ircd-ircdev/ircd/hash.c:1.10 ircd-ircdev/ircd/hash.c:1.11 --- ircd-ircdev/ircd/hash.c:1.10 Wed May 25 09:56:24 2005 +++ ircd-ircdev/ircd/hash.c Wed Jun 22 02:58:52 2005 @@ -22,7 +22,7 @@ */ /** @file * @brief Hash table management. - * @version $Id: hash.c,v 1.10 2005/05/25 16:56:24 zolty Exp $ + * @version $Id: hash.c,v 1.11 2005/06/22 09:58:52 zolty Exp $ * * This file used to use some very complicated hash function. Now it * uses CRC-32, but effectively remaps each input byte according to a @@ -512,6 +512,10 @@ && chptr->users < args->max_users && chptr->creationtime > args->min_time && chptr->creationtime < args->max_time + && (!args->wildcard[0] || (args->flags & LISTARG_NEGATEWILDCARD) || + (!match(args->wildcard, chptr->chname))) + && (!(args->flags & LISTARG_NEGATEWILDCARD) || + match(args->wildcard, chptr->chname)) && (!(args->flags & LISTARG_TOPICLIMITS) || (chptr->topic[0] && chptr->topic_time > args->min_topic_time Index: ircd-ircdev/ircd/m_list.c diff -u ircd-ircdev/ircd/m_list.c:1.7 ircd-ircdev/ircd/m_list.c:1.8 --- ircd-ircdev/ircd/m_list.c:1.7 Mon Mar 21 10:39:08 2005 +++ ircd-ircdev/ircd/m_list.c Wed Jun 22 02:58:52 2005 @@ -17,7 +17,7 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * - * $Id: m_list.c,v 1.7 2005/03/21 18:39:08 zolty Exp $ + * $Id: m_list.c,v 1.8 2005/06/22 09:58:52 zolty Exp $ * */ @@ -108,10 +108,11 @@ 0, /* min_time */ 4294967295U, /* max_users */ 0, /* min_users */ - 0, /* topic_limits */ + 0, /* flags */ 2147483647, /* max_topic_time */ 0, /* min_topic_time */ - 0 /* chptr */ + 0, /* bucket */ + {0} /* wildcard */ }; static struct ListingArgs la_default = { @@ -119,10 +120,11 @@ 0, /* min_time */ 4294967295U, /* max_users */ 0, /* min_users */ - 0, /* topic_limits */ + 0, /* flags */ 2147483647, /* max_topic_time */ 0, /* min_topic_time */ - 0 /* chptr */ + 0, /* bucket */ + {0} /* wildcard */ }; static int @@ -151,17 +153,25 @@ " \002C>\002\037min_minutes\037 ; Channels that exist more " "than \037min_minutes\037."); send_reply(sptr, RPL_LISTUSAGE, - " \002T<\002\037max_minutes\037 ; Channels with a topic last " - "set less than \037max_minutes\037 ago."); + " \002T<\002\037max_minutes\037 ; Channels with a topic last " + "set less than \037max_minutes\037 ago."); send_reply(sptr, RPL_LISTUSAGE, - " \002T>\002\037min_minutes\037 ; Channels with a topic last " - "set more than \037min_minutes\037 ago."); + " \002T>\002\037min_minutes\037 ; Channels with a topic last " + "set more than \037min_minutes\037 ago."); + send_reply(sptr, RPL_LISTUSAGE, + " \037pattern\037 ; Channels with names matching " + "\037pattern\037. "); + send_reply(sptr, RPL_LISTUSAGE, + " !\037pattern\037 ; Channels with names not " + "matching \037pattern\037. "); + send_reply(sptr, RPL_LISTUSAGE, "Note: Patterns may contain * and ?. " + "You may only give one pattern match constraint."); if (IsAnOper(sptr)) send_reply(sptr, RPL_LISTUSAGE, " \002S\002 ; Show secret channels."); send_reply(sptr, RPL_LISTUSAGE, - "Example: LIST <3,>1,C<10,T>0 ; 2 users, younger than 10 " - "min., topic set."); + "Example: LIST <3,>1,C<10,T>0,#a* ; 2 users, younger than 10 " + "min., topic set., starts with #a"); return LPARAM_ERROR; /* return error condition */ } @@ -173,6 +183,7 @@ int is_time = 0; char dir; unsigned int val; + char *tmp1, *tmp2; assert(0 != args); @@ -246,7 +257,47 @@ return show_usage(sptr); break; - default: /* channel name? */ + default: + /* It might be a wildcard... */ + if (strchr(param, '*') || + strchr(param, '?')) + { + if (param[0] == '!') + { + param++; + args->flags |= LISTARG_NEGATEWILDCARD; + } + + /* Only one wildcard allowed... */ + if (args->wildcard[0] != 0) + return show_usage(sptr); + + /* If its not going to match anything, don't bother. */ + if (param[0] != '*' && + param[0] != '?' && + param[0] != '#' && + param[0] != '&') + return show_usage(sptr); + + tmp1 = strchr(param, ','); + tmp2 = strchr(param, ' '); + if (tmp2 && (!tmp1 || (tmp2 < tmp1))) + tmp1 = tmp2; + + if (tmp1) + *tmp1++ = 0; + + ircd_strncpy(args->wildcard, param, CHANNELLEN-1); + args->wildcard[CHANNELLEN-1] = 0; + + if (tmp1 == NULL) + return LPARAM_SUCCESS; + + param = tmp1; + continue; + } + + /* channel name? */ if (!permit_chan || !IsChannelName(param)) return show_usage(sptr); Index: ircd-ircdev/ircd/s_user.c diff -u ircd-ircdev/ircd/s_user.c:1.21 ircd-ircdev/ircd/s_user.c:1.22 --- ircd-ircdev/ircd/s_user.c:1.21 Wed Jun 22 00:54:30 2005 +++ ircd-ircdev/ircd/s_user.c Wed Jun 22 02:58:52 2005 @@ -21,7 +21,7 @@ */ /** @file * @brief Miscellaneous user-related helper functions. - * @version $Id: s_user.c,v 1.21 2005/06/22 07:54:30 zolty Exp $ + * @version $Id: s_user.c,v 1.22 2005/06/22 09:58:52 zolty Exp $ */ #include "config.h" @@ -1141,6 +1141,10 @@ if (!IsNickEquivalent(flags)) { #if defined(DDB) + struct Ddb *ddbv; + + ddbv = ddb_find_key(DDB_VHOSTDB, cli_name(sptr)); + if (MyConnect(sptr)) { struct Flags oldflags; @@ -1154,9 +1158,17 @@ else SetNickRegistered(sptr); + if (ddbv && !IsHiddenHost(sptr)) + SetHiddenHost(sptr); + send_umode_out(cptr, sptr, &oldflags, IsRegistered(sptr)); } } + if (ddbv) + { + ircd_snprintf(0, cli_user(sptr)->host, HOSTLEN, ddb_content(ddbv)); + hide_hostmask(sptr, FLAG_HIDDENHOST); + } #endif /* defined(DDB) */ /* Notify change nick local/remote user */ @@ -1415,6 +1427,13 @@ chan = chan->next_channel) ClearBanValid(chan); break; +#elsif defined(DDB) || defined(SERVICES) + case FLAG_NICKREG: + /* Invalidate all bans against the user so we check them again */ + for (chan = (cli_user(cptr))->channel; chan; + chan = chan->next_channel) + ClearBanValid(chan); + break; #endif default: return 0; @@ -1423,17 +1442,23 @@ SetFlag(cptr, flag); #if defined(UNDERNET) if (!HasFlag(cptr, FLAG_HIDDENHOST) || !HasFlag(cptr, FLAG_ACCOUNT)) +#elsif defined(DDB) || defined(SERVICES) + if (!HasFlag(cptr, FLAG_HIDDENHOST) || !HasFlag(cptr, FLAG_NICKREG)) #else if (!HasFlag(cptr, FLAG_HIDDENHOST)) #endif return 0; +#if defined(UNDERNET) || defined(SERVICES) sendcmdto_common_channels_butone(cptr, CMD_QUIT, cptr, ":Registered"); ircd_snprintf(0, cli_user(cptr)->host, HOSTLEN, "%s.%s", -#if defined(UNDERNET) +# if defined(UNDERNET) cli_user(cptr)->account, feature_str(FEAT_HIDDEN_HOST)); -#else +# else cli_yxx(cptr), feature_str(FEAT_HIDDEN_HOST)); +# endif +#else + sendcmdto_common_channels_butone(cptr, CMD_QUIT, cptr, ":Changing virtualhost"); #endif /* ok, the client is now fully hidden, so let them know -- hikari */ @@ -1452,13 +1477,23 @@ if (!IsDelayedJoin(chan)) sendcmdto_channel_butserv_butone(cptr, CMD_JOIN, chan->channel, cptr, 0, "%H", chan->channel); - if (IsChanOp(chan) && HasVoice(chan)) + +#if defined(DDB) || defined(SERVICES) + if (IsChanOwner(chan) || IsChanOp(chan) || HasVoice(chan)) sendcmdto_channel_butserv_butone(&me, CMD_MODE, chan->channel, cptr, 0, - "%H +ov %C %C", chan->channel, cptr, + "%H +%s%s%s %C %C", chan->channel, cptr, + IsChanOwner(chan) ? "q" : "", + IsChanOp(chan) ? "o" : "", + HasVoice(chan) ? "v" : "", cptr); - else if (IsChanOp(chan) || HasVoice(chan)) +#else + if (IsChanOp(chan) || HasVoice(chan)) sendcmdto_channel_butserv_butone(&me, CMD_MODE, chan->channel, cptr, 0, - "%H +%c %C", chan->channel, IsChanOp(chan) ? 'o' : 'v', cptr); + "%H +%s%s %C %C", chan->channel, cptr, + IsChanOp(chan) ? "o" : "", + HasVoice(chan) ? "v" : "", + cptr); +#endif } return 0; } ----------------------- End of diff ----------------------- |
From: Toni G. <zo...@us...> - 2005-06-22 07:54:50
|
CVSROOT : /cvsroot/irc-dev Module : ircd-ircdev Commit time: 2005-06-22 07:54:40 UTC Modified files: ChangeLog ChangeLog.es include/channel.h include/class.h include/ddb.h include/ircd_string.h include/list.h include/numeric.h include/patchlevel.h include/watch.h ircd/IPcheck.c ircd/channel.c ircd/class.c ircd/client.c ircd/ddb.c ircd/ddb_events.c ircd/ircd.c ircd/ircd_res.c ircd/ircd_string.c ircd/list.c ircd/m_burst.c ircd/m_clearmode.c ircd/m_dbq.c ircd/m_endburst.c ircd/m_invite.c ircd/m_server.c ircd/m_topic.c ircd/match.c ircd/s_bsd.c ircd/s_conf.c ircd/s_debug.c ircd/s_err.c ircd/s_serv.c ircd/s_stats.c ircd/s_user.c ircd/send.c ircd/watch.c ircd/test/.cvsignore ircd/test/Makefile.in ircd/test/kill-block-1.cmd ircd/test/run-tests.sh Log message: Author: zoltan <zo...@ir...> Log message: 2005-06-22 Toni García <zo...@ir...> 1.0.alpha39 * Limpieza * Fixs de bugs estéticos ---------------------- diff included ---------------------- Index: ircd-ircdev/ChangeLog diff -u ircd-ircdev/ChangeLog:1.40 ircd-ircdev/ChangeLog:1.41 --- ircd-ircdev/ChangeLog:1.40 Thu May 26 03:34:12 2005 +++ ircd-ircdev/ChangeLog Wed Jun 22 00:54:28 2005 @@ -1,10 +1,14 @@ # # ChangeLog for ircd-ircdev # -# $Id: ChangeLog,v 1.40 2005/05/26 10:34:12 zolty Exp $ +# $Id: ChangeLog,v 1.41 2005/06/22 07:54:28 zolty Exp $ # # Insert new changes at beginning of the change list. # +2005-06-22 Toni García <zo...@ir...> 1.0.alpha39 + * Cleanups + * Estetic bugfixes + 2005-05-26 Toni García <zo...@ir...> 1.0.alpha38 * Fix bugs last release. Index: ircd-ircdev/ChangeLog.es diff -u ircd-ircdev/ChangeLog.es:1.40 ircd-ircdev/ChangeLog.es:1.41 --- ircd-ircdev/ChangeLog.es:1.40 Thu May 26 03:34:13 2005 +++ ircd-ircdev/ChangeLog.es Wed Jun 22 00:54:29 2005 @@ -1,10 +1,14 @@ # # Log de Cambios para ircd-ircdev # -# $Id: ChangeLog.es,v 1.40 2005/05/26 10:34:13 zolty Exp $ +# $Id: ChangeLog.es,v 1.41 2005/06/22 07:54:29 zolty Exp $ # # Insertar los nuevos cambios al principio de esta lista de cambios. # +2005-06-22 Toni García <zo...@ir...> 1.0.alpha39 + * Limpieza + * Fixs de bugs estéticos + 2005-05-26 Toni García <zo...@ir...> 1.0.alpha38 * Fix de bugs de la release anterior Index: ircd-ircdev/include/channel.h diff -u ircd-ircdev/include/channel.h:1.10 ircd-ircdev/include/channel.h:1.11 --- ircd-ircdev/include/channel.h:1.10 Wed May 25 09:56:23 2005 +++ ircd-ircdev/include/channel.h Wed Jun 22 00:54:29 2005 @@ -22,7 +22,7 @@ */ /** @file * @brief Channel management and maintenance. - * @version $Id: channel.h,v 1.10 2005/05/25 16:56:23 zolty Exp $ + * @version $Id: channel.h,v 1.11 2005/06/22 07:54:29 zolty Exp $ */ #ifndef INCLUDED_channel_h #define INCLUDED_channel_h @@ -319,14 +319,14 @@ /** A single ban for a channel. */ struct Ban { - struct Ban* next; /**< next ban in the channel */ + struct Ban* next; /**< next ban in the channel */ struct irc_in_addr address; /**< addres for BAN_IPMASK bans */ - time_t when; /**< timestamp when ban was added */ - unsigned short flags; /**< modifier flags for the ban */ - unsigned char nu_len; /**< length of nick!user part of banstr */ - unsigned char addrbits; /**< netmask length for BAN_IPMASK bans */ - char *who; /**< name of client that set the ban */ - char *banstr; /**< hostmask that the ban matches */ + time_t when; /**< timestamp when ban was added */ + unsigned short flags; /**< modifier flags for the ban */ + unsigned char nu_len; /**< length of nick!user part of banstr */ + unsigned char addrbits; /**< netmask length for BAN_IPMASK bans */ + char who[NICKLEN+1]; /**< name of client that set the ban */ + char banstr[NICKLEN+USERLEN+HOSTLEN+3]; /**< hostmask that the ban matches */ }; /** Information about a channel */ Index: ircd-ircdev/include/class.h diff -u ircd-ircdev/include/class.h:1.6 ircd-ircdev/include/class.h:1.7 --- ircd-ircdev/include/class.h:1.6 Mon Jan 10 04:21:59 2005 +++ ircd-ircdev/include/class.h Wed Jun 22 00:54:29 2005 @@ -22,7 +22,7 @@ */ /** @file * @brief Declarations and interfaces for handling connection classes. - * @version $Id: class.h,v 1.6 2005/01/10 12:21:59 zolty Exp $ + * @version $Id: class.h,v 1.7 2005/06/22 07:54:29 zolty Exp $ */ #ifndef INCLUDED_class_h #define INCLUDED_class_h @@ -103,7 +103,6 @@ extern struct ConnectionClass *find_class(const char *name); extern struct ConnectionClass *make_class(void); extern void free_class(struct ConnectionClass * tmp); -extern unsigned int get_con_freq(struct ConnectionClass * clptr); extern char *get_conf_class(const struct ConfItem *aconf); extern int get_conf_ping(const struct ConfItem *aconf); extern char *get_client_class(struct Client *acptr); Index: ircd-ircdev/include/ddb.h diff -u ircd-ircdev/include/ddb.h:1.9 ircd-ircdev/include/ddb.h:1.10 --- ircd-ircdev/include/ddb.h:1.9 Wed May 25 09:56:23 2005 +++ ircd-ircdev/include/ddb.h Wed Jun 22 00:54:29 2005 @@ -21,7 +21,7 @@ */ /** @file * @brief Distributed DataBases structures, macros and functions. - * @version $Id: ddb.h,v 1.9 2005/05/25 16:56:23 zolty Exp $ + * @version $Id: ddb.h,v 1.10 2005/06/22 07:54:29 zolty Exp $ */ #ifndef INCLUDED_ddb_h #define INCLUDED_ddb_h @@ -149,6 +149,7 @@ extern void ddb_reload(void); extern void ddb_die(const char *pattern, ...); extern void ddb_report_stats(struct Client* to, const struct StatDesc* sd, char* param); +extern void ddb_count_memory(size_t* count_out, size_t* bytes_out); /* ddb_db_*.c externs */ extern void ddb_db_init(void); Index: ircd-ircdev/include/ircd_string.h diff -u ircd-ircdev/include/ircd_string.h:1.5 ircd-ircdev/include/ircd_string.h:1.6 --- ircd-ircdev/include/ircd_string.h:1.5 Mon Jan 10 04:22:00 2005 +++ ircd-ircdev/include/ircd_string.h Wed Jun 22 00:54:29 2005 @@ -21,7 +21,7 @@ */ /** @file ircd_string.h * @brief Public declarations and APIs for string operations. - * @version $Id: ircd_string.h,v 1.5 2005/01/10 12:22:00 zolty Exp $ + * @version $Id: ircd_string.h,v 1.6 2005/06/22 07:54:29 zolty Exp $ */ #ifndef INCLUDED_ircd_string_h #define INCLUDED_ircd_string_h @@ -30,6 +30,8 @@ #include "ircd_chattr.h" #endif +#include <string.h> /* for DupString()'s strcpy, strlen */ + struct irc_in_addr; /* @@ -38,13 +40,6 @@ /** Check whether \a x is a NULL or empty string. */ #define EmptyString(x) (!(x) || !(*x)) -/* - * initialize recognizers - */ -extern int init_string(void); - -extern int string_is_hostname(const char* str); -extern int string_is_address(const char* str); extern int string_has_wildcards(const char* str); extern char* ircd_strncpy(char* dest, const char* src, size_t len); @@ -139,9 +134,4 @@ #endif #endif /* FORCEINLINE */ -/* - * Proto types of other externally visible functions - */ -extern int strnChattr(const char *s, const size_t n); - #endif /* INCLUDED_ircd_string_h */ Index: ircd-ircdev/include/list.h diff -u ircd-ircdev/include/list.h:1.5 ircd-ircdev/include/list.h:1.6 --- ircd-ircdev/include/list.h:1.5 Mon Jan 10 04:22:00 2005 +++ ircd-ircdev/include/list.h Wed Jun 22 00:54:29 2005 @@ -21,7 +21,7 @@ */ /** @file list.h * @brief Singly and doubly linked list manipulation interface. - * @version $Id: list.h,v 1.5 2005/01/10 12:22:00 zolty Exp $ + * @version $Id: list.h,v 1.6 2005/06/22 07:54:29 zolty Exp $ */ #ifndef INCLUDED_list_h #define INCLUDED_list_h @@ -71,7 +71,6 @@ extern void free_link(struct SLink *lp); extern struct SLink *make_link(void); -extern struct SLink *find_user_link(struct SLink *lp, struct Client *ptr); extern void init_list(void); extern struct Client *make_client(struct Client *from, int status); extern void free_connection(struct Connection *con); Index: ircd-ircdev/include/numeric.h diff -u ircd-ircdev/include/numeric.h:1.13 ircd-ircdev/include/numeric.h:1.14 --- ircd-ircdev/include/numeric.h:1.13 Sat May 7 15:23:39 2005 +++ ircd-ircdev/include/numeric.h Wed Jun 22 00:54:29 2005 @@ -21,7 +21,7 @@ */ /** @file * @brief Declarations of numeric replies and supporting functions. - * @version $Id: numeric.h,v 1.13 2005/05/07 22:23:39 zolty Exp $ + * @version $Id: numeric.h,v 1.14 2005/06/22 07:54:29 zolty Exp $ */ #ifndef INCLUDED_numeric_h #define INCLUDED_numeric_h @@ -121,12 +121,12 @@ #define RPL_STATSALINE 226 /* Hybrid, Undernet */ #define RPL_STATSQLINE 228 /* Undernet extension */ -#define RPL_SERVICEINFO 231 /* unused */ -#define RPL_ENDOFSERVICES 232 /* unused */ +/* RPL_SERVICEINFO 231 unused */ +/* RPL_ENDOFSERVICES 232 unused */ /* RPL_RULES 232 unreal */ -#define RPL_SERVICE 233 /* unused */ -#define RPL_SERVLIST 234 /* unused */ -#define RPL_SERVLISTEND 235 /* unused */ +/* RPL_SERVICE 233 unused */ +/* RPL_SERVLIST 234 unused */ +/* RPL_SERVLISTEND 235 unused */ #define RPL_STATSVERBOSE 236 /* Undernet verbose server list */ #define RPL_STATSENGINE 237 /* Undernet engine name */ @@ -161,7 +161,7 @@ #define RPL_ADMINLOC2 258 #define RPL_ADMINEMAIL 259 -#define RPL_TRACELOG 261 /* unused */ +/* RPL_TRACELOG 261 unused */ #define RPL_TRACEEND 262 /* efnet/IRCnet */ /* RPL_LOAD_THROTTLED 263 efnet/hybrid */ /* RPL_TRYAGAIN 263 Numerics List: IRCnet */ @@ -206,11 +206,11 @@ /* RPL_END_CHANINFO 299 aircd */ -#define RPL_NONE 300 /* unused */ +/* RPL_NONE 300 unused */ #define RPL_AWAY 301 #define RPL_USERHOST 302 #define RPL_ISON 303 -#define RPL_TEXT 304 /* unused */ +/* RPL_TEXT 304 unused */ #define RPL_UNAWAY 305 #define RPL_NOWAWAY 306 /* NotAway, aircd */ @@ -276,7 +276,7 @@ See also RPL_ENDOFWHO */ #define RPL_DELNAMREPLY 355 /* QuakeNet extension */ -#define RPL_KILLDONE 361 /* not used */ +/* RPL_KILLDONE 361 not used */ #define RPL_CLOSING 362 #define RPL_CLOSEEND 363 #define RPL_LINKS 364 @@ -303,12 +303,12 @@ #define RPL_YOUREOPER 381 #define RPL_REHASHING 382 /* RPL_YOURSERVICE 383 Numeric List: various */ -#define RPL_MYPORTIS 384 /* not used */ -#define RPL_NOTOPERANYMORE 385 /* Extension to RFC1459, not used */ +/* RPL_MYPORTIS 384 not used */ +/* RPL_NOTOPERANYMORE 385 Extension to RFC1459, not used */ /* RPL_QLIST 386 unreal */ /* RPL_ENDOFQLIST 387 unreal */ /* RPL_ALIST 388 unreal */ -/* RPL_ENDOFALIST 389 unreal */ +/* RPL_ENDOFALIST 389 unreal */ #define RPL_WHOISSUSPEND 390 /* IRC-Dev extension */ #define RPL_TIME 391 @@ -322,7 +322,7 @@ * Errors are in the range from 400-599 currently and are grouped by what * commands they come from. */ -#define ERR_FIRSTERROR 400 /* unused */ +/* ERR_FIRSTERROR 400 unused */ #define ERR_NOSUCHNICK 401 #define ERR_NOSUCHSERVER 402 #define ERR_NOSUCHCHANNEL 403 Index: ircd-ircdev/include/patchlevel.h diff -u ircd-ircdev/include/patchlevel.h:1.39 ircd-ircdev/include/patchlevel.h:1.40 --- ircd-ircdev/include/patchlevel.h:1.39 Thu May 26 03:34:13 2005 +++ ircd-ircdev/include/patchlevel.h Wed Jun 22 00:54:29 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.39 2005/05/26 10:34:13 zolty Exp $ + * $Id: patchlevel.h,v 1.40 2005/06/22 07:54:29 zolty Exp $ * */ -#define PATCHLEVEL ".alpha38" +#define PATCHLEVEL ".alpha39" #define RELEASE "1.0" Index: ircd-ircdev/include/watch.h diff -u ircd-ircdev/include/watch.h:1.3 ircd-ircdev/include/watch.h:1.4 --- ircd-ircdev/include/watch.h:1.3 Mon Jan 10 04:22:00 2005 +++ ircd-ircdev/include/watch.h Wed Jun 22 00:54:29 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: watch.h,v 1.3 2005/01/10 12:22:00 zolty Exp $ + * $Id: watch.h,v 1.4 2005/06/22 07:54:29 zolty Exp $ * */ #ifndef INCLUDED_watch_h @@ -65,6 +65,6 @@ extern int add_nick_watch(struct Client *sptr, char *nick); extern int del_nick_watch(struct Client *sptr, char *nick); extern int del_list_watch(struct Client *sptr); -extern int watch_memory_count(size_t *wt_size); +extern void watch_count_memory(size_t* count_out, size_t* bytes_out); #endif /* INCLUDED_watch_h */ Index: ircd-ircdev/ircd/IPcheck.c diff -u ircd-ircdev/ircd/IPcheck.c:1.10 ircd-ircdev/ircd/IPcheck.c:1.11 --- ircd-ircdev/ircd/IPcheck.c:1.10 Mon Mar 21 10:39:05 2005 +++ ircd-ircdev/ircd/IPcheck.c Wed Jun 22 00:54:29 2005 @@ -21,7 +21,7 @@ */ /** @file * @brief Code to count users connected from particular IP addresses. - * @version $Id: IPcheck.c,v 1.10 2005/03/21 18:39:05 zolty Exp $ + * @version $Id: IPcheck.c,v 1.11 2005/06/22 07:54:29 zolty Exp $ */ #include "config.h" @@ -30,11 +30,11 @@ #include "ircd.h" #include "match.h" #include "msg.h" -#include "numnicks.h" /* NumNick, NumServ (GODMODE) */ #include "ircd_alloc.h" #include "ircd_events.h" #include "ircd_features.h" #include "ircd_log.h" +#include "ircd_string.h" /* ircd_ntoa */ #include "s_debug.h" /* Debug */ #include "s_user.h" /* TARGET_DELAY */ #include "send.h" @@ -222,6 +222,7 @@ /* * expired */ + Debug((DEBUG_DNS, "IPcheck expiring registry for %s (no clients connected).", ircd_ntoa(&entry->addr))); ip_registry_remove(entry); ip_registry_delete_entry(entry); } @@ -278,16 +279,18 @@ entry = ip_registry_new_entry(); ip_registry_canonicalize(&entry->addr, addr); ip_registry_add(entry); + Debug((DEBUG_DNS, "IPcheck added new registry for local connection from %s.", ircd_ntoa(&entry->addr))); return 1; } - /* Note that this also connects server connects. + /* Note that this also counts server connects. * It is hard and not interesting, to change that. * - * Don't allow more then 255 connects from one IP number, ever + * Refuse connection if it would overflow the counter. */ if (0 == ++entry->connected) { entry->connected--; + Debug((DEBUG_DNS, "IPcheck refusing local connection from %s: counter overflow.", ircd_ntoa(&entry->addr))); return 0; } @@ -305,17 +308,17 @@ *next_target_out = CurrentTime - (TARGET_DELAY * free_targets - 1); } else if ((CurrentTime - cli_since(&me)) > IPCHECK_CLONE_DELAY) { - /* + /* * Don't refuse connection when we just rebooted the server */ -#ifdef NOTHROTTLE - return 1; -#else +#ifndef NOTHROTTLE assert(entry->connected > 0); --entry->connected; + Debug((DEBUG_DNS, "IPcheck refusing local connection from %s: too fast.", ircd_ntoa(&entry->addr))); return 0; -#endif +#endif } + Debug((DEBUG_DNS, "IPcheck accepting local connection from %s.", ircd_ntoa(&entry->addr))); return 1; } @@ -335,8 +338,10 @@ * Mark that we did add/update an IPregistry entry */ SetIPChecked(cptr); - if (!irc_in_addr_valid(&cli_ip(cptr))) + if (!irc_in_addr_valid(&cli_ip(cptr))) { + Debug((DEBUG_DNS, "IPcheck accepting remote connection from invalid %s.", ircd_ntoa(&cli_ip(cptr)))); return 1; + } entry = ip_registry_find(&cli_ip(cptr)); if (0 == entry) { entry = ip_registry_new_entry(); @@ -344,27 +349,27 @@ if (is_burst) entry->attempts = 0; ip_registry_add(entry); + Debug((DEBUG_DNS, "IPcheck added new registry for remote connection from %s.", ircd_ntoa(&entry->addr))); + return 1; } - else { - if (0 == ++entry->connected) { - /* - * Don't allow more then 255 connects from one IP number, ever + /* Avoid overflowing the connection counter. */ + if (0 == ++entry->connected) { + Debug((DEBUG_DNS, "IPcheck refusing remote connection from %s: counter overflow.", ircd_ntoa(&entry->addr))); + return 0; + } + if (CONNECTED_SINCE(entry->last_connect) > IPCHECK_CLONE_PERIOD) + entry->attempts = 0; + if (!is_burst) { + if (0 == ++entry->attempts) { + /* + * Check for overflow */ - 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; + --entry->attempts; } + ip_registry_update_free_targets(entry); + entry->last_connect = NOW; } + Debug((DEBUG_DNS, "IPcheck counting remote connection from %s.", ircd_ntoa(&entry->addr))); return 1; } @@ -376,10 +381,9 @@ void ip_registry_connect_fail(const struct irc_in_addr *addr) { struct IPRegistryEntry* entry = ip_registry_find(addr); - if (entry) - { - if (0 == --entry->attempts) - ++entry->attempts; + if (entry && 0 == --entry->attempts) { + Debug((DEBUG_DNS, "IPcheck noting local connection failure for %s.", ircd_ntoa(&entry->addr))); + ++entry->attempts; } } @@ -395,15 +399,13 @@ unsigned int free_targets = STARTTARGETS; struct IPRegistryEntry* entry = ip_registry_find(&cli_ip(cptr)); - if (!entry) { - Debug((DEBUG_ERROR, "Missing registry entry for: %s", cli_sock_ip(cptr))); - return; - } + assert(entry); if (entry->target) { memcpy(cli_targets(cptr), entry->target->targets, MAXTARGETS); free_targets = entry->target->count; tr = " tr"; } + Debug((DEBUG_DNS, "IPcheck noting local connection success for %s.", ircd_ntoa(&entry->addr))); sendcmdto_one(&me, CMD_NOTICE, cptr, "%C :on %u ca %u(%u) ft %u(%u)%s", cptr, entry->connected, entry->attempts, IPCHECK_CLONE_LIMIT, free_targets, STARTTARGETS, tr); @@ -417,17 +419,16 @@ void ip_registry_disconnect(struct Client *cptr) { struct IPRegistryEntry* entry = ip_registry_find(&cli_ip(cptr)); - if (0 == entry) { - /* - * trying to find an entry for a server causes this to happen, - * servers should never have FLAG_IPCHECK set - */ + if (!irc_in_addr_valid(&cli_ip(cptr))) { + Debug((DEBUG_DNS, "IPcheck noting dicconnect from invalid %s.", ircd_ntoa(&cli_ip(cptr)))); return; } + assert(entry); + assert(entry->connected > 0); + Debug((DEBUG_DNS, "IPcheck noting disconnect from %s.", ircd_ntoa(&entry->addr))); /* * If this was the last one, set `last_connect' to disconnect time (used for expiration) */ - /* assert(entry->connected > 0); */ if (0 == --entry->connected) { if (CONNECTED_SINCE(entry->last_connect) > IPCHECK_CLONE_LIMIT * IPCHECK_CLONE_PERIOD) { /* Index: ircd-ircdev/ircd/channel.c diff -u ircd-ircdev/ircd/channel.c:1.23 ircd-ircdev/ircd/channel.c:1.24 --- ircd-ircdev/ircd/channel.c:1.23 Thu May 26 03:34:13 2005 +++ ircd-ircdev/ircd/channel.c Wed Jun 22 00:54:29 2005 @@ -21,7 +21,7 @@ */ /** @file * @brief Channel management and maintanance - * @version $Id: channel.c,v 1.23 2005/05/26 10:34:13 zolty Exp $ + * @version $Id: channel.c,v 1.24 2005/06/22 07:54:29 zolty Exp $ */ #include "config.h" @@ -70,6 +70,10 @@ static struct Membership* membershipFreeList; /** Freelist for struct Ban*'s */ static struct Ban* free_bans; +/** Number of ban structures allocated. */ +static size_t bans_alloc; +/** Number of ban structures in use. */ +static size_t bans_inuse; #if !defined(NDEBUG) /** return the length (>=0) of a chain of links. @@ -94,10 +98,9 @@ set_ban_mask(struct Ban *ban, const char *banstr) { char *sep; - MyFree(ban->banstr); - if (!banstr) - return; - DupString(ban->banstr, banstr); + + assert(banstr != NULL); + ircd_strncpy(ban->banstr, banstr, sizeof(ban->banstr) - 1); sep = strrchr(banstr, '@'); if (sep) { ban->nu_len = sep - banstr; @@ -120,6 +123,9 @@ } else if (!(ban = MyMalloc(sizeof(*ban)))) return NULL; + else + bans_alloc++; + bans_inuse++; memset(ban, 0, sizeof(*ban)); set_ban_mask(ban, banstr); return ban; @@ -131,12 +137,24 @@ void free_ban(struct Ban *ban) { - MyFree(ban->who); - MyFree(ban->banstr); ban->next = free_bans; free_bans = ban; + bans_inuse--; } +/** Report ban usage to \a cptr. + * @param[in] cptr Client requesting information. + */ +void bans_send_meminfo(struct Client *cptr) +{ + struct Ban *ban; + size_t num_free; + for (num_free = 0, ban = free_bans; ban; ban = ban->next) + num_free++; + send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, ":Bans: inuse %zu(%zu) free %zu alloc %zu", + bans_inuse, bans_inuse * sizeof(*ban), num_free, bans_alloc); + } + /** return the struct Membership* that represents a client on a channel * This function finds a struct Membership* which holds the state about * a client on a specific channel. The code is smart enough to iterate @@ -741,9 +759,9 @@ struct Membership *member; assert(0 != cptr); /* - * Servers can always speak on channels. + * Servers and channel services can always speak on channels. */ - if (IsServer(cptr)) + if (IsServer(cptr) || IsChannelService(cptr)) return 1; member = find_channel_member(cptr, chptr); @@ -847,7 +865,11 @@ *mbuf++ = 'k'; if (previous_parameter) strcat(pbuf, " "); +#if defined(DDB) || defined(SERVICES) + if (is_chan_owner(cptr, chptr) || is_chan_op(cptr, chptr) || IsServer(cptr)) { +#else if (is_chan_op(cptr, chptr) || IsServer(cptr)) { +#endif strcat(pbuf, chptr->mode.key); } else strcat(pbuf, "*"); @@ -2951,8 +2973,6 @@ if (!bmatch(ban, newban)) { if (do_free) free_ban(newban); - else - MyFree(newban); return 1; } if (!(ban->flags & (BAN_OVERLAPPED|BAN_DEL))) { @@ -2983,14 +3003,10 @@ /* If no matches were found, fail. */ if (do_free) free_ban(newban); - else - MyFree(newban->banstr); return 3; } if (do_free) free_ban(newban); - else - MyFree(newban->banstr); return 4; } @@ -3047,9 +3063,8 @@ newban->next = 0; newban->flags = ((state->dir == MODE_ADD) ? BAN_ADD : BAN_DEL) | (*flag_p == MODE_BAN ? 0 : BAN_EXCEPTION); - newban->banstr = NULL; set_ban_mask(newban, collapse(pretty_mask(t_str))); - newban->who = cli_name(state->sptr); + ircd_strncpy(newban->who, cli_name(state->sptr), HOSTLEN); newban->when = TStime(); apply_ban(&state->chptr->banlist, newban, 0); } @@ -3081,12 +3096,13 @@ count--; len -= banlen; - MyFree(ban->banstr); - continue; } else if (ban->flags & BAN_DEL) { /* Deleted a ban? */ + char *bandup; + + DupString(bandup, ban->banstr); modebuf_mode_string(state->mbuf, MODE_DEL | MODE_BAN, - ban->banstr, 1); + bandup, 1); if (state->flags & MODE_PARSE_SET) { /* Ok, make it take effect */ if (prevban) /* clip it out of the list... */ @@ -3096,9 +3112,6 @@ count--; len -= banlen; - - ban->banstr = NULL; /* modebuf_mode_string() gave ownership of - * the ban string to state->mbuf */ free_ban(ban); changed++; @@ -3116,7 +3129,6 @@ !(state->flags & MODE_PARSE_BOUNCE)) { count--; len -= banlen; - MyFree(ban->banstr); } else { if (state->flags & MODE_PARSE_SET && MyUser(state->sptr) && (len > (feature_int(FEAT_AVBANLEN) * feature_int(FEAT_MAXBANS)) || @@ -3125,15 +3137,17 @@ ban->banstr); count--; len -= banlen; - MyFree(ban->banstr); } else { + char *bandup; + /* add the ban to the buffer */ + DupString(bandup, ban->banstr); modebuf_mode_string(state->mbuf, MODE_ADD | MODE_BAN, - ban->banstr, 1); + bandup, 1); if (state->flags & MODE_PARSE_SET) { /* create a new ban */ newban = make_ban(ban->banstr); - DupString(newban->who, ban->who); + strcpy(newban->who, ban->who); newban->when = ban->when; newban->flags = ban->flags & BAN_IPMASK; @@ -3149,13 +3163,6 @@ prevban = ban; } /* for (prevban = 0, ban = state->chptr->banlist; ban; ban = nextban) { */ - /* Release all masks of removed bans */ - for (count = 0; count < state->numbans; ++count) { - ban = state->banlist + count; - if (ban->flags & BAN_DEL) - MyFree(ban->banstr); - } - if (changed) /* if we changed the ban list, we must invalidate the bans */ mode_ban_invalidate(state->chptr); } @@ -3436,7 +3443,7 @@ for (i = 0; i < MAXPARA; i++) { /* initialize ops/voices arrays */ state.banlist[i].next = 0; - state.banlist[i].who = 0; + state.banlist[i].who[0] = '\0'; state.banlist[i].when = 0; state.banlist[i].flags = 0; state.cli_change[i].flag = 0; @@ -3819,7 +3826,8 @@ /* RevealDelayedJoin: sends a join for a hidden user */ -void RevealDelayedJoin(struct Membership *member) { +void RevealDelayedJoin(struct Membership *member) +{ ClearDelayedJoin(member); sendcmdto_channel_butserv_butone(member->user, CMD_JOIN, member->channel, member->user, 0, ":%H", member->channel); @@ -3828,14 +3836,15 @@ /* CheckDelayedJoins: checks and clear +d if necessary */ -void CheckDelayedJoins(struct Channel *chan) { +void CheckDelayedJoins(struct Channel *chan) +{ struct Membership *memb2; - + if (chan->mode.mode & MODE_WASDELJOINS) { for (memb2=chan->members;memb2;memb2=memb2->next_member) if (IsDelayedJoin(memb2)) break; - + if (!memb2) { /* clear +d */ chan->mode.mode &= ~MODE_WASDELJOINS; Index: ircd-ircdev/ircd/class.c diff -u ircd-ircdev/ircd/class.c:1.7 ircd-ircdev/ircd/class.c:1.8 --- ircd-ircdev/ircd/class.c:1.7 Fri Apr 22 09:22:13 2005 +++ ircd-ircdev/ircd/class.c Wed Jun 22 00:54:29 2005 @@ -21,7 +21,7 @@ */ /** @file * @brief Implementation of connection class handling functions. - * @version $Id: class.c,v 1.7 2005/04/22 16:22:13 zolty Exp $ + * @version $Id: class.c,v 1.8 2005/06/22 07:54:29 zolty Exp $ */ #include "config.h" @@ -199,19 +199,6 @@ return "(null-class)"; } -/** Get connection interval for a connection class. - * @param[in] clptr Connection class to check (or NULL). - * @return If \a clptr != NULL, its connection frequency; else default - * connection frequency. - */ -unsigned int get_con_freq(struct ConnectionClass * clptr) -{ - if (clptr) - return (ConFreq(clptr)); - else - return feature_int(FEAT_CONNECTFREQUENCY); -} - /** Make sure we have a connection class named \a name. * If one does not exist, create it. Then set its ping frequency, * connection frequency, maximum link count, and max SendQ according Index: ircd-ircdev/ircd/client.c diff -u ircd-ircdev/ircd/client.c:1.8 ircd-ircdev/ircd/client.c:1.9 --- ircd-ircdev/ircd/client.c:1.8 Wed Mar 9 10:12:34 2005 +++ ircd-ircdev/ircd/client.c Wed Jun 22 00:54:29 2005 @@ -21,7 +21,7 @@ */ /** @file * @brief Implementation of functions for handling local clients. - * @version $Id: client.c,v 1.8 2005/03/09 18:12:34 zolty Exp $ + * @version $Id: client.c,v 1.9 2005/06/22 07:54:29 zolty Exp $ */ #include "config.h" @@ -232,8 +232,8 @@ P(GLINE), P(LOCAL_GLINE), P(JUPE), P(LOCAL_JUPE), P(OPMODE), P(LOCAL_OPMODE), P(SET), P(WHOX), P(BADCHAN), P(LOCAL_BADCHAN), P(SEE_CHAN), P(PROPAGATE), - P(DISPLAY), P(SEE_OPERS), P(FORCE_OPMODE), P(FORCE_LOCAL_OPMODE), - P(WIDE_GLINE), + P(DISPLAY), P(SEE_OPERS), P(WIDE_GLINE), P(LIST_CHAN), + P(FORCE_OPMODE), P(FORCE_LOCAL_OPMODE), P(APASS_OPMODE), #undef P { 0, 0 } }; Index: ircd-ircdev/ircd/ddb.c diff -u ircd-ircdev/ircd/ddb.c:1.10 ircd-ircdev/ircd/ddb.c:1.11 --- ircd-ircdev/ircd/ddb.c:1.10 Wed May 25 09:56:24 2005 +++ ircd-ircdev/ircd/ddb.c Wed Jun 22 00:54:29 2005 @@ -22,7 +22,7 @@ */ /** @file * @brief Implementation of Distributed DataBase. - * @version $Id: ddb.c,v 1.10 2005/05/25 16:56:24 zolty Exp $ + * @version $Id: ddb.c,v 1.11 2005/06/22 07:54:29 zolty Exp $ */ #include "config.h" @@ -56,6 +56,8 @@ * TODO, explicacion del sistema */ +/** Count of allocated Ddb structures. */ +static int ddbCount = 0; /** DDB registers cache. */ static struct Ddb ddb_buf_cache[DDB_BUF_CACHE]; /** Buffer cache. */ @@ -396,6 +398,7 @@ ddb_next(ddb) = ddb_data_table[table][hashi]; ddb_data_table[table][hashi] = ddb; ddb_count_table[table]++; + ddbCount++; return delete; } @@ -426,6 +429,7 @@ delete = 1; DdbFree(ddb); ddb_count_table[table]--; + ddbCount--; break; } ddb3 = &(ddb_next(ddb)); @@ -791,3 +795,15 @@ } } } + +/** Find number of DDB structs allocated and memory used by them. + * @param[out] count_out Receives number of DDB structs allocated. + * @param[out] bytes_out Receives number of bytes used by DDB structs. + */ +void ddb_count_memory(size_t* count_out, size_t* bytes_out) +{ + assert(0 != count_out); + assert(0 != bytes_out); + *count_out = ddbCount; + *bytes_out = ddbCount * sizeof(struct Ddb); +} Index: ircd-ircdev/ircd/ddb_events.c diff -u ircd-ircdev/ircd/ddb_events.c:1.6 ircd-ircdev/ircd/ddb_events.c:1.7 --- ircd-ircdev/ircd/ddb_events.c:1.6 Thu May 26 03:34:13 2005 +++ ircd-ircdev/ircd/ddb_events.c Wed Jun 22 00:54:29 2005 @@ -21,7 +21,7 @@ */ /** @file * @brief Events of Distributed DataBases. - * @version $Id: ddb_events.c,v 1.6 2005/05/26 10:34:13 zolty Exp $ + * @version $Id: ddb_events.c,v 1.7 2005/06/22 07:54:29 zolty Exp $ */ #include "config.h" @@ -173,18 +173,15 @@ /* Quitar -q */ for (member = chptr->members; member; member = member->next_member) { - if (IsChanOwner(member)) + if (IsChanOwner(member) && MyUser(member->user)) { ClearChanOwner(member); - if (MyUser(member->user)) - { - sendcmdbotto_channel_butserv_butone(botname, CMD_MODE, - member->channel, NULL, 0, "%H -q %C", - member->channel, member->user); - sendcmdto_serv_butone(&me, CMD_BMODE, NULL, "%s %H -q %C", - DDB_CHANSERV, member->channel, member->user); - } - break; + sendcmdbotto_channel_butserv_butone(botname, CMD_MODE, + member->channel, NULL, 0, "%H -q %C", + member->channel, member->user); + sendcmdto_serv_butone(&me, CMD_BMODE, NULL, "%s %H -q %C", + DDB_CHANSERV, member->channel, member->user); + break; } } Index: ircd-ircdev/ircd/ircd.c diff -u ircd-ircdev/ircd/ircd.c:1.19 ircd-ircdev/ircd/ircd.c:1.20 --- ircd-ircdev/ircd/ircd.c:1.19 Mon May 16 04:22:50 2005 +++ ircd-ircdev/ircd/ircd.c Wed Jun 22 00:54:29 2005 @@ -21,7 +21,7 @@ */ /** @file * @brief Entry point and other initialization functions for the daemon. - * @version $Id: ircd.c,v 1.19 2005/05/16 11:22:50 zolty Exp $ + * @version $Id: ircd.c,v 1.20 2005/06/22 07:54:29 zolty Exp $ */ #include "config.h" @@ -691,11 +691,6 @@ log_init(*argv); set_nomem_handler(outofmemory); - if (!init_string()) { - log_write(LS_SYSTEM, L_CRIT, 0, "Failed to initialize string module"); - return 6; - } - initload(); init_list(); init_hash(); Index: ircd-ircdev/ircd/ircd_res.c diff -u ircd-ircdev/ircd/ircd_res.c:1.8 ircd-ircdev/ircd/ircd_res.c:1.9 --- ircd-ircdev/ircd/ircd_res.c:1.8 Sat Apr 2 11:47:35 2005 +++ ircd-ircdev/ircd/ircd_res.c Wed Jun 22 00:54:29 2005 @@ -22,8 +22,8 @@ * */ /* - * A rewrite of Darren Reeds original res.c As there is nothing - * left of Darrens original code, this is now licensed by the hybrid group. + * A rewrite of Darren Reed's original res.c As there is nothing + * left of Darren's original code, this is now licensed by the hybrid group. * (Well, some of the function names are the same, and bits of the structs..) * You can use it where it is useful, free even. Buy us a beer and stuff. * @@ -41,7 +41,7 @@ */ /** @file * @brief IRC resolver functions. - * @version $Id: ircd_res.c,v 1.8 2005/04/02 19:47:35 zolty Exp $ + * @version $Id: ircd_res.c,v 1.9 2005/06/22 07:54:29 zolty Exp $ */ #include "client.h" #include "ircd_alloc.h" @@ -749,7 +749,13 @@ * but its possible its just a broken nameserver with still * valid answers. But lets do some rudimentary logging for now... */ - log_write(LS_RESOLVER, L_ERROR, 0, "irc_res.c bogus type %d", type); + log_write(LS_RESOLVER, L_ERROR, 0, "irc_res.c bogus type %d", type); + + if ((char*)current + rd_length >= (char*)current) + current += rd_length; + else + return(0); + break; } } @@ -780,6 +786,12 @@ return; /* + * check against possibly fake replies + */ + if (!res_ourserver(&lsin)) + return; + + /* * convert DNS reply reader from Network byte order to CPU byte order. */ header = (HEADER *)buf; @@ -795,12 +807,6 @@ if (0 == (request = find_id(header->id))) return; - /* - * check against possibly fake replies - */ - if (!res_ourserver(&lsin)) - return; - if ((header->rcode != NO_ERRORS) || (header->ancount == 0)) { if (SERVFAIL == header->rcode) Index: ircd-ircdev/ircd/ircd_string.c diff -u ircd-ircdev/ircd/ircd_string.c:1.10 ircd-ircdev/ircd/ircd_string.c:1.11 --- ircd-ircdev/ircd/ircd_string.c:1.10 Mon Apr 11 01:45:00 2005 +++ ircd-ircdev/ircd/ircd_string.c Wed Jun 22 00:54:29 2005 @@ -21,7 +21,7 @@ */ /** @file * @brief Implementation of string operations. - * @version $Id: ircd_string.c,v 1.10 2005/04/11 08:45:00 zolty Exp $ + * @version $Id: ircd_string.c,v 1.11 2005/06/22 07:54:29 zolty Exp $ */ #include "config.h" @@ -32,7 +32,6 @@ #include "res.h" /* #include <assert.h> -- Now using assert in ircd_log.h */ -#include <string.h> #include <regex.h> #include <sys/types.h> #include <netinet/in.h> @@ -42,68 +41,6 @@ */ #include "chattr.tab.c" - -/* - * Disallow a hostname label to contain anything but a [-a-zA-Z0-9]. - * It may not start or end on a '.'. - * A label may not end on a '-', the maximum length of a label is - * 63 characters. - * On top of that (which seems to be the RFC) we demand that the - * top domain does not contain any digits. - */ -/** Regular expression to match a hostname. - * Matches zero or more alphanumeric labels followed by '.' and a - * final label that may only contain alphabetic characters. - */ -static const char* hostExpr = "^([-0-9A-Za-z]*[0-9A-Za-z]\\.)+[A-Za-z]+$"; -/** Compiled regex to match a hostname. Built from #hostExpr. */ -static regex_t hostRegex; - -/** Regular expression to match an IP address. */ -static const char* addrExpr = - "^((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\\.){1,3}" - "(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])$"; -/** Compiled regex to match an IP address. Built from #addrExpr. */ -static regex_t addrRegex; - -/** Initialize the string matching code. */ -int init_string(void) -{ - /* - * initialize matching expressions - * XXX - expressions MUST be correct, don't change expressions - * without testing them. Might be a good idea to exit if these fail, - * important code depends on them. - * TODO: use regerror for an error message - */ - if (regcomp(&hostRegex, hostExpr, REG_EXTENDED | REG_NOSUB)) - return 0; - - if (regcomp(&addrRegex, addrExpr, REG_EXTENDED | REG_NOSUB)) - return 0; - return 1; -} - -/** Check whether \a str looks like a hostname. - * @param[in] str String that might be a hostname. - * @return Non-zero if it conforms to the rules, zero if not. - */ -int string_is_hostname(const char* str) -{ - assert(0 != str); - return (strlen(str) <= HOSTLEN && 0 == regexec(&hostRegex, str, 0, 0, 0)); -} - -/** Check whether \a str looks like an IP address. - * @param[in] str String that might be an address. - * @return Non-zero if it conforms to the rules, zero if not. - */ -int string_is_address(const char* str) -{ - assert(0 != str); - return (0 == regexec(&addrRegex, str, 0, 0, 0)); -} - /** Check whether \a str contains wildcard characters. * @param[in] str String that might contain wildcards. * @return Non-zero if \a str contains naked (non-escaped) wildcards, @@ -235,21 +172,6 @@ * Other functions visible externally */ -/** Find common character attributes for the start of a string. - * @param[in] s Input string to scan. - * @param[in] n Maximum number of bytes to check. - * @return Bitmask of all character attributes shared by the start of \a s. - */ -int strnChattr(const char *s, const size_t n) -{ - const char *rs = s; - unsigned int x = ~0; - int r = n; - while (*rs && r--) - x &= IRCD_CharAttrTab[*rs++ - CHAR_MIN]; - return x; -} - /** Case insensitive string comparison. * @param[in] a First string to compare. * @param[in] b Second string to compare. Index: ircd-ircdev/ircd/list.c diff -u ircd-ircdev/ircd/list.c:1.7 ircd-ircdev/ircd/list.c:1.8 --- ircd-ircdev/ircd/list.c:1.7 Mon Mar 21 10:39:08 2005 +++ ircd-ircdev/ircd/list.c Wed Jun 22 00:54:29 2005 @@ -21,7 +21,7 @@ */ /** @file * @brief Singly and doubly linked list manipulation implementation. - * @version $Id: list.c,v 1.7 2005/03/21 18:39:08 zolty Exp $ + * @version $Id: list.c,v 1.8 2005/06/22 07:54:29 zolty Exp $ */ #include "config.h" @@ -52,25 +52,19 @@ #include <unistd.h> /* close */ #include <string.h> -#ifdef DEBUGMODE /** Stores linked list statistics for various types of lists. */ static struct liststats { - int inuse; -} clients, connections, users, servs, links; -#endif + size_t alloc; /**< Number of structures ever allocated. */ + size_t inuse; /**< Number of structures currently in use. */ + size_t mem; /**< Memory used by in-use structures. */ +} clients, connections, servs, links; -/** Count of allocated Client structures. */ -static unsigned int clientAllocCount; /** Linked list of currently unused Client structures. */ static struct Client* clientFreeList; -/** Count of allocated Connection structures. */ -static unsigned int connectionAllocCount; /** Linked list of currently unused Connection structures. */ static struct Connection* connectionFreeList; -/** Count of allocated SLink structures. */ -static unsigned int slinkAllocCount; /** Linked list of currently unused SLink structures. */ static struct SLink* slinkFreeList; @@ -89,21 +83,14 @@ cptr = (struct Client*) MyMalloc(sizeof(struct Client)); cli_next(cptr) = clientFreeList; clientFreeList = cptr; - ++clientAllocCount; + clients.alloc++; con = (struct Connection*) MyMalloc(sizeof(struct Connection)); con_next(con) = connectionFreeList; connectionFreeList = con; - ++connectionAllocCount; + connections.alloc++; } -#ifdef DEBUGMODE - memset(&clients, 0, sizeof(clients)); - memset(&connections, 0, sizeof(connections)); - memset(&users, 0, sizeof(users)); - memset(&servs, 0, sizeof(servs)); - memset(&links, 0, sizeof(links)); -#endif } /** Allocate a new Client structure. @@ -117,13 +104,11 @@ if (!cptr) { cptr = (struct Client*) MyMalloc(sizeof(struct Client)); - ++clientAllocCount; + clients.alloc++; } else clientFreeList = cli_next(cptr); -#ifdef DEBUGMODE clients.inuse++; -#endif memset(cptr, 0, sizeof(struct Client)); @@ -138,9 +123,7 @@ assert(cli_verify(cptr)); assert(0 == cli_connect(cptr)); -#ifdef DEBUGMODE --clients.inuse; -#endif cli_next(cptr) = clientFreeList; clientFreeList = cptr; @@ -159,13 +142,11 @@ if (!con) { con = (struct Connection*) MyMalloc(sizeof(struct Connection)); - ++connectionAllocCount; + connections.alloc++; } else connectionFreeList = con_next(con); -#ifdef DEBUGMODE connections.inuse++; -#endif memset(con, 0, sizeof(struct Connection)); timer_init(&(con_proc(con))); @@ -199,9 +180,7 @@ if (con_listener(con)) release_listener(con_listener(con)); -#ifdef DEBUGMODE --connections.inuse; -#endif con_next(con) = connectionFreeList; connectionFreeList = con; @@ -339,9 +318,8 @@ serv = (struct Server*) MyMalloc(sizeof(struct Server)); assert(0 != serv); memset(serv, 0, sizeof(struct Server)); /* All variables are 0 by default */ -#ifdef DEBUGMODE servs.inuse++; -#endif + servs.alloc++; cli_serv(cptr) = serv; cli_serv(cptr)->lag = 60000; *serv->by = '\0'; @@ -398,9 +376,8 @@ MyFree(cli_serv(cptr)->client_list); MyFree(cli_serv(cptr)->last_error_msg); MyFree(cli_serv(cptr)); -#ifdef DEBUGMODE --servs.inuse; -#endif + --servs.alloc; } free_client(cptr); } @@ -444,30 +421,13 @@ assert(cli_prev(client) == prev); /* Verify that the list hasn't become circular */ assert(cli_next(client) != GlobalClientList); - assert(visited <= clientAllocCount); + assert(visited <= client.alloc); /* Remember what should precede us */ prev = client; } } #endif /* DEBUGMODE */ -/** Find the list element that corresponds to a client. - * @param[in] lp Head of singly linked list. - * @param[in] ptr %Client to search for. - * @return SLink element from \a lp that contains \a ptr, or NULL if none exist. - */ -struct SLink *find_user_link(struct SLink *lp, struct Client *ptr) -{ - if (ptr) { - while (lp) { - if (lp->value.cptr == ptr) - return (lp); - lp = lp->next; - } - } - return NULL; -} - /** Allocate a new SLink element. * Pulls from #slinkFreeList if it contains anything, else it * allocates a new one from the heap. @@ -480,12 +440,10 @@ slinkFreeList = lp->next; else { lp = (struct SLink*) MyMalloc(sizeof(struct SLink)); - ++slinkAllocCount; + links.alloc++; } assert(0 != lp); -#ifdef DEBUGMODE links.inuse++; -#endif return lp; } @@ -498,9 +456,7 @@ lp->next = slinkFreeList; slinkFreeList = lp; } -#ifdef DEBUGMODE links.inuse--; -#endif } /** Add an element to a doubly linked list. @@ -541,42 +497,54 @@ MyFree(lp); } -#ifdef DEBUGMODE +/** Report memory usage of a list to \a cptr. + * @param[in] cptr Client requesting information. + * @param[in] lstats List statistics descriptor. + * @param[in] itemname Plural name of item type. + * @param[in,out] totals If non-null, accumulates item counts and memory usage. + */ +void send_liststats(struct Client *cptr, const struct liststats *lstats, + const char *itemname, struct liststats *totals) +{ + send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, ":%s: inuse %zu(%zu) alloc %zu", + itemname, lstats->inuse, lstats->mem, lstats->alloc); + if (totals) + { + totals->inuse += lstats->inuse; + totals->alloc += lstats->alloc; + totals->mem += lstats->mem; + } +} + /** Report memory usage of list elements to \a cptr. * @param[in] cptr Client requesting information. * @param[in] name Unused pointer. */ void send_listinfo(struct Client *cptr, char *name) { - int inuse = 0, mem = 0, tmp = 0; + struct liststats total; + struct liststats confs; + struct ConfItem *conf; - send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, ":Clients: inuse: %d(%d)", - clients.inuse, tmp = clients.inuse * sizeof(struct Client)); - mem += tmp; - inuse += clients.inuse; - send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, "Connections: inuse: %d(%d)", - connections.inuse, - tmp = connections.inuse * sizeof(struct Connection)); - mem += tmp; - inuse += connections.inuse; - send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, ":Users: inuse: %d(%d)", - users.inuse, tmp = users.inuse * sizeof(struct User)); - mem += tmp; - inuse += users.inuse; - send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, ":Servs: inuse: %d(%d)", - servs.inuse, tmp = servs.inuse * sizeof(struct Server)); - mem += tmp; - inuse += servs.inuse; - send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, ":Links: inuse: %d(%d)", - links.inuse, tmp = links.inuse * sizeof(struct SLink)); - mem += tmp; - inuse += links.inuse; - send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, ":Confs: inuse: %d(%d)", - GlobalConfCount, tmp = GlobalConfCount * sizeof(struct ConfItem)); - mem += tmp; - inuse += GlobalConfCount; - send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, ":Totals: inuse %d %d", - inuse, mem); -} + memset(&total, 0, sizeof(total)); + + clients.mem = clients.inuse * sizeof(struct Client); + send_liststats(cptr, &clients, "Clients", &total); + + connections.mem = connections.inuse * sizeof(struct Connection); + send_liststats(cptr, &connections, "Connections", &total); -#endif + servs.mem = servs.inuse * sizeof(struct Server); + send_liststats(cptr, &servs, "Servers", &total); + + links.mem = links.inuse * sizeof(struct SLink); + send_liststats(cptr, &links, "Links", &total); + + confs.alloc = GlobalConfCount; + confs.mem = confs.alloc * sizeof(GlobalConfCount); + for (confs.inuse = 0, conf = GlobalConfList; conf; conf = conf->next) + confs.inuse++; + send_liststats(cptr, &confs, "Confs", &total); + + send_liststats(cptr, &total, "Totals", NULL); +} Index: ircd-ircdev/ircd/m_burst.c diff -u ircd-ircdev/ircd/m_burst.c:1.11 ircd-ircdev/ircd/m_burst.c:1.12 --- ircd-ircdev/ircd/m_burst.c:1.11 Thu May 26 03:34:13 2005 +++ ircd-ircdev/ircd/m_burst.c Wed Jun 22 00:54:29 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: m_burst.c,v 1.11 2005/05/26 10:34:13 zolty Exp $ + * $Id: m_burst.c,v 1.12 2005/06/22 07:54:29 zolty Exp $ * */ @@ -397,8 +397,11 @@ newban = make_ban(ban); /* create new ban */ - DupString(newban->who, + strcpy(newban->who, cli_name(feature_bool(FEAT_HIS_BANWHO) ? &me : sptr)); + /* Original Unet, TODO-ZOLTAN + strcpy(newban->who, "*"); + */ newban->when = TStime(); newban->flags = BAN_BURSTED; /* set flags */ @@ -632,9 +635,11 @@ /* remove ban from channel */ if (lp->flags & (BAN_OVERLAPPED | BAN_BURST_WIPEOUT)) { + char *bandup; + + DupString(bandup, lp->banstr); modebuf_mode_string(mbuf, MODE_DEL | MODE_BAN, - lp->banstr, 1); /* let it free banstr */ - lp->banstr = NULL; /* do not free this string */ + bandup, 1); /* let it free banstr */ *lp_p = lp->next; /* clip out of list */ free_ban(lp); continue; Index: ircd-ircdev/ircd/m_clearmode.c diff -u ircd-ircdev/ircd/m_clearmode.c:1.8 ircd-ircdev/ircd/m_clearmode.c:1.9 --- ircd-ircdev/ircd/m_clearmode.c:1.8 Mon Mar 21 10:39:08 2005 +++ ircd-ircdev/ircd/m_clearmode.c Wed Jun 22 00:54:29 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_clearmode.c,v 1.8 2005/03/21 18:39:08 zolty Exp $ + * $Id: m_clearmode.c,v 1.9 2005/06/22 07:54:29 zolty Exp $ * */ @@ -175,12 +175,13 @@ */ if (del_mode & MODE_BAN) { for (link = chptr->banlist; link; link = next) { + char *bandup; + next = link->next; + DupString(bandup, link->banstr); modebuf_mode_string(&mbuf, MODE_DEL | MODE_BAN, /* delete ban */ - link->banstr, 1); - link->banstr = NULL; /* modebuf_mode_string() gave ownership of - * banstr to mbuf */ + bandup, 1); free_ban(link); } Index: ircd-ircdev/ircd/m_dbq.c diff -u ircd-ircdev/ircd/m_dbq.c:1.4 ircd-ircdev/ircd/m_dbq.c:1.5 --- ircd-ircdev/ircd/m_dbq.c:1.4 Mon May 16 03:17:27 2005 +++ ircd-ircdev/ircd/m_dbq.c Wed Jun 22 00:54:29 2005 @@ -21,7 +21,7 @@ */ /** @file * @brief Handlers for DBQ command. - * @version $Id: m_dbq.c,v 1.4 2005/05/16 10:17:27 zolty Exp $ + * @version $Id: m_dbq.c,v 1.5 2005/06/22 07:54:29 zolty Exp $ */ #include "config.h" @@ -108,7 +108,8 @@ } } - + sendwallto_group_butone(&me, WALL_WALLOPS, 0, + "Remote DBQ %c %s From %#C", table, key, sptr); log_write(LS_DDB, L_INFO, 0, "Remote DBQ %c %s From %#C", table, key, sptr); if (!ddb_table_is_resident(table)) @@ -197,6 +198,8 @@ } } + sendwallto_group_butone(&me, WALL_WALLOPS, 0, + "DBQ %c %s From %#C", table, key, sptr); log_write(LS_DDB, L_INFO, 0, "DBQ %c %s From %#C", table, key, cptr); if (!ddb_table_is_resident(table)) Index: ircd-ircdev/ircd/m_endburst.c diff -u ircd-ircdev/ircd/m_endburst.c:1.5 ircd-ircdev/ircd/m_endburst.c:1.6 --- ircd-ircdev/ircd/m_endburst.c:1.5 Mon Jan 10 04:23:02 2005 +++ ircd-ircdev/ircd/m_endburst.c Wed Jun 22 00:54:29 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_endburst.c,v 1.5 2005/01/10 12:23:02 zolty Exp $ + * $Id: m_endburst.c,v 1.6 2005/06/22 07:54:29 zolty Exp $ * */ @@ -126,16 +126,17 @@ for (chan = GlobalChannelList; chan; chan = next_chan) { next_chan = chan->next; - if (!chan->members) { /* empty channel */ - if ((chan->mode.mode & MODE_BURSTADDED)) - sub1_from_channel(chan); /* New empty channel, schedule it for removal. */ - /* FIX-ZOLTAN Añadido */ - else - sendto_opmask_butone(0, SNO_OLDSNO, "Empty channel %H not added by " - "BURST!", chan); + if (!chan->members && (chan->mode.mode & MODE_BURSTADDED)) { + /* Newly empty channel, schedule it for removal. */ + chan->mode.mode &= ~MODE_BURSTADDED; + sub1_from_channel(chan); + } else { + chan->mode.mode &= ~MODE_BURSTADDED; +#if !defined(UNDERNET) && !defined(DDB) + sendto_opmask_butone(0, SNO_OLDSNO, "Empty channel %H not added by " + "BURST!", chan); +#endif } - - chan->mode.mode &= ~MODE_BURSTADDED; } return 0; Index: ircd-ircdev/ircd/m_invite.c diff -u ircd-ircdev/ircd/m_invite.c:1.11 ircd-ircdev/ircd/m_invite.c:1.12 --- ircd-ircdev/ircd/m_invite.c:1.11 Sat May 7 15:23:40 2005 +++ ircd-ircdev/ircd/m_invite.c Wed Jun 22 00:54:29 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.11 2005/05/07 22:23:40 zolty Exp $ + * $Id: m_invite.c,v 1.12 2005/06/22 07:54:29 zolty Exp $ * */ @@ -147,7 +147,7 @@ return 0; if (!(chptr = FindChannel(parv[2]))) { - send_reply(sptr, ERR_NOTONCHANNEL, parv[2]); + send_reply(sptr, ERR_NOSUCHCHANNEL, parv[2]); return 0; } Index: ircd-ircdev/ircd/m_server.c diff -u ircd-ircdev/ircd/m_server.c:1.8 ircd-ircdev/ircd/m_server.c:1.9 --- ircd-ircdev/ircd/m_server.c:1.8 Sat Apr 2 11:47:35 2005 +++ ircd-ircdev/ircd/m_server.c Wed Jun 22 00:54:29 2005 @@ -21,7 +21,7 @@ */ /** @file * @brief Handlers for the SERVER command. - * @version $Id: m_server.c,v 1.8 2005/04/02 19:47:35 zolty Exp $ + * @version $Id: m_server.c,v 1.9 2005/06/22 07:54:29 zolty Exp $ */ #include "config.h" @@ -588,7 +588,7 @@ log_write(LS_NETWORK, L_NOTICE, LOG_NOSNOTICE, "Received unauthorized " "connection from %C [%s]", cptr, ircd_ntoa(&cli_ip(cptr))); - return exit_client(cptr, cptr, &me, "No C:line"); + return exit_client(cptr, cptr, &me, "No Connect block"); } host = cli_name(cptr); Index: ircd-ircdev/ircd/m_topic.c diff -u ircd-ircdev/ircd/m_topic.c:1.7 ircd-ircdev/ircd/m_topic.c:1.8 --- ircd-ircdev/ircd/m_topic.c:1.7 Mon Jan 10 04:23:03 2005 +++ ircd-ircdev/ircd/m_topic.c Wed Jun 22 00:54:30 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_topic.c,v 1.7 2005/01/10 12:23:03 zolty Exp $ + * $Id: m_topic.c,v 1.8 2005/06/22 07:54:30 zolty Exp $ * */ @@ -110,7 +110,12 @@ { /* allow off-channel services to set the topic of any channel */ } +#if defined(DDB) || defined(SERVICES) + else if ((chptr->mode.mode & MODE_TOPICLIMIT) && + !(is_chan_owner(sptr, chptr) || is_chan_op(sptr, chptr))) +#else else if ((chptr->mode.mode & MODE_TOPICLIMIT) && !is_chan_op(sptr, chptr)) +#endif { /* if +t and not @'d, return an error and ignore the topic */ send_reply(sptr, ERR_CHANOPRIVSNEEDED, chptr->chname); Index: ircd-ircdev/ircd/match.c diff -u ircd-ircdev/ircd/match.c:1.9 ircd-ircdev/ircd/match.c:1.10 --- ircd-ircdev/ircd/match.c:1.9 Fri Apr 22 09:22:13 2005 +++ ircd-ircdev/ircd/match.c Wed Jun 22 00:54:30 2005 @@ -22,7 +22,7 @@ */ /** @file * @brief Functions to match strings against IRC mask strings. - * @version $Id: match.c,v 1.9 2005/04/22 16:22:13 zolty Exp $ + * @version $Id: match.c,v 1.10 2005/06/22 07:54:30 zolty Exp $ */ #include "config.h" @@ -194,59 +194,56 @@ { const char *m = mask, *n = name; const char *m_tmp = mask, *n_tmp = name; - int wild = 0; - - for (;;) - { - if (*m == '*') { - while (*m == '*') /* clean up any additional wildcards */ - m++; - - m_tmp = m; - n_tmp = n; - wild = 1; - } - if (*m == '\\') /* next wildcard is disregarded */ - m++; - - if (!*m) { - if (!*n) - return 0; /* match */ - - for (m--; (m > mask) && (*m == '?'); m--); - ; - - if (*m == '*' && (m > mask)) - return 0; /* match */ - - if (!wild) - return 1; - - m = m_tmp; - n = ++n_tmp; - } - else if (!*n) { - while (*m == '*') /* clean up any additional wildcards */ - m++; + int star_p; - return (*m != 0); - } - if (ToLower(*m) != ToLower(*n) && *m != '?') { - if (!wild) - return 1; /* failure! */ - - m = m_tmp; - n = ++n_tmp; + for (;;) switch (*m) { + case '\0': + if (!*n) + return 0; + backtrack: + if (m_tmp == mask) + return 1; + m = m_tmp; + n = ++n_tmp; + break; + case '\\': + m++; + /* allow escaping to force capitalization */ + if (*m++ != *n++) + return 1; + break; + case '*': case '?': + for (star_p = 0; ; m++) { + if (*m == '*') + star_p = 1; + else if (*m == '?') { + if (!*n++) + goto backtrack; + } else break; } - else { - if (*m) - m++; - if (*n) - n++; + if (star_p) { + if (!*m) + return 0; + else if (*m == '\\') { + m_tmp = ++m; + if (!*m) + return 1; + for (n_tmp = n; *n && *n != *m; n++) ; + } else { + m_tmp = m; + for (n_tmp = n; *n && ToLower(*n) != ToLower(*m); n++) ; + } } + /* and fall through */ + default: + if (!*n) + return *m != '\0'; + if (ToLower(*m) != ToLower(*n)) + goto backtrack; + m++; + n++; + break; } - - return 1; /* no match! */ } /* @@ -889,7 +886,7 @@ if (mask[0] == '.' || mask[0] == '/') return 0; for (p = mask; *p; ++p) - if (*p != '*' && *p != '?' && *p != '.' && *p != '/') + if (*p != '*' && *p != '.' && *p != '/') { if (!IsDigit(*p)) return 0; Index: ircd-ircdev/ircd/s_bsd.c diff -u ircd-ircdev/ircd/s_bsd.c:1.14 ircd-ircdev/ircd/s_bsd.c:1.15 --- ircd-ircdev/ircd/s_bsd.c:1.14 Mon May 16 03:17:27 2005 +++ ircd-ircdev/ircd/s_bsd.c Wed Jun 22 00:54:30 2005 @@ -21,7 +21,7 @@ */ /** @file * @brief Functions that now (or in the past) relied on BSD APIs. - * @version $Id: s_bsd.c,v 1.14 2005/05/16 10:17:27 zolty Exp $ + * @version $Id: s_bsd.c,v 1.15 2005/06/22 07:54:30 zolty Exp $ */ #include "config.h" @@ -793,10 +793,10 @@ if (!find_conf_byhost(cli_confs(cptr), aconf->host, CONF_SERVER)) { sendto_opmask_butone(0, SNO_OLDSNO, "Host %s is not enabled for " - "connecting: no C-line", aconf->name); + "connecting: no Connect block", 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); + "Connect block", by, aconf->name); } det_confs_butmask(cptr, 0); free_client(cptr); Index: ircd-ircdev/ircd/s_conf.c diff -u ircd-ircdev/ircd/s_conf.c:1.17 ircd-ircdev/ircd/s_conf.c:1.18 --- ircd-ircdev/ircd/s_conf.c:1.17 Mon May 23 01:58:37 2005 +++ ircd-ircdev/ircd/s_conf.c Wed Jun 22 00:54:30 2005 @@ -21,7 +21,7 @@ */ /** @file * @brief ircd configuration file driver - * @version $Id: s_conf.c,v 1.17 2005/05/23 08:58:37 zolty Exp $ + * @version $Id: s_conf.c,v 1.18 2005/06/22 07:54:30 zolty Exp $ */ #include "config.h" @@ -133,9 +133,7 @@ aconf = (struct ConfItem*) MyMalloc(sizeof(struct ConfItem)); assert(0 != aconf); -#ifdef DEBUGMODE ++GlobalConfCount; -#endif memset(aconf, 0, sizeof(struct ConfItem)); aconf->status = type; aconf->next = GlobalConfList; @@ -163,9 +161,7 @@ MyFree(aconf->name); MyFree(aconf->hub_limit); MyFree(aconf); -#ifdef DEBUGMODE --GlobalConfCount; -#endif } /** Disassociate configuration from the client. @@ -1170,7 +1166,8 @@ if (IsConnecting(cptr) || IsHandshake(cptr)) { c_conf = find_conf_byname(lp, cli_name(cptr), CONF_SERVER); if (!c_conf) { - sendto_opmask_butone(0, SNO_OLDSNO, "Connect Error: lost C:line for %s", + sendto_opmask_butone(0, SNO_OLDSNO, + "Connect Error: lost Connect block for %s", cli_name(cptr)); det_confs_butmask(cptr, 0); return -1; Index: ircd-ircdev/ircd/s_debug.c diff -u ircd-ircdev/ircd/s_debug.c:1.9 ircd-ircdev/ircd/s_debug.c:1.10 --- ircd-ircdev/ircd/s_debug.c:1.9 Wed Mar 23 10:34:52 2005 +++ ircd-ircdev/ircd/s_debug.c Wed Jun 22 00:54:30 2005 @@ -21,7 +21,7 @@ */ /** @file * @brief Debug support for the ircd. - * @version $Id: s_debug.c,v 1.9 2005/03/23 18:34:52 zolty Exp $ + * @version $Id: s_debug.c,v 1.10 2005/06/22 07:54:30 zolty Exp $ */ #include "config.h" @@ -29,6 +29,7 @@ #include "channel.h" #include "class.h" #include "client.h" +#include "ddb.h" #include "gline.h" #include "hash.h" #include "ircd_alloc.h" @@ -39,6 +40,7 @@ #include "ircd.h" #include "jupe.h" #include "list.h" +#include "listener.h" #include "motd.h" #include "msgq.h" #include "numeric.h" @@ -47,6 +49,7 @@ #include "s_bsd.h" #include "s_conf.h" #include "s_stats.h" +#include "s_user.h" #include "send.h" #include "struct.h" #include "sys.h" @@ -218,7 +221,6 @@ struct Client *acptr; struct SLink *link; struct Ban *ban; -/* struct Watch *watch; */ struct Channel *chptr; struct ConfItem *aconf; const struct ConnectionClass* cltmp; @@ -229,12 +231,12 @@ cn = 0, /* connections */ ch = 0, /* channels */ lcc = 0, /* local client conf links */ - us = 0, /* user structs */ chi = 0, /* channel invites */ chb = 0, /* channel bans */ wwu = 0, /* whowas users */ cl = 0, /* classes */ co = 0, /* conf lines */ + listeners = 0, /* listeners */ memberships = 0; /* channel memberships */ int usi = 0, /* users invited */ @@ -247,9 +249,17 @@ chbm = 0, /* memory used by channel bans */ cm = 0, /* memory used by clients */ cnm = 0, /* memory used by connections */ + us = 0, /* user structs */ + usm = 0, /* memory used by user structs */ awm = 0, /* memo... [truncated message content] |
From: Toni G. <zo...@us...> - 2005-05-31 11:11:22
|
CVSROOT : /cvsroot/irc-dev Module : ircd-ircdev Commit time: 2005-05-31 11:11:12 UTC Modified files: ircd/test/Makefile.in ircd/test/channel-1.cmd ircd/test/client-1.cmd ircd/test/gline-1.cmd ircd/test/ircd-t1.conf ircd/test/run-tests.sh ircd/test/stats-1.cmd ircd/test/test-driver.pl ircd/test/test_stub.c Added files: ircd/test/commands-1.cmd ircd/test/feature-1.cmd ircd/test/ircd-t1-2.conf ircd/test/ircd-t2.conf ircd/test/ircd_match_t.c ircd/test/jupe-1.cmd ircd/test/kill-block-1.cmd Log message: Nuevos tests ---------------------- diff included ---------------------- Index: ircd-ircdev/ircd/test/Makefile.in diff -u ircd-ircdev/ircd/test/Makefile.in:1.3 ircd-ircdev/ircd/test/Makefile.in:1.4 --- ircd-ircdev/ircd/test/Makefile.in:1.3 Wed Jan 26 09:19:48 2005 +++ ircd-ircdev/ircd/test/Makefile.in Tue May 31 04:10:52 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: Makefile.in,v 1.3 2005/01/26 17:19:48 zolty Exp $ +# $Id: Makefile.in,v 1.4 2005/05/31 11:10:52 zolty Exp $ top_srcdir = @top_srcdir@ srcdir = @srcdir@ @@ -29,12 +29,14 @@ TESTPROGS = \ ircd_chattr_t \ - ircd_string_t \ ircd_in_addr_t + ircd_match_t \ + ircd_string_t DEP_SRC = \ ircd_chattr_t.c \ ircd_in_addr_t.c \ + ircd_match_t.c \ ircd_string_t.c \ test_stub.c @@ -56,15 +58,19 @@ IRCD_CHATTR_T_OBJS = ircd_chattr_t.o test_stub.o ../ircd_string.o ircd_chattr_t: $(IRCD_CHATTR_T_OBJS) - ${CC} -o $@ $(IRCD_CHATTR_T_OBJS) - -IRCD_STRING_T_OBJS = ircd_string_t.o test_stub.o ../ircd_string.o -ircd_string_t: $(IRCD_STRING_T_OBJS) - ${CC} -o $@ $(IRCD_STRING_T_OBJS) + ${CC} -o $@ $(LDFLAGS) $(IRCD_CHATTR_T_OBJS) IRCD_IN_ADDR_T_OBJS = ircd_in_addr_t.o test_stub.o ../ircd_alloc.o ../ircd_string.o ../match.o ../numnicks.o ircd_in_addr_t: $(IRCD_IN_ADDR_T_OBJS) - ${CC} -o $@ $(IRCD_IN_ADDR_T_OBJS) + ${CC} -o $@ $(LDFLAGS) $(IRCD_IN_ADDR_T_OBJS) + +IRCD_MATCH_T_OBJS = ircd_match_t.o test_stub.o ../ircd_string.o ../match.o +ircd_match_t: $(IRCD_MATCH_T_OBJS) + ${CC} -o $@ $(LDFLAGS) $(IRCD_MATCH_T_OBJS) + +IRCD_STRING_T_OBJS = ircd_string_t.o test_stub.o ../ircd_string.o +ircd_string_t: $(IRCD_STRING_T_OBJS) + ${CC} -o $@ $(LDFLAGS) $(IRCD_STRING_T_OBJS) .c.o: ${CC} ${CFLAGS} ${CPPFLAGS} -c $< -o $@ Index: ircd-ircdev/ircd/test/channel-1.cmd diff -u ircd-ircdev/ircd/test/channel-1.cmd:1.1 ircd-ircdev/ircd/test/channel-1.cmd:1.2 --- ircd-ircdev/ircd/test/channel-1.cmd:1.1 Mon May 16 04:31:20 2005 +++ ircd-ircdev/ircd/test/channel-1.cmd Tue May 31 04:11:01 2005 @@ -1,29 +1,50 @@ -define srv localhost:7701 +define srv localhost -connect cl1 Alex alex %srv% :Test client 1 -connect cl2 Bubb bubb %srv% :Test client 2 +connect cl1 Alex alex %srv%:7701 :Test client 1 +connect cl2 Bubb bubb %srv%:7711 :Test client 2 :cl1 join #test :cl1 join #test2 :cl1 mode #test +bb *!*@127.0.0.1 *!*@127.0.0.2 :cl2 wait cl1 -:cl2 join #test -:cl1 wait cl2 +:cl2 raw :away :I'm not here, go away. I'm not here, go away. I'm not here, go away. I'm not here, go away. I'm not here, go away. I'm not here, go away. I'm not here, go away. I'm not here, go away. I'm not here, go away. I'm not here, go away. +:cl2 raw :away :I'm not here, go away. +:cl2 join #test,#test3,#test4,+local +:cl1 wait cl2 +:cl1 join #test3 +:cl1 raw :invite Bubb +:cl1 raw :invite #test +:cl1 invite Bubb #non-existent-channel +:cl1 invite Bubb #test3 +:cl1 invite Bubb #test4 :cl1 invite Bubb #test :cl2 expect *cl1 invite #test +:cl2 mode #test3 +o Alex +:cl2 raw :invite :cl2 join #test :cl2 privmsg #test :Hello, *cl1. +:cl2 notice #test :Hello, *cl1 (via notice). +:cl2 notice @#test :Hello, *cl1 (via wallchops). +:cl2 privmsg #test5 :Hello, *cl1. :cl2 nick Buba :cl2 mode #test +l 15 :cl1 wait cl2 :cl1 privmsg #test :Hello, *cl2. +:cl1 raw :cprivmsg bubb #test :Hello, bubb. +:cl1 raw :cnotice bubb #test :Hello, bubb. :cl1 mode #test -b+kv *!*@127.0.0.1 secret Bubb :cl1 mode #test +b foo!bar@baz :cl1 mode #test +b :cl1 mode #test : :cl1 mode #test -:cl1 raw who #test %lfuh +:cl1 raw :names +:cl1 raw :names #test +:cl1 raw :names +local +:cl1 raw :names +local test-2.* +:cl1 raw :who #test %lfuh :cl2 wait cl1 +:cl2 raw :part :cl2 part #test +:cl2 part #test5 :cl1 wait cl2 :cl2 join #test public :cl2 join #test secret @@ -45,4 +66,9 @@ :cl2 wait cl1 :cl2 mode #test2 -D :cl2 mode #test +v Alex +:cl1 raw :kick #test bubb +:cl2 raw :squit test-1.* +:cl2 sleep 1 +:cl2 raw :connect test-1.* +:cl2 raw :away : :cl1 wait cl2 Index: ircd-ircdev/ircd/test/client-1.cmd diff -u ircd-ircdev/ircd/test/client-1.cmd:1.1 ircd-ircdev/ircd/test/client-1.cmd:1.2 --- ircd-ircdev/ircd/test/client-1.cmd:1.1 Mon May 16 04:31:20 2005 +++ ircd-ircdev/ircd/test/client-1.cmd Tue May 31 04:11:01 2005 @@ -1,9 +1,12 @@ -define srv localhost:7701 +define srv localhost -connect cl1 Alex alex %srv% :Test client 1 +connect cl1 Alex alex %srv%:7701 :Test client 1 :cl1 oper oper1 oper1 -connect cl2 Bubb bubb %srv% :Test client 2 +:cl1 oper oper1 oper1 +connect cl2 Bubb bubb %srv%:7711 :Test client 2 +:cl1 raw :time :cl2 oper oper3 oper4 +:cl1 raw :version :cl2 oper oldoper wrongpass :cl2 oper md5oper wrongpass :cl2 oper cryptoper wrongpass @@ -13,3 +16,10 @@ :cl1 raw :privs Bubb :cl1 nick A :cl1 nick Alexey +:cl1 raw :privmsg : +:cl1 raw :privmsg Alexey : +:cl1 raw :privmsg Bubb :hello Bubb +:cl1 raw :privmsg $*.net :Hello all *.net servers. +:cl1 raw :notice $*.net :Hello all *.net servers. +:cl1 raw :kill Bubb :goodbye Bubb +:cl1 raw :whowas Alex,Bubb 5 Index: ircd-ircdev/ircd/test/commands-1.cmd diff -u /dev/null ircd-ircdev/ircd/test/commands-1.cmd:1.1 --- /dev/null Tue May 31 04:11:12 2005 +++ ircd-ircdev/ircd/test/commands-1.cmd Tue May 31 04:11:01 2005 @@ -0,0 +1,43 @@ +define srv localhost:7701 + +connect cl1 Alex alex %srv% :Test client 1 +connect cl2 Bubb bubb %srv% :Test client 2 +:cl1 raw :help +:cl1 raw :admin +:cl1 raw :admin test-2.* +:cl1 raw :info +:cl1 raw :wallops :HELLO OPERZ!!! +:cl1 wait cl2 +:cl1 raw :ison alex,bubb,alex,bubb,alex,bubb +:cl1 raw :who b*b +:cl1 raw :burst the bubble +:cl1 raw :server huh huh i'm a server +:cl1 raw :links +:cl1 raw :map +:cl1 raw :nick +:cl1 raw :nick ~ +:cl1 raw :nick -dude- +:cl1 raw :nick alex +:cl1 raw :nick Bubb +:cl1 raw :ping alex test-1.* + +:cl1 oper oper1 oper1 +:cl1 raw :admin +:cl1 raw :admin test-2.* +:cl1 raw :asll +:cl1 raw :asll test-2.* +:cl1 raw :info +:cl1 raw :info test-2.* +:cl1 raw :who x b*b +:cl1 raw :close +:cl1 raw :map +:cl1 raw :links +:cl1 raw :links test-2.* +:cl1 raw :lusers +:cl1 raw :lusers test-2.* +:cl1 raw :motd +:cl1 raw :motd test-2.* +:cl1 raw :ping alex test-2.* +:cl1 raw :rping test-2.* + +:cl2 raw :quit Index: ircd-ircdev/ircd/test/feature-1.cmd diff -u /dev/null ircd-ircdev/ircd/test/feature-1.cmd:1.1 --- /dev/null Tue May 31 04:11:12 2005 +++ ircd-ircdev/ircd/test/feature-1.cmd Tue May 31 04:11:01 2005 @@ -0,0 +1,18 @@ +define srv localhost:7701 + +connect cl1 Alex alex %srv% :Test client 1 +:cl1 oper oper1 oper1 +:cl1 raw :GET LOG +:cl1 raw :RESET LOG +:cl1 raw :GET RANDOM_SEED +:cl1 raw :SET RANDOM_SEED +:cl1 raw :SET RANDOM_SEED abcdefghijklmnop +:cl1 raw :GET DEFAULT_LIST_PARAM +:cl1 raw :SET DEFAULT_LIST_PARAM FALSE +:cl1 raw :SET DEFAULT_LIST_PARAM TRUE +:cl1 nick Alexey +:cl1 nick Amdahl +:cl1 nick Andy +:cl1 nick Aon +:cl1 nick Apple +:cl1 raw :SET NICKNAMEHISTORYLENGTH 4 Index: ircd-ircdev/ircd/test/gline-1.cmd diff -u ircd-ircdev/ircd/test/gline-1.cmd:1.1 ircd-ircdev/ircd/test/gline-1.cmd:1.2 --- ircd-ircdev/ircd/test/gline-1.cmd:1.1 Mon May 16 04:31:20 2005 +++ ircd-ircdev/ircd/test/gline-1.cmd Tue May 31 04:11:01 2005 @@ -7,6 +7,9 @@ :cl1 raw :gline !+127.2.* 3600 :Localclone? :cl1 sleep 5 :cl1 raw :gline !+127.2.* 3600 :Localclone? +:cl1 raw :gline !+127.2.*/15 3600 :Localclone? +:cl1 raw :gline !+127.2.0.0/33 3600 :Localclone? +:cl1 raw :gline !+127.2.0.0/15 3600 :Localclone? connect cl2 Bubb bubb %srv% :Test client 2 :cl1 raw :gline :cl1 raw :gline $Rbubb Index: ircd-ircdev/ircd/test/ircd-t1-2.conf diff -u /dev/null ircd-ircdev/ircd/test/ircd-t1-2.conf:1.1 --- /dev/null Tue May 31 04:11:12 2005 +++ ircd-ircdev/ircd/test/ircd-t1-2.conf Tue May 31 04:11:01 2005 @@ -0,0 +1,93 @@ +General { + name = "test-1.example.net"; + vhost = "127.0.0.1"; + vhost = "::1"; + description = "Test Server 1"; + numeric = 1; +}; + +Admin { + location = "Somewhere"; + contact = "Someone"; +}; + +Class { + name = "Server"; + pingfreq = 180 seconds; + connectfreq = 300 seconds; + maxlinks = 1; + sendq = 9000000; +}; + +Class { + name = "others"; + pingfreq = 180 seconds; + sendq = 160000; + maxlinks = 100; + usermode = "+oiwx"; +}; + +Class { + name = "Opers"; + pingfreq = 180 seconds; + sendq = 160000; + maxlinks = 10; + local = no; +}; + +Connect { + name = "bogus.example.net"; + host = "example.net"; + password = "bogus_example"; + port = 7700; + class = "Server"; + maxhops = 2; + hub = "*.example.net"; + autoconnect = yes; # forces a DNS resolution attempt +}; + +CRule { + server = "bogus.example.net"; + all = yes; + rule = "connected(*)"; +}; + +CRule { + server = "bogus.example.net"; + all = no; + rule = "directcon(*)"; +}; + +UWorld { + name = "uworld.example.net"; + name = "uworld2.example.net"; +}; + +Jupe { + nick = "A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q"; + nick = "R,S,T,U,V,W,X,Y,Z,{,|,},~,-,_,`"; +}; + +Operator { name = "oper1"; host = "*@*"; password = "$PLAIN$oper1"; class = "Opers"; }; +Operator { name = "oper2"; host = "*@*"; password = "$PLAIN$oper2"; class = "Opers"; local = yes; }; +Operator { name = "oldoper"; host = "*@*"; password = "Xlfc26b4eYGWs"; class = "Opers"; }; +Operator { name = "md5oper"; host = "*@*"; password = "$SMD5$2O$4O.rSAmhE4Fg05MmG.047/"; class = "Opers"; }; +Operator { name = "cryptoper"; host = "*@*"; password = "$CRYPT$41ndrxPQu3B66"; class = "Opers"; }; + +Kill { username = "sub7"; realname = "s*7*"; reason = "You are infected with a Trojan"; }; +Kill { realname = "Chloe"; reason = "drones"; }; +Kill { username = "sub7"; reason = "You are infected with a Trojan"; }; + +Client { class = "others"; ip = "*"; }; + +Port { server = yes; port = 7700; }; +Port { server = no; port = 7702; }; + +Quarantine { + "#shells" = "Thou shalt not support the h4><0rz"; +}; + +Features { + "HIS_STATS_k" = "FALSE"; + "PPATH" = "ircd-t1.pid"; +}; Index: ircd-ircdev/ircd/test/ircd-t1.conf diff -u ircd-ircdev/ircd/test/ircd-t1.conf:1.1 ircd-ircdev/ircd/test/ircd-t1.conf:1.2 --- ircd-ircdev/ircd/test/ircd-t1.conf:1.1 Mon May 16 04:31:20 2005 +++ ircd-ircdev/ircd/test/ircd-t1.conf Tue May 31 04:11:01 2005 @@ -46,6 +46,15 @@ autoconnect = yes; # forces a DNS resolution attempt }; +Connect { + name = "test-2.example.net"; + host = "::1"; + password = "bogus_example"; + port = 7710; + class = "Server"; + autoconnect = no; +}; + CRule { server = "bogus.example.net"; all = yes; @@ -94,4 +103,5 @@ Features { "HIS_STATS_k" = "FALSE"; + "PPATH" = "ircd-t1.pid"; }; Index: ircd-ircdev/ircd/test/ircd-t2.conf diff -u /dev/null ircd-ircdev/ircd/test/ircd-t2.conf:1.1 --- /dev/null Tue May 31 04:11:12 2005 +++ ircd-ircdev/ircd/test/ircd-t2.conf Tue May 31 04:11:01 2005 @@ -0,0 +1,95 @@ +General { + name = "test-2.example.net"; + vhost = "127.0.0.1"; + vhost = "::1"; + description = "Test Server 2"; + numeric = 2; +}; + +Admin { + location = "Somewhere"; + contact = "Someone"; +}; + +Class { + name = "Server"; + pingfreq = 180 seconds; + connectfreq = 300 seconds; + maxlinks = 1; + sendq = 9000000; +}; + +Class { + name = "others"; + pingfreq = 180 seconds; + sendq = 160000; + maxlinks = 100; + usermode = "+oiwx"; +}; + +Class { + name = "Opers"; + pingfreq = 180 seconds; + sendq = 160000; + maxlinks = 10; + local = no; +}; + +Connect { + name = "test-1.example.net"; + host = "::1"; + password = "bogus_example"; + port = 7700; + class = "Server"; + maxhops = 2; + hub = "*.example.net"; + autoconnect = yes; +}; + +CRule { + server = "bogus.example.net"; + all = yes; + rule = "connected(*)"; +}; + +CRule { + server = "bogus.example.net"; + all = no; + rule = "directcon(*)"; +}; + +UWorld { + name = "uworld.example.net"; + name = "uworld2.example.net"; +}; + +Jupe { + nick = "A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q"; + nick = "R,S,T,U,V,W,X,Y,Z,{,|,},~,-,_,`"; +}; + +Operator { name = "oper1"; host = "*@*"; password = "$PLAIN$oper1"; class = "Opers"; }; +Operator { name = "oper2"; host = "*@*"; password = "$PLAIN$oper2"; class = "Opers"; local = yes; }; + +Kill { realname = "Chloe"; reason = "drones"; }; +Kill { username = "sub7"; reason = "You are infected with a Trojan"; }; + +Client { class = "others"; ip = "*"; }; + +Port { server = yes; port = 7710; }; +Port { server = no; port = 7711; mask = "127.0.0.0/8"; }; + +Quarantine { + "#shells" = "Thou shalt not support the h4><0rz"; +}; + +Pseudo "X" { + name = "X"; + nick = "X...@ch..."; +}; + +Features { + "PPATH" = "ircd-t2.pid"; + "LOG" = "SYSTEM" "FILE" "ircd-t2.log"; + "LOG" = "SYSTEM" "LEVEL" "NOTICE"; +}; Index: ircd-ircdev/ircd/test/ircd_match_t.c diff -u /dev/null ircd-ircdev/ircd/test/ircd_match_t.c:1.1 --- /dev/null Tue May 31 04:11:12 2005 +++ ircd-ircdev/ircd/test/ircd_match_t.c Tue May 31 04:11:01 2005 @@ -0,0 +1,74 @@ +/* + * ircd_match_t.c - test cases for irc glob matching + */ + +#include "ircd_log.h" +#include "match.h" +#include <stdio.h> +#include <string.h> + +struct match_test { + const char *glob; + const char *should_match; + const char *shouldnt_match; +}; + +const struct match_test match_tests[] = { + { "\\*", + "*\0", + "a\0*PeacefuL*\0" }, + { "*a*", + "a\0pizza\0abe\0brack\0", + "b\0" }, + { "?", + "*\0a\0?\0", + "*PeacefuL*\0pizza\0???\0" }, + { "abc", + "abc\0", + "abcd\0cabc\0" }, + { "*abc", + "abc\0fooabc\0ababc\0", + "abra\0abcd\0" }, + { "\\?", + "?\0", + "a\0" }, + { NULL, NULL, NULL } +}; + +void do_match_test(const struct match_test *test) +{ + const char *candidate; + unsigned int matched, not_matched; + int res; + + for (candidate = test->should_match, matched = 0; + *candidate; + candidate += strlen(candidate) + 1, ++matched) { + res = match(test->glob, candidate); + if (res != 0) { + fprintf(stderr, "\"%s\" failed to match \"%s\".\n", test->glob, candidate); + assert(0); + } + } + + for (candidate = test->shouldnt_match, not_matched = 0; + *candidate; + candidate += strlen(candidate) + 1, ++not_matched) { + res = match(test->glob, candidate); + if (res == 0) { + fprintf(stderr, "\"%s\" incorrectly matched \"%s\".\n", test->glob, candidate); + assert(0); + } + } + + printf("Passed: %s (%u matches, %u non-matches)\n", + test->glob, matched, not_matched); +} + +int main(int argc, char *argv[]) +{ + const struct match_test *match; + for (match = match_tests; match->glob; ++match) + do_match_test(match); + return 0; +} Index: ircd-ircdev/ircd/test/jupe-1.cmd diff -u /dev/null ircd-ircdev/ircd/test/jupe-1.cmd:1.1 --- /dev/null Tue May 31 04:11:12 2005 +++ ircd-ircdev/ircd/test/jupe-1.cmd Tue May 31 04:11:01 2005 @@ -0,0 +1,8 @@ +define srv localhost:7701 + +connect cl1 Alex alex %srv% :Test client 1 +:cl1 oper oper1 oper1 +:cl1 raw :jupe +irc-3.example.net 3600 :Server 3 not welcome here. +:cl1 raw :jupe -irc-3.example.net 3600 :Server 3 not welcome here. +:cl1 raw :jupe +irc-3.example.net * 3600 :Server 3 not welcome here. +:cl1 raw :jupe -irc-3.example.net * 3600 :Server 3 not welcome here. Index: ircd-ircdev/ircd/test/kill-block-1.cmd diff -u /dev/null ircd-ircdev/ircd/test/kill-block-1.cmd:1.1 --- /dev/null Tue May 31 04:11:12 2005 +++ ircd-ircdev/ircd/test/kill-block-1.cmd Tue May 31 04:11:01 2005 @@ -0,0 +1,4 @@ +define srv localhost:7701 + +connect cl1 Alex sub7 %srv% :s7server +connect cl2 Chloe chloe %srv% :Chloe Index: ircd-ircdev/ircd/test/run-tests.sh diff -u ircd-ircdev/ircd/test/run-tests.sh:1.1 ircd-ircdev/ircd/test/run-tests.sh:1.2 --- ircd-ircdev/ircd/test/run-tests.sh:1.1 Mon May 16 04:31:20 2005 +++ ircd-ircdev/ircd/test/run-tests.sh Tue May 31 04:11:01 2005 @@ -1,12 +1,27 @@ #! /bin/sh set -e srcdir=$1 -for script in channel-1 client-1 stats-1 gline-1 ; do +cp ${srcdir}/ircd-t1.conf ircd-t1.conf +cp ${srcdir}/ircd-t2.conf ircd-t2.conf +echo "Testing one-shot ircd invocations." +../ircd -v +../ircd -x 6 -k -d . -f ircd-t1.conf -c user@127.0.0.1 +echo "Starting ircd." +../ircd -d . -f ircd-t1.conf +../ircd -d . -f ircd-t2.conf +sleep 10 +# stats-1 is out of alphabetical order to avoid triggering IPcheck. +for script in channel-1 client-1 command-1 feature-1 gline-1 stats-1 jupe-1 kill-block-1 ; do echo "Running test $script." ${srcdir}/test-driver.pl ${srcdir}/${script}.cmd done -echo "Terminating server." -${srcdir}/test-driver.pl ${srcdir}/die.cmd -../ircd -? -../ircd -v -../ircd -x 6 -k -d ${srcdir} -f ircd-t1.conf -c user@127.0.0.1 +echo "Sending signals to server." +cp ${srcdir}/ircd-t1-2.conf ircd-t1.conf +kill -HUP `cat ircd-t1.pid` +sleep 1 +kill -INT `cat ircd-t1.pid` +# A long sleep is necessary to make the server flush its IPcheck entries. +sleep 610 +kill -TERM `cat ircd-t1.pid` `cat ircd-t2.pid` +sleep 1 +../ircd -? || true Index: ircd-ircdev/ircd/test/stats-1.cmd diff -u ircd-ircdev/ircd/test/stats-1.cmd:1.1 ircd-ircdev/ircd/test/stats-1.cmd:1.2 --- ircd-ircdev/ircd/test/stats-1.cmd:1.1 Mon May 16 04:31:20 2005 +++ ircd-ircdev/ircd/test/stats-1.cmd Tue May 31 04:11:01 2005 @@ -33,6 +33,9 @@ :cl1 raw :stats z :cl1 raw :stats * +# Remote stats requests +:cl1 raw :stats f test-2.* + # Named stats commands :cl1 raw :stats nameservers :cl1 raw :stats connect @@ -65,6 +68,9 @@ :cl1 raw :stats memory :cl1 raw :stats help :cl1 raw :hash +:cl1 raw :rehash m +:cl1 raw :rehash l +:cl1 raw :rehash q :cl1 raw :rehash :cl1 nick Alexey Index: ircd-ircdev/ircd/test/test-driver.pl diff -u ircd-ircdev/ircd/test/test-driver.pl:1.1 ircd-ircdev/ircd/test/test-driver.pl:1.2 --- ircd-ircdev/ircd/test/test-driver.pl:1.1 Mon May 16 04:31:20 2005 +++ ircd-ircdev/ircd/test/test-driver.pl Tue May 31 04:11:01 2005 @@ -4,7 +4,7 @@ # collection isn't broken. POE is sometimes too clever for our good # in finding references to sessions, and keeps running even after we # want to stop. -# $Id: test-driver.pl,v 1.1 2005/05/16 11:31:20 zolty Exp $ +# $Id: test-driver.pl,v 1.2 2005/05/31 11:11:01 zolty Exp $ # This interprets a simple scripting language. Lines starting with a # hash mark (#, aka octothorpe, pound sign, etc) are ignored. The @@ -103,8 +103,11 @@ irc_nick => sub {}, irc_part => sub {}, irc_ping => sub {}, + irc_pong => sub {}, + irc_rpong => sub {}, irc_quit => sub {}, irc_topic => sub {}, + irc_plugin_add => sub {}, irc_error => \&irc_error, irc_disconnected => \&irc_disconnected, irc_socketerr => \&irc_socketerr, @@ -316,7 +319,8 @@ } return undef; } - print "ERROR: Unexpected event $state to test driver (from ".$sender->ID.")\n"; + print "ERROR: Unexpected event $state to test driver (from ".$sender->ID.")\n" + unless $state eq '_signal'; return undef; } Index: ircd-ircdev/ircd/test/test_stub.c diff -u ircd-ircdev/ircd/test/test_stub.c:1.2 ircd-ircdev/ircd/test/test_stub.c:1.3 --- ircd-ircdev/ircd/test/test_stub.c:1.2 Mon Mar 21 10:39:12 2005 +++ ircd-ircdev/ircd/test/test_stub.c Tue May 31 04:11:01 2005 @@ -17,6 +17,7 @@ va_start(args, fmt); vfprintf(stderr, fmt, args); + fputc('\n', stderr); va_end(args); } @@ -27,6 +28,7 @@ va_start(args, form); vfprintf(stdout, form, args); + fputc('\n', stdout); va_end(args); } ----------------------- End of diff ----------------------- |
From: Toni G. <zo...@us...> - 2005-05-26 15:50:14
|
CVSROOT : /cvsroot/irc-dev Module : ircd-ircdev Commit time: 2005-05-26 15:50:06 UTC Modified files: TODO.es Log message: Actualizacion TODO ---------------------- diff included ---------------------- Index: ircd-ircdev/TODO.es diff -u ircd-ircdev/TODO.es:1.26 ircd-ircdev/TODO.es:1.27 --- ircd-ircdev/TODO.es:1.26 Thu May 26 05:45:57 2005 +++ ircd-ircdev/TODO.es Thu May 26 08:49:56 2005 @@ -1,7 +1,7 @@ # # TODO para ircd-ircdev # -# $Id: TODO.es,v 1.26 2005/05/26 12:45:57 zolty Exp $ +# $Id: TODO.es,v 1.27 2005/05/26 15:49:56 zolty Exp $ # # Insertar las nuevas entradas al principio de la lista TODO. # @@ -22,14 +22,14 @@ notices de auth y dnslookup al conectar. - [D] Virtualhost personalizado a traves de la DDB. - [D] U-lines a traves de la DDB. + - [D] Mejorar la inicializacion de las DDB con los eventos. PRIORIDAD MEDIA -------------------------------------------------------------------------------------- - [D] DDB: compactado. - [G] Caracter '~' en los nicks. - - [G] Los clientes con +k han de poder "hablar" en canales. - - [G] Mostrar tiempo en formato humano en las G-lines. + - [G] Mostrar tiempo en formato humano en las G-lines y Jupes. - [G] Enviar un Closing Link en los QUIT. - [G] Cuando nos silencian, que salga un numerico. - [G] Estudiar sobre la conveniencia de mandar privmsg globales al nick en vez de a @@ -100,6 +100,9 @@ 15/Mar/2005 - [G] Bajo en ciertas circunstancias desconocidas del ircd.conf no pueden entrar clientes al IRCD. Investigar eso. +26/May/2005 + - [D] Los cambios de modos en canal, a veces hay desyncs. Investigar el origen + - [D] Antes de un netjoin, un /mode #canal mostraba +r, despues ya no. Leyenda: [G] General ----------------------- End of diff ----------------------- |
From: Toni G. <zo...@us...> - 2005-05-26 12:46:18
|
CVSROOT : /cvsroot/irc-dev Module : ircd-ircdev Commit time: 2005-05-26 12:46:07 UTC Modified files: TODO.es Log message: Actualizacion TODO ---------------------- diff included ---------------------- Index: ircd-ircdev/TODO.es diff -u ircd-ircdev/TODO.es:1.25 ircd-ircdev/TODO.es:1.26 --- ircd-ircdev/TODO.es:1.25 Mon May 23 01:53:04 2005 +++ ircd-ircdev/TODO.es Thu May 26 05:45:57 2005 @@ -1,7 +1,7 @@ # # TODO para ircd-ircdev # -# $Id: TODO.es,v 1.25 2005/05/23 08:53:04 zolty Exp $ +# $Id: TODO.es,v 1.26 2005/05/26 12:45:57 zolty Exp $ # # Insertar las nuevas entradas al principio de la lista TODO. # @@ -63,6 +63,8 @@ - [G] Mirar el tema de control de Ilines por rangos, el tema es que con un /64 actualmente deja X clones para cada IP de ese rango, deberia haber alguna forma de que sea por rango. + - [D] Soporte de levels, mlock, topic, entrymsg de canales en la DDB. + - [G] Modo HalfOp (+h). [18:11:32] <Tor> quote opmode torcum #opers,#lala [18:11:38] <Tor> quote opmode #opers +nk lalala @@ -232,5 +234,4 @@ * Default: "ntCN" AUTOCHANMODES_LIST should contain the default channelmodes (e.g. -"ntCN") which will - be set by default on new channels. +"ntCN") which will be set by default on new channels. ----------------------- End of diff ----------------------- |
From: Toni G. <zo...@us...> - 2005-05-26 10:34:30
|
CVSROOT : /cvsroot/irc-dev Module : ircd-ircdev Commit time: 2005-05-26 10:34:23 UTC Modified files: ChangeLog ChangeLog.es include/patchlevel.h ircd/channel.c ircd/ddb_events.c ircd/m_burst.c ircd/m_kick.c ircd/m_mode.c Log message: Author: zoltan <zo...@ir...> Log message: 2005-05-26 Toni García <zo...@ir...> 1.0.alpha38 * Fix de bugs de la release anterior ---------------------- diff included ---------------------- Index: ircd-ircdev/ChangeLog diff -u ircd-ircdev/ChangeLog:1.39 ircd-ircdev/ChangeLog:1.40 --- ircd-ircdev/ChangeLog:1.39 Wed May 25 09:56:22 2005 +++ ircd-ircdev/ChangeLog Thu May 26 03:34:12 2005 @@ -1,10 +1,13 @@ # # ChangeLog for ircd-ircdev # -# $Id: ChangeLog,v 1.39 2005/05/25 16:56:22 zolty Exp $ +# $Id: ChangeLog,v 1.40 2005/05/26 10:34:12 zolty Exp $ # # Insert new changes at beginning of the change list. # +2005-05-26 Toni García <zo...@ir...> 1.0.alpha38 + * Fix bugs last release. + 2005-05-25 Toni García <zo...@ir...> 1.0.alpha37 * Registered channels (with mode +r) * Owner/founder mode (+q) Index: ircd-ircdev/ChangeLog.es diff -u ircd-ircdev/ChangeLog.es:1.39 ircd-ircdev/ChangeLog.es:1.40 --- ircd-ircdev/ChangeLog.es:1.39 Wed May 25 09:56:22 2005 +++ ircd-ircdev/ChangeLog.es Thu May 26 03:34:13 2005 @@ -1,10 +1,13 @@ # # Log de Cambios para ircd-ircdev # -# $Id: ChangeLog.es,v 1.39 2005/05/25 16:56:22 zolty Exp $ +# $Id: ChangeLog.es,v 1.40 2005/05/26 10:34:13 zolty Exp $ # # Insertar los nuevos cambios al principio de esta lista de cambios. # +2005-05-26 Toni García <zo...@ir...> 1.0.alpha38 + * Fix de bugs de la release anterior + 2005-05-25 Toni García <zo...@ir...> 1.0.alpha37 * Canales registrados (con modo +r) * Modo owner/founder (+q) Index: ircd-ircdev/include/patchlevel.h diff -u ircd-ircdev/include/patchlevel.h:1.38 ircd-ircdev/include/patchlevel.h:1.39 --- ircd-ircdev/include/patchlevel.h:1.38 Wed May 25 09:56:23 2005 +++ ircd-ircdev/include/patchlevel.h Thu May 26 03:34:13 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.38 2005/05/25 16:56:23 zolty Exp $ + * $Id: patchlevel.h,v 1.39 2005/05/26 10:34:13 zolty Exp $ * */ -#define PATCHLEVEL ".alpha37" +#define PATCHLEVEL ".alpha38" #define RELEASE "1.0" Index: ircd-ircdev/ircd/channel.c diff -u ircd-ircdev/ircd/channel.c:1.22 ircd-ircdev/ircd/channel.c:1.23 --- ircd-ircdev/ircd/channel.c:1.22 Wed May 25 09:56:24 2005 +++ ircd-ircdev/ircd/channel.c Thu May 26 03:34:13 2005 @@ -21,7 +21,7 @@ */ /** @file * @brief Channel management and maintanance - * @version $Id: channel.c,v 1.22 2005/05/25 16:56:24 zolty Exp $ + * @version $Id: channel.c,v 1.23 2005/05/26 10:34:13 zolty Exp $ */ #include "config.h" @@ -230,10 +230,10 @@ * * @param chptr The channel to subtract one from. * - * defined(UNDERNET) + * defined(UNDERNET) || defined(DDB) * @returns true (1) if channel still has members. * false (0) if the channel is now empty. - * !defined(UNDERNET) + * else * Returns: true (1) if channel still exists * false (0) if the channel was destroyed */ @@ -277,7 +277,7 @@ #elif defined(DDB) chptr->users = 0; - if (!chptr->mode.mode & MODE_REGCHAN) + if (!(chptr->mode.mode & MODE_REGCHAN)) destruct_channel(chptr); #else @@ -303,28 +303,6 @@ assert(0 == chptr->members); -#if 0 -/* FIXME-ZOLTAN BORRAR!! - * Esto es listado de canales de /list, si se borra... se borra - * del list pendiente, pero parece ser que no es necesario ¿? */ - /* Channel became (or was) empty: Remove channel */ - if (is_listed(chptr)) - { - int i; - for (i = 0; i <= HighestFd; i++) - { - struct Client *acptr = 0; - if ((acptr = LocalClientArray[i]) && cli_listing(acptr) && - (cli_listing(acptr))->chptr == chptr) - { - list_next_channels(acptr, 1); - break; /* Only one client can list a channel */ - } - } - } -*/ -#endif - /* * Now, find all invite links from channel structure */ Index: ircd-ircdev/ircd/ddb_events.c diff -u ircd-ircdev/ircd/ddb_events.c:1.5 ircd-ircdev/ircd/ddb_events.c:1.6 --- ircd-ircdev/ircd/ddb_events.c:1.5 Wed May 25 09:56:24 2005 +++ ircd-ircdev/ircd/ddb_events.c Thu May 26 03:34:13 2005 @@ -21,7 +21,7 @@ */ /** @file * @brief Events of Distributed DataBases. - * @version $Id: ddb_events.c,v 1.5 2005/05/25 16:56:24 zolty Exp $ + * @version $Id: ddb_events.c,v 1.6 2005/05/26 10:34:13 zolty Exp $ */ #include "config.h" @@ -78,9 +78,12 @@ { struct Channel *chptr; struct Client *founder; - char *botname = &me; - -// botname = ddb_get_botname(DDB_CHANSERV); + char *botname; + + if (ddb_count_table[DDB_CONFIGDB]) + botname = ddb_get_botname(DDB_CHANSERV); + else + botname = cli_name(&me); if (content) { Index: ircd-ircdev/ircd/m_burst.c diff -u ircd-ircdev/ircd/m_burst.c:1.10 ircd-ircdev/ircd/m_burst.c:1.11 --- ircd-ircdev/ircd/m_burst.c:1.10 Mon Apr 11 01:45:00 2005 +++ ircd-ircdev/ircd/m_burst.c Thu May 26 03:34:13 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: m_burst.c,v 1.10 2005/04/11 08:45:00 zolty Exp $ + * $Id: m_burst.c,v 1.11 2005/05/26 10:34:13 zolty Exp $ * */ @@ -125,7 +125,7 @@ case 'l': ++parv; break; - case 'r': + case 'R': result |= MODE_REGONLY; break; } @@ -263,6 +263,8 @@ && (!(check_modes & MODE_INVITEONLY) || IsAnOper(member->user)) #if defined(UNDERNET) && (!(check_modes & MODE_REGONLY) || IsAccount(member->user))) +#elif defined (DDB) || defined(SERVICES) + && (!(check_modes & MODE_REGONLY) || IsNickRegistered(member->user))) #else ) #endif @@ -479,7 +481,13 @@ #else for (current_mode = base_mode; *ptr; ptr++) { +#if defined(DDB) || defined(SERVICES) + if (*ptr == 'q') /* has owner status */ + current_mode = (current_mode & ~(CHFL_DEOPPED | CHFL_DELAYED)) | CHFL_OWNER; + else if (*ptr == 'o') /* has oper status */ +#else if (*ptr == 'o') /* has oper status */ +#endif current_mode = (current_mode & ~(CHFL_DEOPPED | CHFL_DELAYED)) | CHFL_CHANOP; else if (*ptr == 'v') /* has voice status */ current_mode = (current_mode & ~CHFL_DELAYED) | CHFL_VOICE; @@ -544,6 +552,10 @@ #else nickstr[nickpos++] = ':'; /* add a specifier */ +#if defined(DDB) || defined(SERVICES) + if (current_mode & CHFL_OWNER) + nickstr[nickpos++] = 'q'; +#endif if (current_mode & CHFL_CHANOP) nickstr[nickpos++] = 'o'; if (current_mode & CHFL_VOICE) @@ -580,6 +592,10 @@ /* first deal with channel members */ for (member = chptr->members; member; member = member->next_member) { if (member->status & CHFL_BURST_JOINED) { /* joined during burst */ +#if defined(DDB) || defined(SERVICES) + if (member->status & CHFL_OWNER) + modebuf_mode_client(mbuf, MODE_ADD | CHFL_OWNER, member->user); +#endif #if defined(UNDERNET) if ((member->status & CHFL_CHANOP) && !(member->status & CHFL_BURST_ALREADY_OPPED)) #else @@ -600,6 +616,8 @@ member->status = (member->status #if defined(UNDERNET) & ~(CHFL_CHANNEL_MANAGER | CHFL_CHANOP | CHFL_VOICE)) +#elif defined(DDB) || defined(SERVICES) + & ~(CHFL_OWNER | CHFL_CHANOP | CHFL_VOICE)) #else & ~(CHFL_CHANOP | CHFL_VOICE)) #endif Index: ircd-ircdev/ircd/m_kick.c diff -u ircd-ircdev/ircd/m_kick.c:1.9 ircd-ircdev/ircd/m_kick.c:1.10 --- ircd-ircdev/ircd/m_kick.c:1.9 Wed May 25 09:56:24 2005 +++ ircd-ircdev/ircd/m_kick.c Thu May 26 03:34:13 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_kick.c,v 1.9 2005/05/25 16:56:24 zolty Exp $ + * $Id: m_kick.c,v 1.10 2005/05/26 10:34:13 zolty Exp $ * */ @@ -124,7 +124,7 @@ #if defined(DDB) || defined(SERVICES) if (!(member2 = find_member_link(chptr, sptr)) || IsZombie(member2) - || !(IsChanOp(member2) || IsChanOwner(member2))) + || !(IsChanOwner(member2) || IsChanOp(member2))) #else if (!(member2 = find_member_link(chptr, sptr)) || IsZombie(member2) || !IsChanOp(member2)) @@ -227,8 +227,13 @@ * here), if kicker is not on channel, or if kicker is not a channel * operator, bounce the kick */ +#if defined(DDB) || defined(SERVICES) + if (!IsServer(sptr) && member && cli_from(who) != cptr && !IsService(cli_user(sptr)->server) && + (!(sptr_link = find_member_link(chptr, sptr)) || !(IsChanOwner(sptr_link) || IsChanOp(sptr_link)))) { +#else if (!IsServer(sptr) && member && cli_from(who) != cptr && (!(sptr_link = find_member_link(chptr, sptr)) || !IsChanOp(sptr_link))) { +#endif sendto_opmask_butone(0, SNO_HACK2, "HACK: %C KICK %H %C %s", sptr, chptr, who, comment); Index: ircd-ircdev/ircd/m_mode.c diff -u ircd-ircdev/ircd/m_mode.c:1.7 ircd-ircdev/ircd/m_mode.c:1.8 --- ircd-ircdev/ircd/m_mode.c:1.7 Wed May 25 09:56:24 2005 +++ ircd-ircdev/ircd/m_mode.c Thu May 26 03:34:13 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_mode.c,v 1.7 2005/05/25 16:56:24 zolty Exp $ + * $Id: m_mode.c,v 1.8 2005/05/26 10:34:13 zolty Exp $ * */ @@ -205,7 +205,16 @@ NULL); } else { #if defined(DDB) || defined(SERVICES) - if (!(member = find_member_link(chptr, sptr)) || !(IsChanOwner(member) + if (IsService(cli_user(sptr)->server)) { + modebuf_init(&mbuf, sptr, cptr, chptr, + (MODEBUF_DEST_CHANNEL | /* Send mode to clients */ + MODEBUF_DEST_SERVER)); /* Send mode to servers */ + mode_parse(&mbuf, cptr, sptr, chptr, parc - 2, parv + 2, + (MODE_PARSE_SET | /* Set the mode */ + MODE_PARSE_STRICT | /* Interpret it strictly */ + MODE_PARSE_FORCE), /* And force it to be accepted */ + NULL); + } else if (!(member = find_member_link(chptr, sptr)) || !(IsChanOwner(member) || IsChanOp(member))) { #else if (!(member = find_member_link(chptr, sptr)) || !IsChanOp(member)) { ----------------------- End of diff ----------------------- |
From: Toni G. <zo...@us...> - 2005-05-25 16:56:43
|
CVSROOT : /cvsroot/irc-dev Module : ircd-ircdev Commit time: 2005-05-25 16:56:35 UTC Modified files: ChangeLog ChangeLog.es include/channel.h include/ddb.h include/handlers.h include/msg.h include/patchlevel.h include/send.h include/supported.h ircd/Makefile.in ircd/channel.c ircd/ddb.c ircd/ddb_events.c ircd/hash.c ircd/m_join.c ircd/m_kick.c ircd/m_mode.c ircd/m_names.c ircd/m_whois.c ircd/parse.c ircd/s_user.c ircd/send.c ircd/whocmds.c Added files: ircd/m_bmode.c Log message: Author: zoltan <zo...@ir...> Log message: 2005-05-25 Toni García <zo...@ir...> 1.0.alpha37 * Canales registrados (con modo +r) * Modo owner/founder (+q) * Tabla c de Canales ---------------------- diff included ---------------------- Index: ircd-ircdev/ChangeLog diff -u ircd-ircdev/ChangeLog:1.38 ircd-ircdev/ChangeLog:1.39 --- ircd-ircdev/ChangeLog:1.38 Mon May 23 01:58:36 2005 +++ ircd-ircdev/ChangeLog Wed May 25 09:56:22 2005 @@ -1,10 +1,15 @@ # # ChangeLog for ircd-ircdev # -# $Id: ChangeLog,v 1.38 2005/05/23 08:58:36 zolty Exp $ +# $Id: ChangeLog,v 1.39 2005/05/25 16:56:22 zolty Exp $ # # Insert new changes at beginning of the change list. # +2005-05-25 Toni García <zo...@ir...> 1.0.alpha37 + * Registered channels (with mode +r) + * Owner/founder mode (+q) + * Channel table c + 2005-05-23 Toni García <zo...@ir...> 1.0.alpha36 * URGENT bugfixes Index: ircd-ircdev/ChangeLog.es diff -u ircd-ircdev/ChangeLog.es:1.38 ircd-ircdev/ChangeLog.es:1.39 --- ircd-ircdev/ChangeLog.es:1.38 Mon May 23 01:58:36 2005 +++ ircd-ircdev/ChangeLog.es Wed May 25 09:56:22 2005 @@ -1,10 +1,15 @@ # # Log de Cambios para ircd-ircdev # -# $Id: ChangeLog.es,v 1.38 2005/05/23 08:58:36 zolty Exp $ +# $Id: ChangeLog.es,v 1.39 2005/05/25 16:56:22 zolty Exp $ # # Insertar los nuevos cambios al principio de esta lista de cambios. # +2005-05-25 Toni García <zo...@ir...> 1.0.alpha37 + * Canales registrados (con modo +r) + * Modo owner/founder (+q) + * Tabla c de Canales + 2005-05-23 Toni García <zo...@ir...> 1.0.alpha36 * Arreglos URGENTES Index: ircd-ircdev/include/channel.h diff -u ircd-ircdev/include/channel.h:1.9 ircd-ircdev/include/channel.h:1.10 --- ircd-ircdev/include/channel.h:1.9 Wed Mar 9 10:12:32 2005 +++ ircd-ircdev/include/channel.h Wed May 25 09:56:23 2005 @@ -22,7 +22,7 @@ */ /** @file * @brief Channel management and maintenance. - * @version $Id: channel.h,v 1.9 2005/03/09 18:12:32 zolty Exp $ + * @version $Id: channel.h,v 1.10 2005/05/25 16:56:23 zolty Exp $ */ #ifndef INCLUDED_channel_h #define INCLUDED_channel_h @@ -91,9 +91,18 @@ */ #define CHFL_DELAYED 0x40000 /**< User's join message is delayed */ +#if defined(DDB) || defined(SERVICES) +#define CHFL_OWNER 0x10000 /**< Channel owner */ + +#define CHFL_OVERLAP (CHFL_OWNER | CHFL_CHANOP | CHFL_VOICE) +#define CHFL_BANVALIDMASK (CHFL_BANVALID | CHFL_BANNED) +#define CHFL_VOICED_OR_OPPED (CHFL_OWNER | CHFL_CHANOP | CHFL_VOICE) +#else + #define CHFL_OVERLAP (CHFL_CHANOP | CHFL_VOICE) #define CHFL_BANVALIDMASK (CHFL_BANVALID | CHFL_BANNED) #define CHFL_VOICED_OR_OPPED (CHFL_CHANOP | CHFL_VOICE) +#endif /* Channel Visibility macros */ @@ -108,8 +117,12 @@ #define MODE_KEY 0x0100 /**< +k Keyed */ #define MODE_BAN 0x0200 /**< +b Ban */ #define MODE_LIMIT 0x0400 /**< +l Limit */ -#define MODE_REGONLY 0x0800 /**< Only +r users may join */ +#define MODE_REGONLY 0x0800 /**< +R Only +r users may join */ #define MODE_DELJOINS 0x1000 /**< New join messages are delayed */ +#if defined(DDB) || defined(SERVICES) +#define MODE_REGCHAN 0x2000 /**< +r Channel registered */ +#define MODE_OWNER CHFL_OWNER /**< +q Channel owner */ +#endif #define MODE_SAVE 0x20000 /**< save this mode-with-arg 'til * later */ #define MODE_FREE 0x40000 /**< string needs to be passed to @@ -130,6 +143,15 @@ #define infochanmodes feature_bool(FEAT_OPLEVELS) ? "AbiklmnopstUvrD" : "biklmnopstvrD" /** Available Channel modes that take parameters */ #define infochanmodeswithparams feature_bool(FEAT_OPLEVELS) ? "AbkloUv" : "bklov" +#elif defined(DDB) || defined(SERVICES) +/** mode flags which take another parameter (With PARAmeterS) + */ +#define MODE_WPARAS (MODE_OWNER|MODE_CHANOP|MODE_VOICE|MODE_BAN|MODE_KEY|MODE_LIMIT) + +/** Available Channel modes */ +#define infochanmodes "biklmnopstvrRDq" +/** Available Channel modes that take parameters */ +#define infochanmodeswithparams "bklovq" #else /** mode flags which take another parameter (With PARAmeterS) */ @@ -225,24 +247,21 @@ struct Membership* next_channel; /**< Next channel this user is on */ struct Membership* prev_channel; /**< Previous channel this user is on*/ unsigned int status; /**< Flags for op'd, voice'd, etc */ -#if defined(UNDERNET) unsigned short oplevel; /**< Op level */ -#endif }; -#if defined(UNDERNET) #define MAXOPLEVELDIGITS 3 #define MAXOPLEVEL 999 -#endif #define IsZombie(x) ((x)->status & CHFL_ZOMBIE) /**< see \ref zombie */ #define IsDeopped(x) ((x)->status & CHFL_DEOPPED) #define IsBanned(x) ((x)->status & CHFL_BANNED) #define IsBanValid(x) ((x)->status & CHFL_BANVALID) +#if defined(DDB) || defined(SERVICES) +#define IsChanOwner(x) ((x)->status & CHFL_OWNER) +#endif #define IsChanOp(x) ((x)->status & CHFL_CHANOP) -#if defined(UNDERNET) #define OpLevel(x) ((x)->oplevel) -#endif #define HasVoice(x) ((x)->status & CHFL_VOICE) #define IsServOpOk(x) ((x)->status & CHFL_SERVOPOK) #define IsBurstJoined(x) ((x)->status & CHFL_BURST_JOINED) @@ -261,8 +280,11 @@ #define SetZombie(x) ((x)->status |= CHFL_ZOMBIE) #if defined(UNDERNET) #define SetChannelManager(x) ((x)->status |= CHFL_CHANNEL_MANAGER) -#define SetOpLevel(x, v) (void)((x)->oplevel = (v)) #endif +#if defined(DDB) || defined(SERVICES) +#define SetChanOwner(x) ((x)->status |= CHFL_OWNER) +#endif +#define SetOpLevel(x, v) (void)((x)->oplevel = (v)) #define SetUserParting(x) ((x)->status |= CHFL_USER_PARTING) #define SetDelayedJoin(x) ((x)->status |= CHFL_DELAYED) @@ -272,6 +294,9 @@ #define ClearServOpOk(x) ((x)->status &= ~CHFL_SERVOPOK) #define ClearBurstJoined(x) ((x)->status &= ~CHFL_BURST_JOINED) #define ClearDelayedJoin(x) ((x)->status &= ~CHFL_DELAYED) +#if defined(DDB) || defined(SERVICES) +#define ClearChanOwner(x) ((x)->status &= ~CHFL_OWNER) +#endif /** Mode information for a channel */ struct Mode { @@ -344,6 +369,9 @@ struct Client *mb_source; /**< Source of MODE changes */ struct Client *mb_connect; /**< Connection of MODE changes */ struct Channel *mb_channel; /**< Channel they affect */ +#if defined(DDB) + char *mb_botname; /**< Nick Bot of MODE changes */ +#endif unsigned int mb_dest; /**< Destination of MODE changes */ unsigned int mb_count; /**< Number of modes w/args */ struct { @@ -370,6 +398,9 @@ #define MODEBUF_DEST_HACK4 0x08000 /**< Send a HACK(4) notice, TS == 0 */ #define MODEBUF_DEST_NOKEY 0x10000 /**< Don't send the real key */ +#if defined(DDB) +#define MODEBUF_DEST_BOTMODE 0x20000 /**< Mode send by Bot */ +#endif #define MB_TYPE(mb, i) ((mb)->mb_modeargs[(i)].mbm_type) #define MB_UINT(mb, i) ((mb)->mb_modeargs[(i)].mbm_arg.mbma_uint) @@ -433,6 +464,9 @@ extern void remove_user_from_channel(struct Client *sptr, struct Channel *chptr); extern void remove_user_from_all_channels(struct Client* cptr); +#if defined(DDB) || defined(SERVICES) +extern int is_chan_owner(struct Client *cptr, struct Channel *chptr); +#endif extern int is_chan_op(struct Client *cptr, struct Channel *chptr); extern int is_zombie(struct Client *cptr, struct Channel *chptr); extern int has_voice(struct Client *cptr, struct Channel *chptr); Index: ircd-ircdev/include/ddb.h diff -u ircd-ircdev/include/ddb.h:1.8 ircd-ircdev/include/ddb.h:1.9 --- ircd-ircdev/include/ddb.h:1.8 Mon May 16 03:17:26 2005 +++ ircd-ircdev/include/ddb.h Wed May 25 09:56:23 2005 @@ -21,7 +21,7 @@ */ /** @file * @brief Distributed DataBases structures, macros and functions. - * @version $Id: ddb.h,v 1.8 2005/05/16 10:17:26 zolty Exp $ + * @version $Id: ddb.h,v 1.9 2005/05/25 16:56:23 zolty Exp $ */ #ifndef INCLUDED_ddb_h #define INCLUDED_ddb_h @@ -49,6 +49,8 @@ #define DDB_INIT 'a' /** Channels table of %DDB Distributed Databases. */ #define DDB_CHANDB 'c' +/** Channels table (nicks) of %DDB Distributed Databases. */ +#define DDB_CHANDB2 'd' /** Ilines table of %DDB Distributed Databases. */ #define DDB_ILINEDB 'i' /** Nicks table of %DDB Distributed Databases. */ @@ -73,6 +75,8 @@ */ /** Nickname of virtual bot for nicks registers */ #define DDB_NICKSERV "NickServ" +/** Nickname of virtual bot for channel bot */ +#define DDB_CHANSERV "ChanServ" /** Describes a key on one table. Index: ircd-ircdev/include/handlers.h diff -u ircd-ircdev/include/handlers.h:1.12 ircd-ircdev/include/handlers.h:1.13 --- ircd-ircdev/include/handlers.h:1.12 Sat Apr 2 11:47:34 2005 +++ ircd-ircdev/include/handlers.h Wed May 25 09:56:23 2005 @@ -21,7 +21,7 @@ */ /** @file * @brief Declarations for all protocol message handler functions. - * @version $Id: handlers.h,v 1.12 2005/04/02 19:47:34 zolty Exp $ + * @version $Id: handlers.h,v 1.13 2005/05/25 16:56:23 zolty Exp $ */ #ifndef INCLUDED_handlers_h #define INCLUDED_handlers_h @@ -198,6 +198,7 @@ extern int ms_admin(struct Client*, struct Client*, int, char*[]); extern int ms_asll(struct Client*, struct Client*, int, char*[]); extern int ms_away(struct Client*, struct Client*, int, char*[]); +extern int ms_bmode(struct Client*, struct Client*, int, char*[]); extern int ms_burst(struct Client*, struct Client*, int, char*[]); extern int ms_clearmode(struct Client*, struct Client*, int, char*[]); extern int ms_connect(struct Client*, struct Client*, int, char*[]); Index: ircd-ircdev/include/msg.h diff -u ircd-ircdev/include/msg.h:1.12 ircd-ircdev/include/msg.h:1.13 --- ircd-ircdev/include/msg.h:1.12 Sat Apr 2 11:47:34 2005 +++ ircd-ircdev/include/msg.h Wed May 25 09:56:23 2005 @@ -21,7 +21,7 @@ */ /** @file * @brief Command and token declarations and structures. - * @version $Id: msg.h,v 1.12 2005/04/02 19:47:34 zolty Exp $ + * @version $Id: msg.h,v 1.13 2005/05/25 16:56:23 zolty Exp $ */ #ifndef INCLUDED_msg_h #define INCLUDED_msg_h @@ -378,6 +378,10 @@ #define TOK_DBQ "DBQ" #define CMD_DBQ MSG_DBQ, TOK_DBQ +#define MSG_BMODE "BMODE" /* BMODE */ +#define TOK_BMODE "BM" +#define CMD_BMODE MSG_BMODE, TOK_BMODE + #define MSG_GHOST "GHOST" /* GHOST */ #define TOK_GHOST "GHOST" #define CMD_GHOST MSG_GHOST, TOK_GHOST Index: ircd-ircdev/include/patchlevel.h diff -u ircd-ircdev/include/patchlevel.h:1.37 ircd-ircdev/include/patchlevel.h:1.38 --- ircd-ircdev/include/patchlevel.h:1.37 Mon May 23 01:58:37 2005 +++ ircd-ircdev/include/patchlevel.h Wed May 25 09:56:23 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.37 2005/05/23 08:58:37 zolty Exp $ + * $Id: patchlevel.h,v 1.38 2005/05/25 16:56:23 zolty Exp $ * */ -#define PATCHLEVEL ".alpha36" +#define PATCHLEVEL ".alpha37" #define RELEASE "1.0" Index: ircd-ircdev/include/send.h diff -u ircd-ircdev/include/send.h:1.7 ircd-ircdev/include/send.h:1.8 --- ircd-ircdev/include/send.h:1.7 Thu Mar 31 04:58:03 2005 +++ ircd-ircdev/include/send.h Wed May 25 09:56:23 2005 @@ -21,7 +21,7 @@ */ /** @file send.h * @brief Send messages to certain targets. - * @version $Id: send.h,v 1.7 2005/03/31 12:58:03 zolty Exp $ + * @version $Id: send.h,v 1.8 2005/05/25 16:56:23 zolty Exp $ */ #ifndef INCLUDED_send_h #define INCLUDED_send_h @@ -56,10 +56,12 @@ */ extern void sendrawto_one(struct Client *to, const char *pattern, ...); +#if defined(DDB) /* Send a bot command to one client */ -extern void sendcmdbotto_one(char *botname, const char *cmd, +extern void sendcmdbotto_one(const char *botname, const char *cmd, const char *tok, struct Client *to, const char *pattern, ...); +#endif /* Send a command to one client */ extern void sendcmdto_one(struct Client *from, const char *cmd, @@ -89,6 +91,17 @@ struct Client *one, const char *pattern, ...); +#if defined(DDB) +/* Send bot command to all channel users on this server */ +extern void sendcmdbotto_channel_butserv_butone(const char *botmode, + const char *cmd, + const char *tok, + struct Channel *to, + struct Client *one, + unsigned int skip, + const char *pattern, ...); +#endif + /* Send command to all channel users on this server */ extern void sendcmdto_channel_butserv_butone(struct Client *from, const char *cmd, Index: ircd-ircdev/include/supported.h diff -u ircd-ircdev/include/supported.h:1.7 ircd-ircdev/include/supported.h:1.8 --- ircd-ircdev/include/supported.h:1.7 Mon Jan 10 04:22:00 2005 +++ ircd-ircdev/include/supported.h Wed May 25 09:56:23 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: supported.h,v 1.7 2005/01/10 12:22:00 zolty Exp $ + * $Id: supported.h,v 1.8 2005/05/25 16:56:23 zolty Exp $ * */ #ifndef INCLUDED_supported_h @@ -73,7 +73,11 @@ #define FEATURESVALUES1 AWAYLEN, CHANNELLEN, NICKLEN, feature_int(FEAT_NICKLEN), TOPICLEN -#define FEATURESVALUES2 "b,k,l,imnpstrD", feature_bool(FEAT_LOCAL_CHANNELS) ? "#&" : "#", "(ov)@+", "@+" +#if defined(DDB) || defined(SERVICES) +#define FEATURESVALUES2 "b,k,l,imnpstrRD", feature_bool(FEAT_LOCAL_CHANNELS) ? "#&" : "#", "(qov).@+", ".@+" +#else +#define FEATURESVALUES2 "b,k,l,imnpstRD", feature_bool(FEAT_LOCAL_CHANNELS) ? "#&" : "#", "(ov)@+", "@+" +#endif #define FEATURESVALUES3 feature_int(FEAT_MAXCHANNELSPERUSER), feature_int(FEAT_MAXBANS), \ MAXTARGETS, MAXMODEPARAMS, feature_int(FEAT_MAXSILES), \ Index: ircd-ircdev/ircd/Makefile.in diff -u ircd-ircdev/ircd/Makefile.in:1.26 ircd-ircdev/ircd/Makefile.in:1.27 --- ircd-ircdev/ircd/Makefile.in:1.26 Mon May 16 03:17:26 2005 +++ ircd-ircdev/ircd/Makefile.in Wed May 25 09:56:23 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: Makefile.in,v 1.26 2005/05/16 10:17:26 zolty Exp $ +# $Id: Makefile.in,v 1.27 2005/05/25 16:56:23 zolty Exp $ #### Start of system configuration section. #### @@ -95,6 +95,7 @@ ddb.c \ ddb_db_native.c \ ddb_events.c\ + m_bmode.c \ m_db.c \ m_dbq.c \ m_ghost.c \ Index: ircd-ircdev/ircd/channel.c diff -u ircd-ircdev/ircd/channel.c:1.21 ircd-ircdev/ircd/channel.c:1.22 --- ircd-ircdev/ircd/channel.c:1.21 Mon May 16 04:22:50 2005 +++ ircd-ircdev/ircd/channel.c Wed May 25 09:56:24 2005 @@ -21,12 +21,13 @@ */ /** @file * @brief Channel management and maintanance - * @version $Id: channel.c,v 1.21 2005/05/16 11:22:50 zolty Exp $ + * @version $Id: channel.c,v 1.22 2005/05/25 16:56:24 zolty Exp $ */ #include "config.h" #include "channel.h" #include "client.h" +#include "ddb.h" #include "destruct_event.h" #include "hash.h" #include "ircd.h" @@ -272,6 +273,13 @@ schedule_destruct_event_1m(chptr); /* Get rid of it in approximately 4-5 minutes */ else schedule_destruct_event_48h(chptr); /* Get rid of it in approximately 48 hours */ + +#elif defined(DDB) + chptr->users = 0; + + if (!chptr->mode.mode & MODE_REGCHAN) + destruct_channel(chptr); + #else destruct_channel(chptr); #endif @@ -296,7 +304,9 @@ assert(0 == chptr->members); #if 0 -/* FIXME-ZOLTAN BORRAR!! ¿? */ +/* FIXME-ZOLTAN BORRAR!! + * Esto es listado de canales de /list, si se borra... se borra + * del list pendiente, pero parece ser que no es necesario ¿? */ /* Channel became (or was) empty: Remove channel */ if (is_listed(chptr)) { @@ -471,9 +481,7 @@ member->user = who; member->channel = chptr; member->status = flags; -#if defined(UNDERNET) member->oplevel = oplevel; -#endif member->next_member = chptr->members; if (member->next_member) @@ -600,6 +608,26 @@ remove_user_from_channel(cptr, chan->channel); } +#if defined(DDB) || defined(SERVICES) +/** Check if this user is a legitimate chan owner + * + * @param cptr Client to check + * @param chptr Channel to check + * + * @returns True if the user is a chan owner (And not a zombie), False otherwise. + * @see \ref zombie + */ +int is_chan_owner(struct Client *cptr, struct Channel *chptr) +{ + struct Membership* member; + assert(chptr); + if ((member = find_member_link(chptr, cptr))) + return (!IsZombie(member) && IsChanOwner(member)); + + return 0; +} +#endif /* defined(DDB) || defined(SERVICES) */ + /** Check if this user is a legitimate chanop * * @param cptr Client to check @@ -697,7 +725,6 @@ if (member->channel->mode.mode & MODE_MODERATED) return 0; #if defined(UNDERNET) - /* TODO */ /* If only logged in users may join and you're not one, you can't speak. */ if (member->channel->mode.mode & MODE_REGONLY && !IsAccount(member->user)) return 0; @@ -822,8 +849,12 @@ *mbuf++ = 'i'; if (chptr->mode.mode & MODE_NOPRIVMSGS) *mbuf++ = 'n'; - if (chptr->mode.mode & MODE_REGONLY) +#if defined(DDB) || defined(SERVICES) + if (chptr->mode.mode & MODE_REGCHAN) *mbuf++ = 'r'; +#endif + if (chptr->mode.mode & MODE_REGONLY) + *mbuf++ = 'R'; if (chptr->mode.mode & MODE_DELJOINS) *mbuf++ = 'D'; else if (MyUser(cptr) && (chptr->mode.mode & MODE_WASDELJOINS)) @@ -868,7 +899,6 @@ *mbuf = '\0'; } -#if defined(UNDERNET) /** Compare two members oplevel * * @param mp1 Pointer to a pointer to a membership @@ -886,7 +916,6 @@ return 0; return (member1->oplevel < member2->oplevel) ? -1 : 1; } -#endif /* UNDERNET */ /* send "cptr" a full list of the modes for channel chptr. * @@ -898,8 +927,20 @@ void send_channel_modes(struct Client *cptr, struct Channel *chptr) { /* The order in which modes are generated is now mandatory */ +#if defined(DDB) || defined(SERVICES) + static unsigned int current_flags[8] = + { 0, + CHFL_VOICE, + CHFL_CHANOP, + CHFL_CHANOP | CHFL_VOICE, + CHFL_OWNER, + CHFL_OWNER | CHFL_VOICE, + CHFL_OWNER | CHFL_CHANOP, + CHFL_OWNER | CHFL_CHANOP | CHFL_VOICE }; +#else static unsigned int current_flags[4] = { 0, CHFL_VOICE, CHFL_CHANOP, CHFL_CHANOP | CHFL_VOICE }; +#endif int first = 1; int full = 1; int flag_cnt = 0; @@ -1077,7 +1118,11 @@ } /* loop over 0,+v,+o,+ov */ #else /* !UNDERNET */ - for (first = 1; flag_cnt < 4; +#if defined(DDB) || defined(SERVICES) + for (first = 1; flag_cnt < 8; +#else + for (first = 1; flag_cnt < 4; +#endif member = chptr->members, new_mode = 1, flag_cnt++) { for (; member; member = member->next_member) @@ -1087,7 +1132,7 @@ current_flags[flag_cnt]) continue; /* Skip members with different flags */ if (msgq_bufleft(mb) < NUMNICKLEN + 4) - /* The 4 is a possible ",:ov" */ + /* The 5 is a possible ",:qov" */ { full = 1; /* Make sure we continue after sending it so far */ @@ -1106,9 +1151,13 @@ { new_mode = 0; if (IsVoicedOrOpped(member)) { - char tbuf[4] = ":"; + char tbuf[5] = ":"; int loc = 1; +#if defined(DDB) || defined(SERVICES) + if (IsChanOwner(member)) + tbuf[loc++] = 'q'; +#endif if (IsChanOp(member)) tbuf[loc++] = 'o'; if (HasVoice(member)) @@ -1354,10 +1403,13 @@ if (chptr->mode.limit && chptr->users >= chptr->mode.limit) return overrideJoin + ERR_CHANNELISFULL; + if ((chptr->mode.mode & MODE_REGONLY) && #if defined(UNDERNET) - if ((chptr->mode.mode & MODE_REGONLY) && !IsAccount(sptr)) - return overrideJoin + ERR_NEEDREGGEDNICK; + !IsAccount(sptr)) +#elif defined(DDB) || defined(SERVICES) + !IsNickRegistered(sptr)) #endif + return overrideJoin + ERR_NEEDREGGEDNICK; if (find_ban(sptr, chptr->banlist)) return overrideJoin + ERR_BANNEDFROMCHAN; @@ -1422,7 +1474,11 @@ return NULL; len = strlen(chname); +#if defined(DDB) + if ((!cptr || MyUser(cptr)) && len > CHANNELLEN) +#else if (MyUser(cptr) && len > CHANNELLEN) +#endif { len = CHANNELLEN; *(chname + CHANNELLEN) = '\0'; @@ -1440,7 +1496,11 @@ GlobalChannelList->prev = chptr; chptr->prev = NULL; chptr->next = GlobalChannelList; +#if defined(DDB) + chptr->creationtime = (!cptr || MyUser(cptr)) ? TStime() : (time_t) 0; +#else chptr->creationtime = MyUser(cptr) ? TStime() : (time_t) 0; +#endif GlobalChannelList = chptr; hAddChannel(chptr); } @@ -1689,9 +1749,13 @@ MODE_TOPICLIMIT, 't', MODE_INVITEONLY, 'i', MODE_NOPRIVMSGS, 'n', - MODE_REGONLY, 'r', - MODE_DELJOINS, 'D', - MODE_WASDELJOINS, 'd', +#if defined(DDB) || defined(SERVICES) + MODE_REGCHAN, 'r', +/* MODE_OWNER, 'q', */ +#endif + MODE_REGONLY, 'R', + MODE_DELJOINS, 'D', + MODE_WASDELJOINS, 'd', /* MODE_KEY, 'k', */ /* MODE_BAN, 'b', */ MODE_LIMIT, 'l', @@ -1764,13 +1828,36 @@ bufptr_i = &rembuf_i; } +#if defined(DDB) || defined(SERVICES) + if (MB_TYPE(mbuf, i) & (MODE_OWNER | MODE_CHANOP | MODE_VOICE)) { +#else if (MB_TYPE(mbuf, i) & (MODE_CHANOP | MODE_VOICE)) { +#endif tmp = strlen(cli_name(MB_CLIENT(mbuf, i))); if ((totalbuflen - IRCD_MAX(5, tmp)) <= 0) /* don't overflow buffer */ MB_TYPE(mbuf, i) |= MODE_SAVE; /* save for later */ else { - bufptr[(*bufptr_i)++] = MB_TYPE(mbuf, i) & MODE_CHANOP ? 'o' : 'v'; + char mode_char = 0; +#if defined(DDB) || defined(SERVICES) + switch(MB_TYPE(mbuf, i) & (MODE_OWNER | MODE_CHANOP | MODE_VOICE)) +#else + switch(MB_TYPE(mbuf, i) & (MODE_CHANOP | MODE_VOICE)) +#endif + { +#if defined(DDB) || defined(SERVICES) + case MODE_OWNER: + mode_char = 'q'; + break; +#endif + case MODE_CHANOP: + mode_char = 'o'; + break; + case MODE_VOICE: + mode_char = 'v'; + break; + } + bufptr[(*bufptr_i)++] = mode_char; totalbuflen -= IRCD_MAX(5, tmp) + 1; } #if defined(UNDERNET) @@ -1855,7 +1942,11 @@ } /* deal with clients... */ +#if defined(DDB) || defined(SERVICES) + if (MB_TYPE(mbuf, i) & (MODE_OWNER | MODE_CHANOP | MODE_VOICE)) +#else if (MB_TYPE(mbuf, i) & (MODE_CHANOP | MODE_VOICE)) +#endif build_string(strptr, strptr_i, cli_name(MB_CLIENT(mbuf, i)), 0, ' '); /* deal with bans... */ @@ -1919,10 +2010,21 @@ addbuf_i ? "+" : "", addbuf, remstr, addstr); if (mbuf->mb_dest & MODEBUF_DEST_CHANNEL) - sendcmdto_channel_butserv_butone(app_source, CMD_MODE, mbuf->mb_channel, NULL, 0, - "%H %s%s%s%s%s%s", mbuf->mb_channel, - rembuf_i ? "-" : "", rembuf, - addbuf_i ? "+" : "", addbuf, remstr, addstr); + { +#if defined(DDB) + if (mbuf->mb_dest & MODEBUF_DEST_BOTMODE) + sendcmdbotto_channel_butserv_butone(ddb_get_botname(mbuf->mb_botname), + CMD_MODE, mbuf->mb_channel, NULL, 0, + "%H %s%s%s%s%s%s", mbuf->mb_channel, + rembuf_i ? "-" : "", rembuf, + addbuf_i ? "+" : "", addbuf, remstr, addstr); + else +#endif /* defined(DDB) */ + sendcmdto_channel_butserv_butone(app_source, CMD_MODE, mbuf->mb_channel, NULL, 0, + "%H %s%s%s%s%s%s", mbuf->mb_channel, + rembuf_i ? "-" : "", rembuf, + addbuf_i ? "+" : "", addbuf, remstr, addstr); + } } /* Now are we supposed to propagate to other servers? */ @@ -1952,7 +2054,11 @@ } /* deal with modes that take clients */ +#if defined(DDB) || defined(SERVICES) + if (MB_TYPE(mbuf, i) & (MODE_OWNER | MODE_CHANOP | MODE_VOICE)) +#else if (MB_TYPE(mbuf, i) & (MODE_CHANOP | MODE_VOICE)) +#endif build_string(strptr, strptr_i, NumNick(MB_CLIENT(mbuf, i)), ' '); /* deal with modes that take strings */ @@ -1998,6 +2104,15 @@ mbuf->mb_channel, addbuf_i ? "-" : "", addbuf, rembuf_i ? "+" : "", rembuf, addstr, remstr, mbuf->mb_channel->creationtime); +#if defined(DDB) + } else if (mbuf->mb_dest & MODEBUF_DEST_BOTMODE) { + sendcmdto_serv_butone(mbuf->mb_source, CMD_BMODE, mbuf->mb_connect, + "%s %H %s%s%s%s%s%s %Tu", mbuf->mb_botname, mbuf->mb_channel, + rembuf_i ? "-" : "", rembuf, addbuf_i ? "+" : "", + addbuf, remstr, addstr, + (mbuf->mb_dest & MODEBUF_DEST_HACK4) ? 0 : + mbuf->mb_channel->creationtime); +#endif /* defined(DDB) */ } else { /* * We're propagating a normal MODE command to the rest of the network; @@ -2075,6 +2190,9 @@ mbuf->mb_source = source; mbuf->mb_connect = connect; mbuf->mb_channel = chan; +#if defined(DDB) + mbuf->mb_botname = 0; +#endif mbuf->mb_dest = dest; mbuf->mb_count = 0; @@ -2100,6 +2218,9 @@ mode &= (MODE_ADD | MODE_DEL | MODE_PRIVATE | MODE_SECRET | MODE_MODERATED | MODE_TOPICLIMIT | MODE_INVITEONLY | MODE_NOPRIVMSGS | MODE_REGONLY | +#if defined(DDB) || defined(SERVICES) +/* MODE_REGCHAN | */ +#endif MODE_DELJOINS | MODE_WASDELJOINS); if (!(mode & ~(MODE_ADD | MODE_DEL))) /* don't add empty modes... */ @@ -2245,8 +2366,12 @@ #endif /* MODE_BAN, 'b', */ MODE_LIMIT, 'l', - MODE_REGONLY, 'r', - MODE_DELJOINS, 'D', +#if defined(DDB) || defined(SERVICES) + MODE_REGCHAN, 'r', +/* MODE_OWNER, 'q', */ +#endif + MODE_REGONLY, 'R', + MODE_DELJOINS, 'D', 0x0, 0x0 }; unsigned int add; @@ -3205,12 +3330,20 @@ if (IsDelayedJoin(member)) RevealDelayedJoin(member); member->status |= (state->cli_change[i].flag & +#if defined(DDB) || defined(SERVICES) + (MODE_OWNER |MODE_CHANOP | MODE_VOICE)); +#else (MODE_CHANOP | MODE_VOICE)); +#endif if (state->cli_change[i].flag & MODE_CHANOP) ClearDeopped(member); } else member->status &= ~(state->cli_change[i].flag & +#if defined(DDB) || defined(SERVICES) + (MODE_OWNER | MODE_CHANOP | MODE_VOICE)); +#else (MODE_CHANOP | MODE_VOICE)); +#endif } /* accumulate the change */ @@ -3285,8 +3418,12 @@ #endif MODE_BAN, 'b', MODE_LIMIT, 'l', - MODE_REGONLY, 'r', - MODE_DELJOINS, 'D', +#if defined(DDB) || defined(SERVICES) + MODE_OWNER, 'q', + MODE_REGCHAN, 'r', +#endif + MODE_REGONLY, 'R', + MODE_DELJOINS, 'D', MODE_ADD, '+', MODE_DEL, '-', 0x0, 0x0 @@ -3373,6 +3510,21 @@ mode_parse_ban(&state, flag_p); break; +#if defined(DDB) || defined(SERVICES) +# if defined(DDB) + case 'r': + break; +# endif + case 'q': + if (!IsServer(cptr) || (state.dir == MODE_ADD && + !(mbuf->mb_dest & MODEBUF_DEST_BOTMODE))) + /* state.flags |= MODE_PARSE_NOTADD; */ + break; + + mode_parse_client(&state, flag_p); + break; +#endif + case 'o': /* deal with ops/voice */ case 'v': mode_parse_client(&state, flag_p); @@ -3570,6 +3722,11 @@ sendcmdto_serv_butone(jbuf->jb_source, CMD_JOIN, jbuf->jb_connect, "%u:%H %Tu", oplevel, chan, chan->creationtime); else +#elif defined(DDB) + if (flags & CHFL_OWNER) + sendcmdto_serv_butone(jbuf->jb_source, CMD_JOIN, jbuf->jb_connect, + "0:%H %Tu", chan, chan->creationtime); + else #endif sendcmdto_serv_butone(jbuf->jb_source, CMD_JOIN, jbuf->jb_connect, "%H %Tu", chan, chan->creationtime); @@ -3585,6 +3742,17 @@ sendcmdto_channel_butserv_butone((chan->mode.apass[0] ? &me : jbuf->jb_source), CMD_MODE, chan, NULL, 0, "%H +o %C", chan, jbuf->jb_source); +#elif defined(DDB) + if (flags & CHFL_OWNER) + { + char *botname = ddb_get_botname(DDB_CHANSERV); + + sendcmdbotto_channel_butserv_butone(botname, CMD_MODE, chan, NULL, 0, + "%H +q %C", chan, jbuf->jb_source); + } + else if (flags & CHFL_CHANOP) + sendcmdto_channel_butserv_butone(&me, CMD_MODE, chan, NULL, 0, "%H +o %C", + chan, jbuf->jb_source); #else if (flags & CHFL_CHANOP) sendcmdto_channel_butserv_butone(&me, CMD_MODE, chan, NULL, 0, "%H +o %C", Index: ircd-ircdev/ircd/ddb.c diff -u ircd-ircdev/ircd/ddb.c:1.9 ircd-ircdev/ircd/ddb.c:1.10 --- ircd-ircdev/ircd/ddb.c:1.9 Mon May 16 03:17:26 2005 +++ ircd-ircdev/ircd/ddb.c Wed May 25 09:56:24 2005 @@ -22,7 +22,7 @@ */ /** @file * @brief Implementation of Distributed DataBase. - * @version $Id: ddb.c,v 1.9 2005/05/16 10:17:26 zolty Exp $ + * @version $Id: ddb.c,v 1.10 2005/05/25 16:56:24 zolty Exp $ */ #include "config.h" @@ -202,6 +202,8 @@ * The lengths MUST be powers of 2 and do not have * to be superior to HASHSIZE. */ + ddb_resident_table[DDB_CHANDB] = 4096; + ddb_resident_table[DDB_CHANDB2] = 32768; ddb_resident_table[DDB_ILINEDB] = 256; ddb_resident_table[DDB_NICKDB] = 32768; ddb_resident_table[DDB_CONFIGDB] = 256; @@ -687,7 +689,7 @@ { struct Ddb *ddb; - ddb = ddb_find_key(DDB_CONFIGDB, DDB_NICKSERV); + ddb = ddb_find_key(DDB_CONFIGDB, bot); if (ddb) return ddb_content(ddb); else Index: ircd-ircdev/ircd/ddb_events.c diff -u ircd-ircdev/ircd/ddb_events.c:1.4 ircd-ircdev/ircd/ddb_events.c:1.5 --- ircd-ircdev/ircd/ddb_events.c:1.4 Mon May 16 03:17:27 2005 +++ ircd-ircdev/ircd/ddb_events.c Wed May 25 09:56:24 2005 @@ -21,11 +21,12 @@ */ /** @file * @brief Events of Distributed DataBases. - * @version $Id: ddb_events.c,v 1.4 2005/05/16 10:17:27 zolty Exp $ + * @version $Id: ddb_events.c,v 1.5 2005/05/25 16:56:24 zolty Exp $ */ #include "config.h" #include "ddb.h" +#include "channel.h" #include "client.h" #include "hash.h" #include "ircd.h" @@ -44,6 +45,8 @@ /** Events table engine */ ddb_events_table_td ddb_events_table[DDB_TABLE_MAX]; +static void ddb_events_table_c(char *key, char *content, int update); +static void ddb_events_table_d(char *key, char *content, int update); static void ddb_events_table_n(char *key, char *content, int update); static void ddb_events_table_z(char *key, char *content, int update); @@ -56,6 +59,8 @@ if (events_init) return; + ddb_events_table[DDB_CHANDB] = ddb_events_table_c; + ddb_events_table[DDB_CHANDB2] = ddb_events_table_d; ddb_events_table[DDB_ILINEDB] = 0; ddb_events_table[DDB_NICKDB] = ddb_events_table_n; ddb_events_table[DDB_CONFIGDB] = ddb_events_table_z; @@ -63,6 +68,159 @@ events_init = 1; } +/** Handle events on Channel Table. + * @param[in] key Key of registry. + * @param[in] content Content of registry. + * @param[in] update Update of registry or no. + */ +static void +ddb_events_table_c(char *key, char *content, int update) +{ + struct Channel *chptr; + struct Client *founder; + char *botname = &me; + +// botname = ddb_get_botname(DDB_CHANSERV); + + if (content) + { + /* Nuevos o cambios de registro */ + /* Si no existe el canal lo creamos */ + chptr = get_channel(NULL, key, CGT_CREATE); + + /* Ponemos modo +r */ + if (!(chptr->mode.mode & MODE_REGCHAN)) + { + chptr->mode.mode |= MODE_REGCHAN; + if (chptr->users) + sendcmdbotto_channel_butserv_butone(botname, CMD_MODE, chptr, + NULL, 0, "%H +r", chptr); + } + + if (chptr->users) + { + struct Membership *member; + + /* Solo si el nuevo founder es nuestro usuario */ + founder = FindUser(content); + if (founder && MyUser(founder)) + { + if (update) + { + /* Si hay una actualizacion, borramos el antiguo */ + for (member = chptr->members; member; member = member->next_member) + { + if (IsChanOwner(member)) + { + ClearChanOwner(member); + sendcmdbotto_channel_butserv_butone(botname, CMD_MODE, + member->channel, NULL, 0, "%H -q %C", + member->channel, member->user); + sendcmdto_serv_butone(&me, CMD_BMODE, NULL, "%s %H -q %C", + DDB_CHANSERV, member->channel, member->user); + break; + } + } + } + member = find_member_link(chptr, founder); + if (member) + { + SetChanOwner(member); + sendcmdbotto_channel_butserv_butone(botname, CMD_MODE, + member->channel, NULL, 0, "%H +q %C", + member->channel, member->user); + sendcmdto_serv_butone(&me, CMD_BMODE, NULL, "%s %H +q %C", + DDB_CHANSERV, member->channel, member->user); + } + } + else if (!founder) + { + for (member = chptr->members; member; member = member->next_member) + { + if (IsChanOwner(member)) + { + ClearChanOwner(member); + if (MyUser(member->user)) + { + sendcmdbotto_channel_butserv_butone(botname, CMD_MODE, + member->channel, NULL, 0, "%H -q %C", + member->channel, member->user); + sendcmdto_serv_butone(&me, CMD_BMODE, NULL, "%s %H -q %C", + DDB_CHANSERV, member->channel, member->user); + } + break; + } + } + } + } + } + else + { + /* Canal dropado */ + chptr = get_channel(NULL, key, CGT_NO_CREATE); + + /* Borramos el canal */ + if (chptr && ((chptr->mode.mode) & MODE_REGCHAN)) + { + chptr->mode.mode &= ~MODE_REGCHAN; + if (chptr->users) + { + struct Membership *member; + + /* Quitar -q */ + for (member = chptr->members; member; member = member->next_member) + { + if (IsChanOwner(member)) + { + ClearChanOwner(member); + if (MyUser(member->user)) + { + sendcmdbotto_channel_butserv_butone(botname, CMD_MODE, + member->channel, NULL, 0, "%H -q %C", + member->channel, member->user); + sendcmdto_serv_butone(&me, CMD_BMODE, NULL, "%s %H -q %C", + DDB_CHANSERV, member->channel, member->user); + } + break; + } + } + + /* quitar -r */ + sendcmdbotto_channel_butserv_butone(botname, CMD_MODE, chptr, + NULL, 0, "%H -r", chptr); + } + else + sub1_from_channel(chptr); + } + } +} + +/** Handle events on Channel Table 2. + * @param[in] key Key of registry. + * @param[in] content Content of registry. + * @param[in] update Update of registry or no. + */ +static void +ddb_events_table_d(char *key, char *content, int update) +{ +#if 0 + char *channel; + char *nick; + + strcpy(channel, key); + nick = strchr(channel, ':'); + if (nick) + *nick++ = '\0'; + + Debug((DEBUG_INFO, "DDB: channel: %s nick: %s", channel, nick ? nick : "NONE")); + + if (content && nick) + + else if (!content && nick) + +#endif +} + /** Handle events on Nick Table. * @param[in] key Key of registry. * @param[in] content Content of registry. Index: ircd-ircdev/ircd/hash.c diff -u ircd-ircdev/ircd/hash.c:1.9 ircd-ircdev/ircd/hash.c:1.10 --- ircd-ircdev/ircd/hash.c:1.9 Sat Apr 2 11:47:35 2005 +++ ircd-ircdev/ircd/hash.c Wed May 25 09:56:24 2005 @@ -22,7 +22,7 @@ */ /** @file * @brief Hash table management. - * @version $Id: hash.c,v 1.9 2005/04/02 19:47:35 zolty Exp $ + * @version $Id: hash.c,v 1.10 2005/05/25 16:56:24 zolty Exp $ * * This file used to use some very complicated hash function. Now it * uses CRC-32, but effectively remaps each input byte according to a @@ -508,7 +508,7 @@ /* Send all the matching channels in the bucket. */ for (chptr = channelTable[args->bucket]; chptr; chptr = chptr->hnext) { - if (chptr->users > args->min_users + if (chptr->users >= args->min_users && chptr->users < args->max_users && chptr->creationtime > args->min_time && chptr->creationtime < args->max_time Index: ircd-ircdev/ircd/m_bmode.c diff -u /dev/null ircd-ircdev/ircd/m_bmode.c:1.1 --- /dev/null Wed May 25 09:56:36 2005 +++ ircd-ircdev/ircd/m_bmode.c Wed May 25 09:56:24 2005 @@ -0,0 +1,80 @@ +/* + * IRC-Dev IRCD - An advanced and innovative IRC Daemon, ircd/m_bmode.c + * + * Copyright (C) 2002-2005 IRC-Dev Development Team <de...@ir...> + * Copyright (C) 2004-2005 Toni García (zoltan) zo...@ir...> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ +/** @file + * @brief Handlers for BMODE command (Bot Mode). + * @version $Id: m_bmode.c,v 1.1 2005/05/25 16:56:24 zolty Exp $ + */ + +#include "config.h" + +#include "channel.h" +#include "client.h" +#include "hash.h" +#include "ircd.h" +#include "ircd_reply.h" + +#include <stdlib.h> + +/** Handle a BMODE message from another server. + * + * \a parv[1] is a name of virtual bot. + * \a parv[2] is a channel. + * \a parv[3] is a modes. + * \a parv[4..n] is a parameters. + * + * See @ref m_functions for discussion of the arguments. + * @param[in] cptr Client that sent us the message. + * @param[in] sptr Original source of message. + * @param[in] parc Number of arguments. + * @param[in] parv Argument vector. + */ +int +ms_bmode(struct Client *cptr, struct Client *sptr, int parc, char *parv[]) +{ + struct Channel *chptr; + struct ModeBuf mbuf; + + if (parc < 4) + return need_more_params(sptr, "BMODE"); + + if (!(chptr = FindChannel(parv[2]))) + return protocol_violation(sptr, "Attemped to set BMODE on inexistant channel (%s)", parv[2]); + + if (IsLocalChannel(chptr->chname)) + return protocol_violation(sptr, "Attemped to set BMODE on local channel"); + + ClrFlag(sptr, FLAG_TS8); + + modebuf_init(&mbuf, sptr, cptr, chptr, + (MODEBUF_DEST_CHANNEL | /* Send mode to clients */ + MODEBUF_DEST_SERVER | /* Send mode to servers */ + MODEBUF_DEST_BOTMODE)); /* Botmode */ + + mbuf.mb_botname = parv[1]; + + mode_parse(&mbuf, cptr, sptr, chptr, parc - 3, parv + 3, + (MODE_PARSE_SET | /* Set the mode */ + MODE_PARSE_STRICT | /* Interpret it strictly */ + MODE_PARSE_FORCE), /* And force it to be accepted */ + NULL); + return modebuf_flush(&mbuf); +} Index: ircd-ircdev/ircd/m_join.c diff -u ircd-ircdev/ircd/m_join.c:1.11 ircd-ircdev/ircd/m_join.c:1.12 --- ircd-ircdev/ircd/m_join.c:1.11 Sat May 7 15:23:40 2005 +++ ircd-ircdev/ircd/m_join.c Wed May 25 09:56:24 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_join.c,v 1.11 2005/05/07 22:23:40 zolty Exp $ + * $Id: m_join.c,v 1.12 2005/05/25 16:56:24 zolty Exp $ * */ @@ -82,6 +82,7 @@ #include "channel.h" #include "client.h" +#include "ddb.h" #include "gline.h" #include "hash.h" #include "ircd.h" @@ -258,11 +259,25 @@ flags |= CHFL_CHANOP; } } +#elif defined(DDB) + struct Ddb *ddb; + int is_owner = 0; + + ddb = ddb_find_key(DDB_CHANDB, chptr->chname); + if ((ddb) && !ircd_strcmp(ddb_content(ddb), cli_name(sptr))) + { + is_owner = 1; + flags &= ~CHFL_DEOPPED; + flags |= CHFL_OWNER; + } #endif + if (check_target_limit(sptr, chptr, chptr->chname, 0)) continue; /* exceeded target limit */ #if defined(UNDERNET) else if (!is_level0_op && (i = can_join(sptr, chptr, keys))) { +#elif defined(DDB) + else if (!is_owner && (i = can_join(sptr, chptr, keys))) { #else else if ((i = can_join(sptr, chptr, keys))) { #endif @@ -285,7 +300,7 @@ break; case ERR_NEEDREGGEDNICK: - i = 'r'; + i = 'R'; break; default: @@ -382,10 +397,14 @@ if (join0(&join, cptr, sptr, name)) /* did client do a JOIN 0? */ continue; -#if defined(UNDERNET) +#if defined(UNDERNET) || defined(DDB) if (name[0] == '0' && name[1] == ':') { +# if defined(UNDERNET) flags = CHFL_CHANOP | CHFL_CHANNEL_MANAGER; +# else + flags = CHFL_OWNER; +# endif name += 2; } else if (name[0] == '1' && name[1] == ':') @@ -394,8 +413,8 @@ name += 2; } else - flags = CHFL_DEOPPED; #endif + flags = CHFL_DEOPPED; if (IsLocalChannel(name) || !IsChannelName(name)) { Index: ircd-ircdev/ircd/m_kick.c diff -u ircd-ircdev/ircd/m_kick.c:1.8 ircd-ircdev/ircd/m_kick.c:1.9 --- ircd-ircdev/ircd/m_kick.c:1.8 Fri Apr 22 09:22:13 2005 +++ ircd-ircdev/ircd/m_kick.c Wed May 25 09:56:24 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_kick.c,v 1.8 2005/04/22 16:22:13 zolty Exp $ + * $Id: m_kick.c,v 1.9 2005/05/25 16:56:24 zolty Exp $ * */ @@ -122,8 +122,13 @@ if (!(chptr = get_channel(sptr, name, CGT_NO_CREATE))) return send_reply(sptr, ERR_NOSUCHCHANNEL, name); +#if defined(DDB) || defined(SERVICES) + if (!(member2 = find_member_link(chptr, sptr)) || IsZombie(member2) + || !(IsChanOp(member2) || IsChanOwner(member2))) +#else if (!(member2 = find_member_link(chptr, sptr)) || IsZombie(member2) || !IsChanOp(member2)) +#endif return send_reply(sptr, ERR_CHANOPRIVSNEEDED, name); if (!(who = find_chasing(sptr, parv[2], 0))) @@ -147,8 +152,13 @@ return send_reply(sptr, ERR_NOTLOWEROPLEVEL, cli_name(who), chptr->chname, OpLevel(member2), OpLevel(member), "kick", OpLevel(member) == OpLevel(member2) ? "the same" : "a higher"); +#elif defined(DDB) || defined(SERVICES) + /* Don't allow to kick channel owner */ + if (IsChanOwner(member) && !IsOper(sptr)) + return send_reply(sptr, ERR_ISCHANSERVICE, cli_name(who), chptr->chname); #endif + /* We rely on ircd_snprintf to truncate the comment */ comment = EmptyString(parv[parc - 1]) ? parv[0] : parv[parc - 1]; Index: ircd-ircdev/ircd/m_mode.c diff -u ircd-ircdev/ircd/m_mode.c:1.6 ircd-ircdev/ircd/m_mode.c:1.7 --- ircd-ircdev/ircd/m_mode.c:1.6 Mon Jan 10 04:23:02 2005 +++ ircd-ircdev/ircd/m_mode.c Wed May 25 09:56:24 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_mode.c,v 1.6 2005/01/10 12:23:02 zolty Exp $ + * $Id: m_mode.c,v 1.7 2005/05/25 16:56:24 zolty Exp $ * */ @@ -131,7 +131,11 @@ return 0; } +#if defined(DDB) || defined(SERVICES) + if (!member || !(IsChanOwner(member) || IsChanOp(member))) { +#else if (!member || !IsChanOp(member)) { +#endif if (IsLocalChannel(chptr->chname) && HasPriv(sptr, PRIV_MODE_LCHAN)) { modebuf_init(&mbuf, sptr, cptr, chptr, (MODEBUF_DEST_CHANNEL | /* Send mode to channel */ @@ -200,7 +204,12 @@ MODE_PARSE_FORCE), /* And force it to be accepted */ NULL); } else { +#if defined(DDB) || defined(SERVICES) + if (!(member = find_member_link(chptr, sptr)) || !(IsChanOwner(member) + || IsChanOp(member))) { +#else if (!(member = find_member_link(chptr, sptr)) || !IsChanOp(member)) { +#endif modebuf_init(&mbuf, sptr, cptr, chptr, (MODEBUF_DEST_SERVER | /* Send mode to server */ MODEBUF_DEST_HACK2 | /* Send a HACK(2) message */ Index: ircd-ircdev/ircd/m_names.c diff -u ircd-ircdev/ircd/m_names.c:1.8 ircd-ircdev/ircd/m_names.c:1.9 --- ircd-ircdev/ircd/m_names.c:1.8 Mon Mar 21 10:39:08 2005 +++ ircd-ircdev/ircd/m_names.c Wed May 25 09:56:24 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_names.c,v 1.8 2005/03/21 18:39:08 zolty Exp $ + * $Id: m_names.c,v 1.9 2005/05/25 16:56:24 zolty Exp $ * */ @@ -171,18 +171,22 @@ strcat(buf, "!"); idx++; } - else +#if defined(DDB) || defined(SERVICES) + else if (IsChanOwner(member)) { - if (IsChanOp(member)) - { - strcat(buf, "@"); - idx++; - } - if (HasVoice(member)) - { - strcat(buf, "+"); - idx++; - } + strcat(buf, "."); + idx++; + } +#endif + else if (IsChanOp(member)) + { + strcat(buf, "@"); + idx++; + } + else if (HasVoice(member)) + { + strcat(buf, "+"); + idx++; } strcat(buf, cli_name(c2ptr)); idx += strlen(cli_name(c2ptr)); Index: ircd-ircdev/ircd/m_whois.c diff -u ircd-ircdev/ircd/m_whois.c:1.13 ircd-ircdev/ircd/m_whois.c:1.14 --- ircd-ircdev/ircd/m_whois.c:1.13 Thu Mar 31 04:58:04 2005 +++ ircd-ircdev/ircd/m_whois.c Wed May 25 09:56:24 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_whois.c,v 1.13 2005/03/31 12:58:04 zolty Exp $ + * $Id: m_whois.c,v 1.14 2005/05/25 16:56:24 zolty Exp $ */ /* @@ -177,15 +177,16 @@ *(buf + len++) = '*'; if (IsDelayedJoin(chan) && (sptr != acptr)) *(buf + len++) = '<'; +#if defined(DDB) || defined(SERVICES) + else if (IsChanOwner(chan)) + *(buf + len++) = '.'; +#endif + else if (IsChanOp(chan)) + *(buf + len++) = '@'; + else if (HasVoice(chan)) + *(buf + len++) = '+'; else if (IsZombie(chan)) *(buf + len++) = '!'; - else - { - if (IsChanOp(chan)) - *(buf + len++) = '@'; - if (HasVoice(chan)) - *(buf + len++) = '+'; - } if (len) *(buf + len) = '\0'; strcpy(buf + len, chptr->chname); Index: ircd-ircdev/ircd/parse.c diff -u ircd-ircdev/ircd/parse.c:1.15 ircd-ircdev/ircd/parse.c:1.16 --- ircd-ircdev/ircd/parse.c:1.15 Sat Apr 2 11:47:35 2005 +++ ircd-ircdev/ircd/parse.c Wed May 25 09:56:24 2005 @@ -21,7 +21,7 @@ */ /** @file * @brief Parse input from IRC clients and other servers. - * @version $Id: parse.c,v 1.15 2005/04/02 19:47:35 zolty Exp $ + * @version $Id: parse.c,v 1.16 2005/05/25 16:56:24 zolty Exp $ */ #include "config.h" @@ -657,6 +657,13 @@ { m_unregistered, m_not_oper, ms_dbq, mo_dbq, m_ignore } }, { + MSG_BMODE, + TOK_BMODE, + 0, MAXPARA, MFLG_SLOW, 0, NULL, + /* UNREG, CLIENT, SERVER, OPER, SERVICE */ + { m_ignore, m_ignore, ms_bmode, m_ignore, m_ignore } + }, + { MSG_GHOST, TOK_GHOST, 0, MAXPARA, MFLG_SLOW, 0, NULL, Index: ircd-ircdev/ircd/s_user.c diff -u ircd-ircdev/ircd/s_user.c:1.19 ircd-ircdev/ircd/s_user.c:1.20 --- ircd-ircdev/ircd/s_user.c:1.19 Mon May 23 01:58:37 2005 +++ ircd-ircdev/ircd/s_user.c Wed May 25 09:56:24 2005 @@ -21,7 +21,7 @@ */ /** @file * @brief Miscellaneous user-related helper functions. - * @version $Id: s_user.c,v 1.19 2005/05/23 08:58:37 zolty Exp $ + * @version $Id: s_user.c,v 1.20 2005/05/25 16:56:24 zolty Exp $ */ #include "config.h" @@ -1001,6 +1001,10 @@ { const char* channel_name; struct Membership *member; +#if defined(DDB) + char *botname2; +#endif + if ((channel_name = find_no_nickchange_channel(sptr)) && !IsRenamed(flags)) { return send_reply(cptr, ERR_BANNICKCHANGE, channel_name); } @@ -1030,9 +1034,27 @@ cli_nextnick(cptr) = CurrentTime; } /* Invalidate all bans against the user so we check them again */ +#if defined(DDB) + botname2 = ddb_get_botname(DDB_CHANSERV); +#endif + for (member = (cli_user(cptr))->channel; member; member = member->next_channel) + { ClearBanValid(member); +#if defined(DDB) + if (MyUser(member->user) && IsChanOwner(member)) + { + ClearChanOwner(member); + + sendcmdbotto_channel_butserv_butone(botname2, CMD_MODE, + member->channel, NULL, 0, "%H -q %C", + member->channel, member->user); + sendcmdto_serv_butone(&me, CMD_BMODE, NULL, "%s %H -q %C", + DDB_CHANSERV, member->channel, member->user); + } +#endif + } } #if defined(DDB) Index: ircd-ircdev/ircd/send.c diff -u ircd-ircdev/ircd/send.c:1.7 ircd-ircdev/ircd/send.c:1.8 --- ircd-ircdev/ircd/send.c:1.7 Thu Mar 31 04:58:04 2005 +++ ircd-ircdev/ircd/send.c Wed May 25 09:56:25 2005 @@ -21,7 +21,7 @@ */ /** @file * @brief Send messages to certain targets. - * @version $Id: send.c,v 1.7 2005/03/31 12:58:04 zolty Exp $ + * @version $Id: send.c,v 1.8 2005/05/25 16:56:25 zolty Exp $ */ #include "config.h" @@ -308,6 +308,7 @@ msgq_clean(mb); } +#if defined(DDB) /** Send a bot command to a single client. * @param[in] botname Bot sending the command. * @param[in] cmd Long name of command (used if \a to is a user). @@ -315,7 +316,7 @@ * @param[in] to Destination of command. * @param[in] pattern Format string for command arguments. */ -void sendcmdbotto_one(char *botname, const char *cmd, const char *tok, +void sendcmdbotto_one(const char *botname, const char *cmd, const char *tok, struct Client *to, const char *pattern, ...) { struct VarData vd; @@ -335,6 +336,7 @@ msgq_clean(mb); } +#endif /* defined(DDB) */ /** Send a (prefixed) command to a single client. * @param[in] from Client sending the command. @@ -542,6 +544,48 @@ msgq_clean(mb); } +#if defined(DDB) +/** Send a bot command to all local users on a channel. + * @param[in] botname Bot sending the command. + * @param[in] cmd Long name of command. + * @param[in] tok Short name of command (ignored). + * @param[in] to Destination channel. + * @param[in] one Client direction to skip (or NULL). + * @param[in] skip Bitmask of SKIP_DEAF, SKIP_NONOPS, SKIP_NONVOICES indicating which clients to skip. + * @param[in] pattern Format string for command arguments. + */ +void sendcmdbotto_channel_butserv_butone(const char *botname, const char *cmd, + const char *tok, struct Channel *to, + struct Client *one, unsigned int skip, + const char *pattern, ...) +{ + struct VarData vd; + struct MsgBuf *mb; + struct Membership *member; + + vd.vd_format = pattern; /* set up the struct VarData for %v */ + va_start(vd.vd_args, pattern); + + /* build the buffer */ + mb = msgq_make(0, ":%s %s %v", botname, cmd, &vd); + va_end(vd.vd_args); + + /* send the buffer to each local channel member */ + for (member = to->members; member; member = member->next_member) { + if (!MyConnect(member->user) + || member->user == one + || IsZombie(member) + || (skip & SKIP_DEAF && IsDeaf(member->user)) + || (skip & SKIP_NONOPS && !IsChanOp(member)) + || (skip & SKIP_NONVOICES && !IsChanOp(member) && !HasVoice(member))) + continue; + send_buffer(member->user, mb, 0); + } + + msgq_clean(mb); +} +#endif /* defined(DDB) */ + /** Send a (prefixed) command to all local users on a channel. * @param[in] from Client originating the command. * @param[in] cmd Long name of command. Index: ircd-ircdev/ircd/whocmds.c diff -u ircd-ircdev/ircd/whocmds.c:1.8 ircd-ircdev/ircd/whocmds.c:1.9 --- ircd-ircdev/ircd/whocmds.c:1.8 Thu Mar 31 04:58:04 2005 +++ ircd-ircdev/ircd/whocmds.c Wed May 25 09:56:25 2005 @@ -21,7 +21,7 @@ */ /** @file * @brief Support functions for /WHO-like commands. - * @version $Id: whocmds.c,v 1.8 2005/03/31 12:58:04 zolty Exp $ + * @version $Id: whocmds.c,v 1.9 2005/05/25 16:56:25 zolty Exp $ */ #include "config.h" @@ -169,6 +169,10 @@ * multiple channel status flags, as this is currently the only * way to know if someone has @'s *and* is +'d. */ +#if defined(DDB) || defined(SERVICES) + if (chptr && is_chan_owner(acptr, chptr)) + *(p1++) = '.'; +#endif if (chptr && is_chan_op(acptr, chptr)) *(p1++) = '@'; if (chptr && has_voice(acptr, chptr)) @@ -177,7 +181,17 @@ *(p1++) = '!'; } else { - if (chptr && is_zombie(acptr, chptr)) +#if defined(DDB) || defined(SERVICES) + if (chptr && is_chan_owner(acptr, chptr)) + *(p1++) = '.'; + else if (chptr && is_chan_op(acptr, chptr)) +#else + if (chptr && is_chan_op(acptr, chptr)) +#endif + *(p1++) = '@'; + else if (chptr && has_voice(acptr, chptr)) + *(p1++) = '+'; + else if (chptr && is_zombie(acptr, chptr)) *(p1++) = '!'; else { ----------------------- End of diff ----------------------- |
From: Toni G. <zo...@us...> - 2005-05-23 08:59:10
|
CVSROOT : /cvsroot/irc-dev Module : ircd-ircdev Commit time: 2005-05-23 08:58:47 UTC Modified files: ChangeLog ChangeLog.es include/patchlevel.h ircd/s_conf.c ircd/s_serv.c ircd/s_user.c Log message: Author: zoltan <zo...@ir...> Log message: 2005-05-23 Toni García <zo...@ir...> 1.0.alpha36 * Arreglos URGENTES ---------------------- diff included ---------------------- Index: ircd-ircdev/ChangeLog diff -u ircd-ircdev/ChangeLog:1.37 ircd-ircdev/ChangeLog:1.38 --- ircd-ircdev/ChangeLog:1.37 Mon May 16 04:31:19 2005 +++ ircd-ircdev/ChangeLog Mon May 23 01:58:36 2005 @@ -1,10 +1,13 @@ # # ChangeLog for ircd-ircdev # -# $Id: ChangeLog,v 1.37 2005/05/16 11:31:19 zolty Exp $ +# $Id: ChangeLog,v 1.38 2005/05/23 08:58:36 zolty Exp $ # # Insert new changes at beginning of the change list. # +2005-05-23 Toni García <zo...@ir...> 1.0.alpha36 + * URGENT bugfixes + 2005-05-16 Toni García <zo...@ir...> 1.0.alpha35 * Testing tools Index: ircd-ircdev/ChangeLog.es diff -u ircd-ircdev/ChangeLog.es:1.37 ircd-ircdev/ChangeLog.es:1.38 --- ircd-ircdev/ChangeLog.es:1.37 Mon May 16 04:31:19 2005 +++ ircd-ircdev/ChangeLog.es Mon May 23 01:58:36 2005 @@ -1,10 +1,13 @@ # # Log de Cambios para ircd-ircdev # -# $Id: ChangeLog.es,v 1.37 2005/05/16 11:31:19 zolty Exp $ +# $Id: ChangeLog.es,v 1.38 2005/05/23 08:58:36 zolty Exp $ # # Insertar los nuevos cambios al principio de esta lista de cambios. # +2005-05-23 Toni García <zo...@ir...> 1.0.alpha36 + * Arreglos URGENTES + 2005-05-16 Toni García <zo...@ir...> 1.0.alpha35 * Utilidades de Testing Index: ircd-ircdev/include/patchlevel.h diff -u ircd-ircdev/include/patchlevel.h:1.36 ircd-ircdev/include/patchlevel.h:1.37 --- ircd-ircdev/include/patchlevel.h:1.36 Mon May 16 04:31:20 2005 +++ ircd-ircdev/include/patchlevel.h Mon May 23 01:58:37 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.36 2005/05/16 11:31:20 zolty Exp $ + * $Id: patchlevel.h,v 1.37 2005/05/23 08:58:37 zolty Exp $ * */ -#define PATCHLEVEL ".alpha35" +#define PATCHLEVEL ".alpha36" #define RELEASE "1.0" Index: ircd-ircdev/ircd/s_conf.c diff -u ircd-ircdev/ircd/s_conf.c:1.16 ircd-ircdev/ircd/s_conf.c:1.17 --- ircd-ircdev/ircd/s_conf.c:1.16 Mon May 16 03:17:27 2005 +++ ircd-ircdev/ircd/s_conf.c Mon May 23 01:58:37 2005 @@ -21,7 +21,7 @@ */ /** @file * @brief ircd configuration file driver - * @version $Id: s_conf.c,v 1.16 2005/05/16 10:17:27 zolty Exp $ + * @version $Id: s_conf.c,v 1.17 2005/05/23 08:58:37 zolty Exp $ */ #include "config.h" @@ -1118,6 +1118,7 @@ * added a check against the user's IP address to find_gline() -Kev */ send_reply(cptr, SND_EXPLICIT | ERR_YOUREBANNEDCREEP, ":%s.", GlineReason(agline)); + return -2; } return 0; Index: ircd-ircdev/ircd/s_serv.c diff -u ircd-ircdev/ircd/s_serv.c:1.11 ircd-ircdev/ircd/s_serv.c:1.12 --- ircd-ircdev/ircd/s_serv.c:1.11 Mon May 16 03:17:27 2005 +++ ircd-ircdev/ircd/s_serv.c Mon May 23 01:58:37 2005 @@ -21,7 +21,7 @@ */ /** @file * @brief Miscellaneous server support functions. - * @version $Id: s_serv.c,v 1.11 2005/05/16 10:17:27 zolty Exp $ + * @version $Id: s_serv.c,v 1.12 2005/05/23 08:58:37 zolty Exp $ */ #include "config.h" @@ -140,9 +140,6 @@ feature_bool(FEAT_HUB) ? "h" : "", *(cli_info(&me)) ? cli_info(&me) : "IRCers United"); -#if defined(DDB) - /* ddb_burst(cptr); */ -#endif /* * Don't charge this IP# for connecting * XXX - if this comes from a server port, it will not have been added Index: ircd-ircdev/ircd/s_user.c diff -u ircd-ircdev/ircd/s_user.c:1.18 ircd-ircdev/ircd/s_user.c:1.19 --- ircd-ircdev/ircd/s_user.c:1.18 Mon May 16 03:17:27 2005 +++ ircd-ircdev/ircd/s_user.c Mon May 23 01:58:37 2005 @@ -21,7 +21,7 @@ */ /** @file * @brief Miscellaneous user-related helper functions. - * @version $Id: s_user.c,v 1.18 2005/05/16 10:17:27 zolty Exp $ + * @version $Id: s_user.c,v 1.19 2005/05/23 08:58:37 zolty Exp $ */ #include "config.h" @@ -822,8 +822,9 @@ * Esta comprobacion solo se va a hacer si * el usuario es local y no esta haciendo nick flood. */ - if (MyConnect(cptr) && !IsIdentify(flags) && (ddb = ddb_find_key(DDB_NICKDB, (char *)nick)) - && (CurrentTime >= cli_nextnick(cptr))) + if (!IsServer(cptr) && MyConnect(cptr) && !IsIdentify(flags) + && (ddb = ddb_find_key(DDB_NICKDB, (char *)nick)) + && (CurrentTime >= cli_nextnick(sptr))) { const char *name; int nick_forbid = 0; @@ -996,11 +997,11 @@ * if client is on any channels where it is currently * banned. If so, do not allow the nick change to occur. */ - if (MyUser(sptr) && !IsRenamed(flags)) + if (MyUser(sptr)) { const char* channel_name; struct Membership *member; - if ((channel_name = find_no_nickchange_channel(sptr))) { + if ((channel_name = find_no_nickchange_channel(sptr)) && !IsRenamed(flags)) { return send_reply(cptr, ERR_BANNICKCHANGE, channel_name); } /* @@ -1011,7 +1012,7 @@ * however, allow to do two nick changes immediately after another * before limiting the nick flood. -Run */ - if (CurrentTime < cli_nextnick(cptr)) + if ((CurrentTime < cli_nextnick(cptr)) && !IsRenamed(flags)) { cli_nextnick(cptr) += 2; send_reply(cptr, ERR_NICKTOOFAST, parv[1], ----------------------- End of diff ----------------------- |
From: Toni G. <zo...@us...> - 2005-05-23 08:53:21
|
CVSROOT : /cvsroot/irc-dev Module : ircd-ircdev Commit time: 2005-05-23 08:53:14 UTC Modified files: TODO.es Log message: actualizacion ---------------------- diff included ---------------------- Index: ircd-ircdev/TODO.es diff -u ircd-ircdev/TODO.es:1.24 ircd-ircdev/TODO.es:1.25 --- ircd-ircdev/TODO.es:1.24 Mon May 16 03:18:57 2005 +++ ircd-ircdev/TODO.es Mon May 23 01:53:04 2005 @@ -1,7 +1,7 @@ # # TODO para ircd-ircdev # -# $Id: TODO.es,v 1.24 2005/05/16 10:18:57 zolty Exp $ +# $Id: TODO.es,v 1.25 2005/05/23 08:53:04 zolty Exp $ # # Insertar las nuevas entradas al principio de la lista TODO. # @@ -41,7 +41,6 @@ - [S] Comando SVSVHOST para cambiar la virtualhost. Estudiar alguna forma de propagarse en el burst. - [S] Comando /IDENTIFY y autentificacion NICK nick clave. - - [S] Comprobar el comando OPMODE haga lo que hacia el SAMODE de Terraircu. PRIORIDAD BAJA ----------------------- End of diff ----------------------- |
From: Toni G. <zo...@us...> - 2005-05-17 02:12:20
|
CVSROOT : /cvsroot/irc-dev Module : ircd-ircdev Commit time: 2005-05-16 10:19:07 UTC Modified files: TODO.es Log message: Actualizacion TODO ---------------------- diff included ---------------------- Index: ircd-ircdev/TODO.es diff -u ircd-ircdev/TODO.es:1.23 ircd-ircdev/TODO.es:1.24 --- ircd-ircdev/TODO.es:1.23 Sat May 7 05:44:36 2005 +++ ircd-ircdev/TODO.es Mon May 16 03:18:57 2005 @@ -1,14 +1,13 @@ # # TODO para ircd-ircdev # -# $Id: TODO.es,v 1.23 2005/05/07 12:44:36 zolty Exp $ +# $Id: TODO.es,v 1.24 2005/05/16 10:18:57 zolty Exp $ # # Insertar las nuevas entradas al principio de la lista TODO. # URGENTE -------------------------------------------------------------------------------------- - - [D] DDB: compactado, hashes, seguridad y documentacion. - [D] Implementar tabla o de Operadores - [D] Implementar tabla p de Privilegios - [D] Implementar tabla f de Features @@ -27,6 +26,7 @@ PRIORIDAD MEDIA -------------------------------------------------------------------------------------- + - [D] DDB: compactado. - [G] Caracter '~' en los nicks. - [G] Los clientes con +k han de poder "hablar" en canales. - [G] Mostrar tiempo en formato humano en las G-lines. @@ -71,8 +71,7 @@ DOCUMENTACION PENDIENTE -------------------------------------------------------------------------------------- - - [G] Documentar para Doxygen el Watch y el DDB - - [G] Traducir comentarios DDB al ingles + - [G] Documentar para Doxygen el Watch - [G] Documentar en el RELEASE.NOTES lo relacionado con DDB y Services. - [G] Traducir el archivo Authors. - [G] Traducir el archivo chroot.txt @@ -100,10 +99,6 @@ 15/Mar/2005 - [G] Bajo en ciertas circunstancias desconocidas del ircd.conf no pueden entrar clientes al IRCD. Investigar eso. -31/Mar/2005 - - [D] No se propaga el modo cuando estamos autentificando al conectar. -20/Abr/2005 - - [D] A veces un nick forbid puede tener +r. Leyenda: [G] General ----------------------- End of diff ----------------------- |
From: Toni G. <zo...@us...> - 2005-05-17 00:59:02
|
CVSROOT : /cvsroot/irc-dev Module : ircd-ircdev Commit time: 2005-05-16 11:23:00 UTC Modified files: ChangeLog ChangeLog.es configure configure.in include/patchlevel.h ircd/channel.c ircd/ircd.c ircd/ircd_crypt_native.c ircd/ircd_parser.y ircd/m_trace.c ircd/motd.c ircd/msgq.c ircd/numnicks.c ircd/os_generic.c ircd/s_stats.c ircd/umkpasswd.c ircd/test/ircd_in_addr_t.c Log message: Author: zoltan <zo...@ir...> Log message: 2005-05-16 Toni García <zo...@ir...> 1.0.alpha34 * Sincronización Undernet ---------------------- diff included ---------------------- Index: ircd-ircdev/ChangeLog diff -u ircd-ircdev/ChangeLog:1.35 ircd-ircdev/ChangeLog:1.36 --- ircd-ircdev/ChangeLog:1.35 Mon May 16 03:17:26 2005 +++ ircd-ircdev/ChangeLog Mon May 16 04:22:48 2005 @@ -1,10 +1,13 @@ # # ChangeLog for ircd-ircdev # -# $Id: ChangeLog,v 1.35 2005/05/16 10:17:26 zolty Exp $ +# $Id: ChangeLog,v 1.36 2005/05/16 11:22:48 zolty Exp $ # # Insert new changes at beginning of the change list. # +2005-05-16 Toni García <zo...@ir...> 1.0.alpha34 + * Undernet synchronization + 2005-05-16 Toni García <zo...@ir...> 1.0.alpha33 * Fix bugs * Doxygen documentation Index: ircd-ircdev/ChangeLog.es diff -u ircd-ircdev/ChangeLog.es:1.35 ircd-ircdev/ChangeLog.es:1.36 --- ircd-ircdev/ChangeLog.es:1.35 Mon May 16 03:17:26 2005 +++ ircd-ircdev/ChangeLog.es Mon May 16 04:22:48 2005 @@ -1,10 +1,13 @@ # # Log de Cambios para ircd-ircdev # -# $Id: ChangeLog.es,v 1.35 2005/05/16 10:17:26 zolty Exp $ +# $Id: ChangeLog.es,v 1.36 2005/05/16 11:22:48 zolty Exp $ # # Insertar los nuevos cambios al principio de esta lista de cambios. # +2005-05-16 Toni García <zo...@ir...> 1.0.alpha34 + * Sincronización Undernet + 2005-05-16 Toni García <zo...@ir...> 1.0.alpha33 * Fix de bugs * Documentación Doxygen Index: ircd-ircdev/configure diff -u ircd-ircdev/configure:1.17 ircd-ircdev/configure:1.18 --- ircd-ircdev/configure:1.17 Fri Apr 22 09:51:16 2005 +++ ircd-ircdev/configure Mon May 16 04:22:48 2005 @@ -849,8 +849,7 @@ it is a system call --enable-debug Turn on debugging mode --disable-asserts Disable assertion checking - --disable-symbols Disable debugging symbols (remove -g from CFLAGS) - --enable-profile Enable profiling support (add -pg to CFLAGS) + --enable-profile Enable profiling support (add -pg to CFLAGS and LDFLAGS) --enable-pedantic Enable pedantic warnings (add -pedantic to CFLAGS) --enable-warnings Enable warnings (add -Wall to CFLAGS) --disable-inlines Disable inlining for a few critical functions @@ -861,8 +860,6 @@ Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-optimization=-O2 Explicitly set the compiler optimization flags - (default: -O3) --with-leak-detect Turn on the leak detector(requires patched boehm) --without-ipv6 disable IPv6 support (default is autodetect) --with-symlink=name Name to give the symlink; if name is "no," no @@ -982,7 +979,7 @@ else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi - cd "$ac_popdir" + cd $ac_popdir done fi @@ -2000,7 +1997,8 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -2058,7 +2056,8 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -2174,7 +2173,8 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -2228,7 +2228,8 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -2273,7 +2274,8 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -2317,7 +2319,8 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -2431,7 +2434,8 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -2468,61 +2472,6 @@ esac -# Check whether --with-optimization or --without-optimization was given. -if test "${with_optimization+set}" = set; then - withval="$with_optimization" - unet_cv_optimization=$withval -else - unet_cv_optimization='-O3' -fi; -echo "$as_me:$LINENO: checking optimization level" >&5 -echo $ECHO_N "checking optimization level... $ECHO_C" >&6 -if test "${unet_cv_optimization+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - unet_cv_optimization='-O3' -fi -echo "$as_me:$LINENO: result: $unet_cv_optimization" >&5 -echo "${ECHO_T}$unet_cv_optimization" >&6 -if test "x$unet_cv_optimization" = "xno" ; then - unet_cv_optimization="" -fi -if test x"$CFLAGS" != x; then - CFLAGS=`echo "$CFLAGS" | sed -e s/-O2/$unet_cv_optimization/` -fi -if test x"$CFLAGS" != x; then - unet_old_cflags=$CFLAGS - CFLAGS=`echo "$CFLAGS" | sed -e 's/-g//g'` -fi -if test x"$CFLAGS" != x"$unet_old_cflags"; then - # If -g was already there, force symbols to be enabled - unet_cv_enable_symbols=yes -fi -if test x"$CFLAGS" != x; then - unet_old_cflags=$CFLAGS - CFLAGS=`echo "$CFLAGS" | sed -e 's/-pg//g'` -fi -if test x"$CFLAGS" != x"$unet_old_cflags"; then - # If -pg was already there, force profiling to be enabled - unet_cv_enable_profile=yes -fi -if test x"$CFLAGS" != x; then - unet_old_cflags=$CFLAGS - CFLAGS=`echo "$CFLAGS" | sed -e 's/-Wall//g'` -fi -if test x"$CFLAGS" != x"$unet_old_cflags"; then - # If -Wall was already there, force warnings to be enabled - unet_cv_enable_warnings=yes -fi -if test x"$CFLAGS" != x; then - unet_old_cflags=$CFLAGS - CFLAGS=`echo "$CFLAGS" | sed -e 's/-pedantic//g'` -fi -if test x"$CFLAGS" != x"$unet_old_cflags"; then - # If -pedantic was already there, force pedatic to be enabled - unet_cv_enable_pedantic=yes -fi - echo "$as_me:$LINENO: checking for library containing crypt" >&5 echo $ECHO_N "checking for library containing crypt... $ECHO_C" >&6 @@ -2562,7 +2511,8 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -2616,7 +2566,8 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -2721,7 +2672,8 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -2788,7 +2740,8 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -2861,7 +2814,8 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -2935,7 +2889,8 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -3002,7 +2957,8 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -3112,7 +3068,8 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -3178,7 +3135,8 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -3249,7 +3207,8 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -3567,7 +3526,8 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -3737,7 +3697,8 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -3813,7 +3774,8 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -3964,7 +3926,8 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4006,7 +3969,8 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4063,7 +4027,8 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4188,7 +4153,8 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4254,7 +4220,8 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4316,7 +4283,8 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4417,7 +4385,8 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4479,7 +4448,8 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4519,7 +4489,8 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4575,7 +4546,8 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4615,7 +4587,8 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4679,7 +4652,8 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4710,8 +4684,10 @@ esac else if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: internal error: not reached in cross-compile" >&5 -echo "$as_me: error: internal error: not reached in cross-compile" >&2;} + { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run test program while cross compiling +See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF @@ -4823,7 +4799,8 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4885,7 +4862,8 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4925,7 +4903,8 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4981,7 +4960,8 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5021,7 +5001,8 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5085,7 +5066,8 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5116,8 +5098,10 @@ esac else if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: internal error: not reached in cross-compile" >&5 -echo "$as_me: error: internal error: not reached in cross-compile" >&2;} + { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run test program while cross compiling +See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF @@ -5229,7 +5213,8 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5291,7 +5276,8 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5331,7 +5317,8 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5387,7 +5374,8 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5427,7 +5415,8 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5491,7 +5480,8 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5522,8 +5512,10 @@ esac else if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: internal error: not reached in cross-compile" >&5 -echo "$as_me: error: internal error: not reached in cross-compile" >&2;} + { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run test program while cross compiling +See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF @@ -5635,7 +5627,8 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5697,7 +5690,8 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5737,7 +5731,8 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5793,7 +5788,8 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5833,7 +5829,8 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5897,7 +5894,8 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5928,8 +5926,10 @@ esac else if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: internal error: not reached in cross-compile" >&5 -echo "$as_me: error: internal error: not reached in cross-compile" >&2;} + { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run test program while cross compiling +See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF @@ -6041,7 +6041,8 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -6103,7 +6104,8 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -6143,7 +6145,8 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -6199,7 +6202,8 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -6239,7 +6243,8 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -6303,7 +6308,8 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -6334,8 +6340,10 @@ esac else if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: internal error: not reached in cross-compile" >&5 -echo "$as_me: error: internal error: not reached in cross-compile" >&2;} + { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run test program while cross compiling +See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF @@ -6447,7 +6455,8 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -6509,7 +6518,8 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -6549,7 +6559,8 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -6605,7 +6616,8 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -6645,7 +6657,8 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -6709,7 +6722,8 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -6740,8 +6754,10 @@ esac else if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: internal error: not reached in cross-compile" >&5 -echo "$as_me: error: internal error: not reached in cross-compile" >&2;} + { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run test program while cross compiling +See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF @@ -6854,7 +6870,8 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -6919,7 +6936,8 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -6985,7 +7003,8 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -7050,7 +7069,8 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -7121,7 +7141,8 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -7186,7 +7207,8 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -7252,7 +7274,8 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -7317,7 +7340,8 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -7383,7 +7407,8 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -7448,7 +7473,8 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -7519,7 +7545,8 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -7575,7 +7602,8 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -7632,7 +7660,8 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -7697,7 +7726,8 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -7767,7 +7797,8 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -7834,7 +7865,8 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -7936,7 +7968,8 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -8008,7 +8041,8 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -8073,7 +8107,8 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -8619,7 +8654,8 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -8685,7 +8721,8 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -8774,7 +8811,8 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -9071,7 +9109,8 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -9371,27 +9410,6 @@ fi -echo "$as_me:$LINENO: checking whether to enable debugging symbols" >&5 -echo $ECHO_N "checking whether to enable debugging symbols... $ECHO_C" >&6 -# Check whether --enable-symbols or --disable-symbols was given. -if test "${enable_symbols+set}" = set; then - enableval="$enable_symbols" - unet_cv_enable_symbols=$enable_symbols -else - if test "${unet_cv_enable_symbols+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - unet_cv_enable_symbols=yes -fi - -fi; -echo "$as_me:$LINENO: result: $unet_cv_enable_symbols" >&5 -echo "${ECHO_T}$unet_cv_enable_symbols" >&6 - -if test x"$unet_cv_enable_symbols" = xyes; then - CFLAGS="-g $CFLAGS" -fi - echo "$as_me:$LINENO: checking whether to enable profiling support (gprof)" >&5 echo $ECHO_N "checking whether to enable profiling support (gprof)... $ECHO_C" >&6 # Check whether --enable-profile or --disable-profile was given. @@ -9411,6 +9429,7 @@ if test x"$unet_cv_enable_profile" = xyes; then CFLAGS="-pg $CFLAGS" + LDFLAGS="-pg $LDFLAGS" fi echo "$as_me:$LINENO: checking whether to enable pedantic compiler warnings" >&5 @@ -9591,7 +9610,8 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -9656,7 +9676,8 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -9718,7 +9739,8 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -11071,6 +11093,11 @@ *) ac_INSTALL=$ac_top_builddir$INSTALL ;; esac + if test x"$ac_file" != x-; then + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + rm -f "$ac_file" + fi # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ @@ -11109,12 +11136,6 @@ fi;; esac done` || { (exit 1); exit 1; } - - if test x"$ac_file" != x-; then - { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - rm -f "$ac_file" - fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub Index: ircd-ircdev/configure.in diff -u ircd-ircdev/configure.in:1.16 ircd-ircdev/configure.in:1.17 --- ircd-ircdev/configure.in:1.16 Fri Apr 22 09:22:12 2005 +++ ircd-ircdev/configure.in Mon May 16 04:22:49 2005 @@ -22,7 +22,7 @@ dnl along with this program; if not, write to the Free Software dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA dnl -dnl $Id: configure.in,v 1.16 2005/04/22 16:22:12 zolty Exp $ +dnl $Id: configure.in,v 1.17 2005/05/16 11:22:49 zolty Exp $ dnl dnl Make sure we are in the correct directory (someone could have run @@ -57,54 +57,6 @@ dnl ANSIfy the C compiler whenever possible. AM_PROG_CC_STDC -dnl Allow specification of optimization level. -AC_ARG_WITH([optimization], - AS_HELP_STRING([--with-optimization=[-O2]], [Explicitly set the compiler optimization flags (default: -O3)]), - [unet_cv_optimization=$withval], - [unet_cv_optimization='-O3']) -AC_CACHE_CHECK([optimization level], [unet_cv_optimization], [unet_cv_optimization='-O3']) -if test "x$unet_cv_optimization" = "xno" ; then - unet_cv_optimization="" -fi -if test x"$CFLAGS" != x; then - CFLAGS=`echo "$CFLAGS" | sed -e s/-O2/$unet_cv_optimization/` -fi -dnl Notice the -g flag and deal accordingly -if test x"$CFLAGS" != x; then - unet_old_cflags=$CFLAGS - CFLAGS=`echo "$CFLAGS" | sed -e 's/-g//g'` -fi -if test x"$CFLAGS" != x"$unet_old_cflags"; then - # If -g was already there, force symbols to be enabled - unet_cv_enable_symbols=yes -fi -dnl Notice the -pg flag and deal accordingly -if test x"$CFLAGS" != x; then - unet_old_cflags=$CFLAGS - CFLAGS=`echo "$CFLAGS" | sed -e 's/-pg//g'` -fi -if test x"$CFLAGS" != x"$unet_old_cflags"; then - # If -pg was already there, force profiling to be enabled - unet_cv_enable_profile=yes -fi -dnl Notice the -Wall flag and deal accordingly -if test x"$CFLAGS" != x; then - unet_old_cflags=$CFLAGS - CFLAGS=`echo "$CFLAGS" | sed -e 's/-Wall//g'` -fi -if test x"$CFLAGS" != x"$unet_old_cflags"; then - # If -Wall was already there, force warnings to be enabled - unet_cv_enable_warnings=yes -fi -dnl Notice the -pedantic flag and deal accordingly -if test x"$CFLAGS" != x; then - unet_old_cflags=$CFLAGS - CFLAGS=`echo "$CFLAGS" | sed -e 's/-pedantic//g'` -fi -if test x"$CFLAGS" != x"$unet_old_cflags"; then - # If -pedantic was already there, force pedatic to be enabled - unet_cv_enable_pedantic=yes -fi dnl Checks for libraries. @@ -313,23 +265,10 @@ AC_DEFINE([NDEBUG], 1, [Disable assertions]) fi -dnl Check for --enable-symbols -AC_MSG_CHECKING([whether to enable debugging symbols]) -AC_ARG_ENABLE([symbols], -[ --disable-symbols Disable debugging symbols (remove -g from CFLAGS)], -[unet_cv_enable_symbols=$enable_symbols], -[AC_CACHE_VAL(unet_cv_enable_symbols, -[unet_cv_enable_symbols=yes])]) -AC_MSG_RESULT([$unet_cv_enable_symbols]) - -if test x"$unet_cv_enable_symbols" = xyes; then - CFLAGS="-g $CFLAGS" -fi - dnl Now check for --enable-profile AC_MSG_CHECKING([whether to enable profiling support (gprof)]) AC_ARG_ENABLE([profile], -[ --enable-profile Enable profiling support (add -pg to CFLAGS)], +[ --enable-profile Enable profiling support (add -pg to CFLAGS and LDFLAGS)], [unet_cv_enable_profile=$enable_profile], [AC_CACHE_VAL(unet_cv_enable_profile, [unet_cv_enable_profile=no])]) Index: ircd-ircdev/include/patchlevel.h diff -u ircd-ircdev/include/patchlevel.h:1.34 ircd-ircdev/include/patchlevel.h:1.35 --- ircd-ircdev/include/patchlevel.h:1.34 Mon May 16 03:17:26 2005 +++ ircd-ircdev/include/patchlevel.h Mon May 16 04:22:50 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.34 2005/05/16 10:17:26 zolty Exp $ + * $Id: patchlevel.h,v 1.35 2005/05/16 11:22:50 zolty Exp $ * */ -#define PATCHLEVEL ".alpha33" +#define PATCHLEVEL ".alpha34" #define RELEASE "1.0" Index: ircd-ircdev/ircd/channel.c diff -u ircd-ircdev/ircd/channel.c:1.20 ircd-ircdev/ircd/channel.c:1.21 --- ircd-ircdev/ircd/channel.c:1.20 Sat May 7 15:23:40 2005 +++ ircd-ircdev/ircd/channel.c Mon May 16 04:22:50 2005 @@ -21,7 +21,7 @@ */ /** @file * @brief Channel management and maintanance - * @version $Id: channel.c,v 1.20 2005/05/07 22:23:40 zolty Exp $ + * @version $Id: channel.c,v 1.21 2005/05/16 11:22:50 zolty Exp $ */ #include "config.h" @@ -696,6 +696,12 @@ */ if (member->channel->mode.mode & MODE_MODERATED) return 0; +#if defined(UNDERNET) + /* TODO */ + /* If only logged in users may join and you're not one, you can't speak. */ + if (member->channel->mode.mode & MODE_REGONLY && !IsAccount(member->user)) + return 0; +#endif /* * If you're banned then you can't speak either. * but because of the amount of CPU time that is_banned chews @@ -3574,9 +3580,16 @@ sendcmdto_channel_butserv_butone(jbuf->jb_source, CMD_JOIN, chan, NULL, 0, "%H", chan); /* send an op, too, if needed */ +#if defined(UNDERNET) + if (flags & CHFL_CHANOP && (oplevel < MAXOPLEVEL || !MyUser(jbuf->jb_source))) + sendcmdto_channel_butserv_butone((chan->mode.apass[0] ? &me : jbuf->jb_source), + CMD_MODE, chan, NULL, 0, "%H +o %C", + chan, jbuf->jb_source); +#else if (flags & CHFL_CHANOP) sendcmdto_channel_butserv_butone(&me, CMD_MODE, chan, NULL, 0, "%H +o %C", chan, jbuf->jb_source); +#endif } else if (MyUser(jbuf->jb_source)) sendcmdto_one(jbuf->jb_source, CMD_JOIN, jbuf->jb_source, ":%H", chan); } Index: ircd-ircdev/ircd/ircd.c diff -u ircd-ircdev/ircd/ircd.c:1.18 ircd-ircdev/ircd/ircd.c:1.19 --- ircd-ircdev/ircd/ircd.c:1.18 Sat May 7 05:43:29 2005 +++ ircd-ircdev/ircd/ircd.c Mon May 16 04:22:50 2005 @@ -21,7 +21,7 @@ */ /** @file * @brief Entry point and other initialization functions for the daemon. - * @version $Id: ircd.c,v 1.18 2005/05/07 12:43:29 zolty Exp $ + * @version $Id: ircd.c,v 1.19 2005/05/16 11:22:50 zolty Exp $ */ #include "config.h" @@ -667,6 +667,23 @@ */ daemon_init(thisServer.bootopt & BOOT_TTY); +#ifdef DEBUGMODE + /* Must reserve fd 2... */ + if (debuglevel >= 0 && !(thisServer.bootopt & BOOT_TTY)) { + int fd; + if ((fd = open("/dev/null", O_WRONLY)) < 0) { + fprintf(stderr, "Unable to open /dev/null (to reserve fd 2): %s\n", + strerror(errno)); + return 8; + } + if (fd != 2 && dup2(fd, 2) < 0) { + fprintf(stderr, "Unable to reserve fd 2; dup2 said: %s\n", + strerror(errno)); + return 8; + } + } +#endif + event_init(MAXCONNECTIONS); setup_signals(); Index: ircd-ircdev/ircd/ircd_crypt_native.c diff -u ircd-ircdev/ircd/ircd_crypt_native.c:1.4 ircd-ircdev/ircd/ircd_crypt_native.c:1.5 --- ircd-ircdev/ircd/ircd_crypt_native.c:1.4 Mon Mar 21 10:39:07 2005 +++ ircd-ircdev/ircd/ircd_crypt_native.c Mon May 16 04:22:50 2005 @@ -22,14 +22,13 @@ /** * @file * @brief Native crypt() function routines - * @version $Id: ircd_crypt_native.c,v 1.4 2005/03/21 18:39:07 zolty Exp $ + * @version $Id: ircd_crypt_native.c,v 1.5 2005/05/16 11:22:50 zolty Exp $ * * Routines for handling passwords encrypted with the system's native crypt() * function (typically a DES encryption routine, but can be anything nowdays). * */ -#define _XOPEN_SOURCE -#define _XOPEN_VERSION 4 +#define _XOPEN_SOURCE 600 #include "config.h" #include "ircd_crypt.h" Index: ircd-ircdev/ircd/ircd_parser.y diff -u ircd-ircdev/ircd/ircd_parser.y:1.20 ircd-ircdev/ircd/ircd_parser.y:1.21 --- ircd-ircdev/ircd/ircd_parser.y:1.20 Thu Apr 28 15:00:08 2005 +++ ircd-ircdev/ircd/ircd_parser.y Mon May 16 04:22:50 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.20 2005/04/28 22:00:08 zolty Exp $ + * $Id: ircd_parser.y,v 1.21 2005/05/16 11:22:50 zolty Exp $ * */ %{ @@ -184,7 +184,7 @@ block: adminblock | generalblock | classblock | connectblock | uworldblock | operblock | portblock | jupeblock | clientblock | killblock | cruleblock | motdblock | featuresblock | quarantineblock | - pseudoblock | iauthblock | error; + pseudoblock | iauthblock | error ';'; /* The timespec, sizespec and expr was ripped straight from * ircd-hybrid-7. */ @@ -258,22 +258,22 @@ jupeblock: JUPE '{' jupeitems '}' ';' ; jupeitems: jupeitem jupeitems | jupeitem; -jupeitem: jupenick | error; -jupenick: NICK '=' QSTRING +jupeitem: jupenick; +jupenick: NICK '=' QSTRING ';' { addNickJupes($3); MyFree($3); -} ';'; +}; -generalblock: GENERAL '{' generalitems '}' +generalblock: GENERAL '{' generalitems '}' ';' { if (localConf.name == NULL) parse_error("Your General block must contain a name."); if (localConf.numeric == 0) parse_error("Your General block must contain a numeric (between 1 and 4095)."); -} ';' ; +}; generalitems: generalitem generalitems | generalitem; -generalitem: generalnumeric | generalname | generalvhost | generaldesc | error; +generalitem: generalnumeric | generalname | generalvhost | generaldesc; generalnumeric: NUMERIC '=' NUMBER ';' { if (localConf.numeric == 0) @@ -314,7 +314,7 @@ MyFree($3); }; -adminblock: ADMIN '{' adminitems '}' +adminblock: ADMIN '{' adminitems '}' ';' { if (localConf.location1 == NULL) DupString(localConf.location1, ""); @@ -322,9 +322,9 @@ DupString(localConf.location2, ""); if (localConf.contact == NULL) DupString(localConf.contact, ""); -} ';'; +}; adminitems: adminitems adminitem | adminitem; -adminitem: adminlocation | admincontact | error; +adminitem: adminlocation | admincontact; adminlocation: LOCATION '=' QSTRING ';' { if (localConf.location1 == NULL) @@ -342,7 +342,7 @@ classblock: CLASS { tping = 90; -} '{' classitems '}' +} '{' classitems '}' ';' { if (name != NULL) { @@ -364,10 +364,10 @@ sendq = 0; memset(&privs, 0, sizeof(privs)); memset(&privs_dirty, 0, sizeof(privs_dirty)); -} ';'; +}; classitems: classitem classitems | classitem; classitem: classname | classpingfreq | classconnfreq | classmaxlinks | - classsendq | classusermode | priv | error; + classsendq | classusermode | priv; classname: NAME '=' QSTRING ';' { MyFree(name); @@ -399,7 +399,7 @@ { maxlinks = 65535; flags = CONF_AUTOCONNECT; -} '{' connectitems '}' +} '{' connectitems '}' ';' { struct ConfItem *aconf = NULL; if (name == NULL) @@ -435,11 +435,11 @@ name = pass = host = origin = hub_limit = NULL; c_class = NULL; port = flags = 0; -}';'; +}; connectitems: connectitem connectitems | connectitem; connectitem: connectname | connectpass | connectclass | connecthost | connectport | connectvhost | connectleaf | connecthub - | connecthublimit | connectmaxhops | connectauto | error; + | connecthublimit | connectmaxhops | connectauto; connectname: NAME '=' QSTRING ';' { MyFree(name); @@ -494,7 +494,7 @@ uworldblock: UWORLD '{' uworlditems '}' ';'; uworlditems: uworlditem uworlditems | uworlditem; -uworlditem: uworldname | error; +uworlditem: uworldname; uworldname: NAME '=' QSTRING ';' { make_conf(CONF_UWORLD)->host = $3; @@ -534,7 +534,7 @@ memset(&privs_dirty, 0, sizeof(privs_dirty)); }; operitems: operitem | operitems operitem; -operitem: opername | operpass | operhost | operclass | priv | error; +operitem: opername | operpass | operhost | operclass | priv; opername: NAME '=' QSTRING ';' { MyFree(name); @@ -623,7 +623,7 @@ port = tconn = tping = 0; }; portitems: portitem portitems | portitem; -portitem: portnumber | portvhost | portmask | portserver | porthidden | error; +portitem: portnumber | portvhost | portmask | portserver | porthidden; portnumber: PORT '=' NUMBER ';' { port = $3; @@ -698,7 +698,7 @@ pass = NULL; }; clientitems: clientitem clientitems | clientitem; -clientitem: clienthost | clientip | clientusername | clientclass | clientpass | clientmaxlinks | error; +clientitem: clienthost | clientip | clientusername | clientclass | clientpass | clientmaxlinks; clienthost: HOST '=' QSTRING ';' { char *sep = strchr($3, '@'); @@ -751,7 +751,7 @@ killblock: KILL { dconf = (struct DenyConf*) MyCalloc(1, sizeof(*dconf)); -} '{' killitems '}' +} '{' killitems '}' ';' { if (dconf->usermask || dconf->hostmask ||dconf->realmask) { if (dconf->hostmask != NULL) @@ -768,9 +768,9 @@ parse_error("Kill block must match on at least one of username, host or realname"); } dconf = NULL; -} ';'; +}; killitems: killitem killitems | killitem; -killitem: killuhost | killreal | killusername | killreasonfile | killreason | error; +killitem: killuhost | killreal | killusername | killreasonfile | killreason; killuhost: HOST '=' QSTRING ';' { char *h; @@ -848,7 +848,7 @@ }; cruleitems: cruleitem cruleitems | cruleitem; -cruleitem: cruleserver | crulerule | cruleall | error; +cruleitem: cruleserver | crulerule | cruleall; cruleserver: SERVER '=' QSTRING ';' { @@ -881,7 +881,7 @@ }; motditems: motditem motditems | motditem; -motditem: motdhost | motdfile | error; +motditem: motdhost | motdfile; motdhost: HOST '=' QSTRING ';' { host = $3; @@ -970,7 +970,7 @@ }; pseudoitems: pseudoitem pseudoitems | pseudoitem; -pseudoitem: pseudoname | pseudoprepend | pseudonick | pseudoflags | error; +pseudoitem: pseudoname | pseudoprepend | pseudonick | pseudoflags; pseudoname: NAME '=' QSTRING ';' { MyFree(smap->name); @@ -1019,7 +1019,7 @@ }; iauthitems: iauthitem iauthitems | iauthitem; -iauthitem: iauthpass | iauthhost | iauthport | iauthconnfreq | iauthtimeout | error; +iauthitem: iauthpass | iauthhost | iauthport | iauthconnfreq | iauthtimeout; iauthpass: PASS '=' QSTRING ';' { MyFree(pass); Index: ircd-ircdev/ircd/m_trace.c diff -u ircd-ircdev/ircd/m_trace.c:1.6 ircd-ircdev/ircd/m_trace.c:1.7 --- ircd-ircdev/ircd/m_trace.c:1.6 Mon Jan 10 04:23:03 2005 +++ ircd-ircdev/ircd/m_trace.c Mon May 16 04:22:50 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_trace.c,v 1.6 2005/01/10 12:23:03 zolty Exp $ + * $Id: m_trace.c,v 1.7 2005/05/16 11:22:50 zolty Exp $ * */ @@ -105,6 +105,7 @@ { int i; struct Client *acptr; + struct Client *acptr2; const struct ConnectionClass* cl; char* tname; int doall; @@ -259,14 +260,19 @@ */ case STAT_SERVER: - if (cli_serv(acptr)->user) + if (cli_serv(acptr)->user) { + if (!cli_serv(acptr)->by[0] + || !(acptr2 = findNUser(cli_serv(acptr)->by)) + || (cli_user(acptr2) != cli_serv(acptr)->user)) + acptr2 = NULL; send_reply(sptr, RPL_TRACESERVER, conClass, link_s[i], link_u[i], cli_name(acptr), - (*(cli_serv(acptr))->by) ? cli_serv(acptr)->by : "*", - cli_serv(acptr)->user->username, cli_serv(acptr)->user->host, + acptr2 ? cli_name(acptr2) : "*", + cli_serv(acptr)->user->username, + cli_serv(acptr)->user->host, CurrentTime - cli_lasttime(acptr), CurrentTime - cli_serv(acptr)->timestamp); - else + } else send_reply(sptr, RPL_TRACESERVER, conClass, link_s[i], link_u[i], cli_name(acptr), (*(cli_serv(acptr))->by) ? cli_serv(acptr)->by : "*", "*", Index: ircd-ircdev/ircd/motd.c diff -u ircd-ircdev/ircd/motd.c:1.7 ircd-ircdev/ircd/motd.c:1.8 --- ircd-ircdev/ircd/motd.c:1.7 Tue Feb 15 08:31:51 2005 +++ ircd-ircdev/ircd/motd.c Mon May 16 04:22:50 2005 @@ -22,7 +22,7 @@ */ /** @file * @brief Message-of-the-day manipulation implementation. - * @version $Id: motd.c,v 1.7 2005/02/15 16:31:51 zolty Exp $ + * @version $Id: motd.c,v 1.8 2005/05/16 11:22:50 zolty Exp $ */ #include "config.h" @@ -446,10 +446,10 @@ struct Motd *ptr; struct MotdCache *cache; unsigned int mt = 0, /* motd count */ - mtm = 0, /* memory consumed by motd */ mtc = 0, /* motd cache count */ - mtcm = 0, /* memory consumed by motd cache */ mtf = 0; /* motd free list count */ + size_t mtm = 0, /* memory consumed by motd */ + mtcm = 0; /* memory consumed by motd cache */ if (MotdList.local) { mt++; Index: ircd-ircdev/ircd/msgq.c diff -u ircd-ircdev/ircd/msgq.c:1.6 ircd-ircdev/ircd/msgq.c:1.7 --- ircd-ircdev/ircd/msgq.c:1.6 Mon Mar 21 10:39:10 2005 +++ ircd-ircdev/ircd/msgq.c Mon May 16 04:22:50 2005 @@ -21,7 +21,7 @@ */ /** @file * @brief Outbound message queue implementation. - * @version $Id: msgq.c,v 1.6 2005/03/21 18:39:10 zolty Exp $ + * @version $Id: msgq.c,v 1.7 2005/05/16 11:22:50 zolty Exp $ */ #include "config.h" @@ -617,8 +617,8 @@ send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, ":Histogram of message lengths (%lu messages)", tmp.msgs); for (i = 0; i + 16 <= BUFSIZE; i += 16) - send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, ":% 4d: %lu %lu %lu %lu " - "%lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu", i + 1, + send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, ":% 4d: %u %u %u %u " + "%u %u %u %u %u %u %u %u %u %u %u %u", i + 1, tmp.sizes[i + 0], tmp.sizes[i + 1], tmp.sizes[i + 2], tmp.sizes[i + 3], tmp.sizes[i + 4], tmp.sizes[i + 5], tmp.sizes[i + 6], tmp.sizes[i + 7], tmp.sizes[i + 8], Index: ircd-ircdev/ircd/numnicks.c diff -u ircd-ircdev/ircd/numnicks.c:1.8 ircd-ircdev/ircd/numnicks.c:1.9 --- ircd-ircdev/ircd/numnicks.c:1.8 Sat May 7 15:23:40 2005 +++ ircd-ircdev/ircd/numnicks.c Mon May 16 04:22:50 2005 @@ -21,7 +21,7 @@ */ /** @file * @brief Implementation of numeric nickname operations. - * @version $Id: numnicks.c,v 1.8 2005/05/07 22:23:40 zolty Exp $ + * @version $Id: numnicks.c,v 1.9 2005/05/16 11:22:50 zolty Exp $ */ #include "config.h" @@ -516,7 +516,7 @@ do { if (*input == '_') { unsigned int left; - for (left = (25 - strlen(input)) / 3; left; left--) + for (left = (25 - strlen(input)) / 3 - pos; left; left--) addr->in6_16[pos++] = 0; input++; } else { @@ -524,7 +524,6 @@ accum = (accum << NUMNICKLOG) | convert2n[(unsigned char)*input++]; accum = (accum << NUMNICKLOG) | convert2n[(unsigned char)*input++]; addr->in6_16[pos++] = ntohs(accum); - input += 3; } } while (pos < 8); } Index: ircd-ircdev/ircd/os_generic.c diff -u ircd-ircdev/ircd/os_generic.c:1.8 ircd-ircdev/ircd/os_generic.c:1.9 --- ircd-ircdev/ircd/os_generic.c:1.8 ... [truncated message content] |
From: Toni G. <zo...@us...> - 2005-05-16 22:50:36
|
CVSROOT : /cvsroot/irc-dev Module : ircd-ircdev Commit time: 2005-05-16 10:17:37 UTC Modified files: ChangeLog ChangeLog.es include/ddb.h include/patchlevel.h ircd/Makefile.in ircd/ddb.c ircd/ddb_db_native.c ircd/ddb_db_template.c ircd/ddb_events.c ircd/ircd_log.c ircd/m_db.c ircd/m_dbq.c ircd/m_ghost.c ircd/m_nick.c ircd/m_svsnick.c ircd/s_bsd.c ircd/s_conf.c ircd/s_serv.c ircd/s_user.c Log message: Author: zoltan <zo...@ir...> Log message: 2005-05-16 Toni García <zo...@ir...> 1.0.alpha33 * Fix de bugs * Documentación Doxygen ---------------------- diff included ---------------------- Index: ircd-ircdev/ChangeLog diff -u ircd-ircdev/ChangeLog:1.34 ircd-ircdev/ChangeLog:1.35 --- ircd-ircdev/ChangeLog:1.34 Sat May 7 15:23:39 2005 +++ ircd-ircdev/ChangeLog Mon May 16 03:17:26 2005 @@ -1,10 +1,14 @@ # # ChangeLog for ircd-ircdev # -# $Id: ChangeLog,v 1.34 2005/05/07 22:23:39 zolty Exp $ +# $Id: ChangeLog,v 1.35 2005/05/16 10:17:26 zolty Exp $ # # Insert new changes at beginning of the change list. # +2005-05-16 Toni García <zo...@ir...> 1.0.alpha33 + * Fix bugs + * Doxygen documentation + 2005-05-08 Toni García <zo...@ir...> 1.0.alpha32 * Fix bugs Index: ircd-ircdev/ChangeLog.es diff -u ircd-ircdev/ChangeLog.es:1.34 ircd-ircdev/ChangeLog.es:1.35 --- ircd-ircdev/ChangeLog.es:1.34 Sat May 7 15:23:39 2005 +++ ircd-ircdev/ChangeLog.es Mon May 16 03:17:26 2005 @@ -1,10 +1,14 @@ # # Log de Cambios para ircd-ircdev # -# $Id: ChangeLog.es,v 1.34 2005/05/07 22:23:39 zolty Exp $ +# $Id: ChangeLog.es,v 1.35 2005/05/16 10:17:26 zolty Exp $ # # Insertar los nuevos cambios al principio de esta lista de cambios. # +2005-05-16 Toni García <zo...@ir...> 1.0.alpha33 + * Fix de bugs + * Documentación Doxygen + 2005-05-08 Toni García <zo...@ir...> 1.0.alpha32 * Fix de bugs Index: ircd-ircdev/include/ddb.h diff -u ircd-ircdev/include/ddb.h:1.7 ircd-ircdev/include/ddb.h:1.8 --- ircd-ircdev/include/ddb.h:1.7 Sat May 7 05:43:28 2005 +++ ircd-ircdev/include/ddb.h Mon May 16 03:17:26 2005 @@ -18,8 +18,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: ddb.h,v 1.7 2005/05/07 12:43:28 zolty Exp $ - * + */ +/** @file + * @brief Distributed DataBases structures, macros and functions. + * @version $Id: ddb.h,v 1.8 2005/05/16 10:17:26 zolty Exp $ */ #ifndef INCLUDED_ddb_h #define INCLUDED_ddb_h @@ -34,64 +36,77 @@ /* * General defines */ -/* Las tablas con los registros, serie, version */ +/** Maxium number of tables */ #define DDB_TABLE_MAX 256 -/*Numero de peticiones de registros antes de que haya que empezar a reciclar */ +/** Number of keys is caching */ #define DDB_BUF_CACHE 32 + /* - * Distributed DataBase Tables + * Distributed DataBases Tables */ -#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 */ +/** First table of %DDB Distributed Databases. */ +#define DDB_INIT 'a' +/** Channels table of %DDB Distributed Databases. */ +#define DDB_CHANDB 'c' +/** Ilines table of %DDB Distributed Databases. */ +#define DDB_ILINEDB 'i' +/** Nicks table of %DDB Distributed Databases. */ +#define DDB_NICKDB 'n' +/** Config table of %DDB Distributed Databases. */ +#define DDB_CONFIGDB 'z' +/** Last table of %DDB Distributed Databases. */ +#define DDB_END 'z' +/* + * Config keys of config table 'z' + */ +/** Number of max clones per ip */ #define DDB_CONFIGDB_MAX_CLONES_PER_IP "maxclones" +/** Message to clients with too many clones from your ip */ #define DDB_CONFIGDB_MSG_TOO_MANY_FROM_IP "msgmanyperip" + /* * PseudoBots */ +/** Nickname of virtual bot for nicks registers */ #define DDB_NICKSERV "NickServ" -/* - * Structures +/** Describes a key on one table. */ struct Ddb { - char *key; - char *content; - struct Ddb *next; + char* ddb_key; /**< Key of the register */ + char* ddb_content; /**< Content of the key */ + struct Ddb* ddb_next; /**< Next key on the table */ }; -struct ddb_stat { - dev_t dev; /* ID of device containing a directory entry for this file */ - ino_t ino; /* Inode number */ - off_t size; /* File size in bytes */ - time_t mtime; /* Time of last data modification */ -}; +/** Get key of the register. */ +#define ddb_key(ddb) ((ddb)->ddb_key) +/** Get content of the key. */ +#define ddb_content(ddb) ((ddb)->ddb_content) +/** Get next key on the table. */ +#define ddb_next(ddb) ((ddb)->ddb_next) -/* - * ddb_db_native + +/** An copy of kernel structure stat. */ -struct ddb_memory_table { - struct ddb_stat file_stat; - char *position; /* Posicion */ - char *point_r; /* Lectura */ -#if 0 - char *point_w; /* Escritura */ -#endif +struct ddb_stat { + dev_t dev; /**< ID of device containing a directory entry for this file */ + ino_t ino; /**< Inode number */ + off_t size; /**< File size in bytes */ + time_t mtime; /**< Time of last data modification */ }; +/** DDB Macro for allocations. */ #define DdbMalloc(x) MyMalloc(x) +/** DDB Macro for freeing memory. */ #define DdbFree(x) MyFree(x) + /* * Prototypes */ @@ -114,9 +129,10 @@ extern void ddb_events_init(void); extern void ddb_end(void); -extern void ddb_new_register(struct Client *cptr, unsigned char table, char *mask, unsigned int id, char *key, char *content); +extern void ddb_new_register(struct Client *cptr, unsigned char table, unsigned int id, char *mask, char *key, char *content); extern void ddb_drop(unsigned char table); extern void ddb_drop_memory(unsigned char table, int events); +extern void ddb_compact(unsigned char table, unsigned int id, char *content); extern void ddb_burst(struct Client *cptr); extern int ddb_table_burst(struct Client *cptr, unsigned char table, unsigned int id); @@ -130,14 +146,14 @@ extern void ddb_die(const char *pattern, ...); extern void ddb_report_stats(struct Client* to, const struct StatDesc* sd, char* param); -/* Externs de ddb_db_*.c */ +/* ddb_db_*.c externs */ extern void ddb_db_init(void); extern int ddb_db_read(struct Client *cptr, unsigned char table, unsigned int id, int count); -extern void ddb_db_write(unsigned char table, char *mask, unsigned int id, char *key, char *content); +extern void ddb_db_write(unsigned char table, unsigned int id, char *mask, char *key, char *content); extern void ddb_db_drop(unsigned char table); -extern void ddb_compact(unsigned char table, char *mask, unsigned int id, char *comment); -extern void ddb_hash_read(unsigned char table, unsigned int *hi, unsigned int *lo); -extern void ddb_hash_write(unsigned char table); +extern void ddb_db_compact(unsigned char table); +extern void ddb_db_hash_read(unsigned char table, unsigned int *hi, unsigned int *lo); +extern void ddb_db_hash_write(unsigned char table); extern void ddb_db_end(void); #endif /* defined(DDB) */ Index: ircd-ircdev/include/patchlevel.h diff -u ircd-ircdev/include/patchlevel.h:1.33 ircd-ircdev/include/patchlevel.h:1.34 --- ircd-ircdev/include/patchlevel.h:1.33 Sat May 7 15:23:40 2005 +++ ircd-ircdev/include/patchlevel.h Mon May 16 03:17:26 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.33 2005/05/07 22:23:40 zolty Exp $ + * $Id: patchlevel.h,v 1.34 2005/05/16 10:17:26 zolty Exp $ * */ -#define PATCHLEVEL ".alpha32" +#define PATCHLEVEL ".alpha33" #define RELEASE "1.0" Index: ircd-ircdev/ircd/Makefile.in diff -u ircd-ircdev/ircd/Makefile.in:1.25 ircd-ircdev/ircd/Makefile.in:1.26 --- ircd-ircdev/ircd/Makefile.in:1.25 Sat May 7 05:43:29 2005 +++ ircd-ircdev/ircd/Makefile.in Mon May 16 03:17:26 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: Makefile.in,v 1.25 2005/05/07 12:43:29 zolty Exp $ +# $Id: Makefile.in,v 1.26 2005/05/16 10:17:26 zolty Exp $ #### Start of system configuration section. #### @@ -1649,31 +1649,36 @@ ../include/ircd_events.h ../include/ircd_handler.h ../include/res.h \ ../include/capab.h ../include/ircd.h ../include/struct.h \ ../include/ircd_alloc.h ../include/ircd_chattr.h ../include/ircd_log.h \ - ../include/ircd_reply.h ../include/ircd_string.h ../include/ircd_tea.h \ - ../include/list.h ../include/match.h ../include/msg.h \ - ../include/numeric.h ../include/s_bsd.h ../include/s_debug.h \ - ../include/s_misc.h ../include/send.h + ../include/ircd_reply.h ../include/ircd_snprintf.h \ + ../include/ircd_string.h ../include/ircd_tea.h ../include/list.h \ + ../include/match.h ../include/msg.h ../include/numeric.h \ + ../include/s_bsd.h ../include/s_debug.h ../include/s_misc.h \ + ../include/send.h # 1 "/usr/home/zoltan/ircd-ircdev/ircd//" ddb_db_native.o: ddb_db_native.c ../config.h ../include/ddb.h ../config.h \ ../include/client.h ../include/ircd_defs.h ../include/dbuf.h \ ../include/msgq.h ../include/ircd_events.h ../include/ircd_handler.h \ - ../include/res.h ../include/capab.h ../include/ircd_features.h \ - ../include/ircd_log.h ../include/ircd_snprintf.h ../include/numnicks.h + ../include/res.h ../include/capab.h ../include/client.h \ + ../include/ircd.h ../include/struct.h ../include/ircd_features.h \ + ../include/ircd_log.h ../include/ircd_snprintf.h \ + ../include/ircd_string.h ../include/ircd_chattr.h ../include/msg.h \ + ../include/numnicks.h ../include/s_debug.h ../include/send.h # 1 "/usr/home/zoltan/ircd-ircdev/ircd//" ddb_events.o: ddb_events.c ../config.h ../include/ddb.h ../config.h \ ../include/client.h ../include/ircd_defs.h ../include/dbuf.h \ ../include/msgq.h ../include/ircd_events.h ../include/ircd_handler.h \ ../include/res.h ../include/capab.h ../include/client.h \ ../include/hash.h ../include/ircd.h ../include/struct.h \ - ../include/ircd_tea.h ../include/msg.h ../include/numnicks.h \ - ../include/s_user.h ../include/send.h + ../include/ircd_snprintf.h ../include/ircd_tea.h ../include/msg.h \ + ../include/numnicks.h ../include/s_user.h ../include/send.h # 1 "/usr/home/zoltan/ircd-ircdev/ircd//" m_db.o: m_db.c ../config.h ../include/ddb.h ../config.h \ ../include/client.h ../include/ircd_defs.h ../include/dbuf.h \ ../include/msgq.h ../include/ircd_events.h ../include/ircd_handler.h \ ../include/res.h ../include/capab.h ../include/client.h \ - ../include/ircd.h ../include/struct.h ../include/ircd_log.h \ - ../include/ircd_reply.h ../include/list.h ../include/match.h \ + ../include/ircd.h ../include/struct.h ../include/ircd_features.h \ + ../include/ircd_log.h ../include/ircd_reply.h \ + ../include/ircd_snprintf.h ../include/list.h ../include/match.h \ ../include/msg.h ../include/numnicks.h ../include/send.h \ ../include/s_debug.h # 1 "/usr/home/zoltan/ircd-ircdev/ircd//" @@ -1700,9 +1705,10 @@ ../include/capab.h ../include/ddb.h ../config.h ../include/client.h \ ../include/hash.h ../include/ircd.h ../include/struct.h \ ../include/ircd_features.h ../include/ircd_log.h \ - ../include/ircd_string.h ../include/ircd_chattr.h ../include/ircd_tea.h \ - ../include/msg.h ../include/numnicks.h ../include/s_conf.h \ - ../include/s_user.h ../include/send.h ../include/sys.h + ../include/ircd_snprintf.h ../include/ircd_string.h \ + ../include/ircd_chattr.h ../include/ircd_tea.h ../include/msg.h \ + ../include/numnicks.h ../include/s_conf.h ../include/s_user.h \ + ../include/send.h ../include/sys.h # 1 "/usr/home/zoltan/ircd-ircdev/ircd//" m_svsnick.o: m_svsnick.c ../config.h ../include/client.h \ ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \ @@ -1710,9 +1716,10 @@ ../include/capab.h ../include/ddb.h ../config.h ../include/client.h \ ../include/hash.h ../include/ircd.h ../include/struct.h \ ../include/ircd_features.h ../include/ircd_log.h \ - ../include/ircd_string.h ../include/ircd_chattr.h ../include/ircd_tea.h \ - ../include/msg.h ../include/numnicks.h ../include/s_conf.h \ - ../include/s_user.h ../include/send.h ../include/sys.h + ../include/ircd_snprintf.h ../include/ircd_string.h \ + ../include/ircd_chattr.h ../include/ircd_tea.h ../include/msg.h \ + ../include/numnicks.h ../include/s_conf.h ../include/s_user.h \ + ../include/send.h ../include/sys.h # 1 "/usr/home/zoltan/ircd-ircdev/ircd//" # 1 "/usr/home/zoltan/ircd-ircdev/ircd//" # 1 "/usr/home/zoltan/ircd-ircdev/ircd//" Index: ircd-ircdev/ircd/ddb.c diff -u ircd-ircdev/ircd/ddb.c:1.8 ircd-ircdev/ircd/ddb.c:1.9 --- ircd-ircdev/ircd/ddb.c:1.8 Sat May 7 15:23:40 2005 +++ ircd-ircdev/ircd/ddb.c Mon May 16 03:17:26 2005 @@ -2,7 +2,8 @@ * IRC-Dev IRCD - An advanced and innovative IRC Daemon, ircd/ddb.c * * Copyright (C) 2002-2005 IRC-Dev Development Team <de...@ir...> - * Copyright (C) 2004 Toni Garcia (zoltan) <zo...@ir...> + * Copyright (C) 2004-2005 Toni Garcia (zoltan) <zo...@ir...> + * Copyright (C) 1999-2003 Jesus Cea Avion <jc...@ar...> Esnet IRC Network * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -21,7 +22,7 @@ */ /** @file * @brief Implementation of Distributed DataBase. - * @version $Id: ddb.c,v 1.8 2005/05/07 22:23:40 zolty Exp $ + * @version $Id: ddb.c,v 1.9 2005/05/16 10:17:26 zolty Exp $ */ #include "config.h" @@ -46,31 +47,53 @@ /* #include <assert.h> -- Now using assert in ircd_log.h */ #include <stdarg.h> #include <stdio.h> -/*#include <stdlib.h> */ #include <string.h> #include <time.h> +/** @page ddb Distributed DataBase + * + * + * TODO, explicacion del sistema + */ + +/** DDB registers cache. */ static struct Ddb ddb_buf_cache[DDB_BUF_CACHE]; +/** Buffer cache. */ static int ddb_buf_cache_i = 0; +/** Tables of %DDB. */ struct Ddb **ddb_data_table[DDB_TABLE_MAX]; -short ddb_corrupt_table[DDB_TABLE_MAX]; +/** Residents tables of %DDB. */ unsigned int ddb_resident_table[DDB_TABLE_MAX]; +/** Registers count of %DDB tables. */ unsigned int ddb_count_table[DDB_TABLE_MAX]; +/** ID number of %DDB tables. */ unsigned int ddb_id_table[DDB_TABLE_MAX]; +/** Hi hash table. */ unsigned int ddb_hashtable_hi[DDB_TABLE_MAX]; +/** Lo hash table. */ unsigned int ddb_hashtable_lo[DDB_TABLE_MAX]; +/** File or DB stats of %DDB tables.*/ struct ddb_stat ddb_stats_table[DDB_TABLE_MAX]; +/** Last key on iterator. */ static struct Ddb *ddb_iterator_key = NULL; +/** Last content on iterator. */ static struct Ddb **ddb_iterator_content = NULL; +/** Position of hash on iterator. */ static int ddb_iterator_hash_pos = 0; +/** Length of hash on iterator. */ static int ddb_iterator_hash_len = 0; +static void ddb_table_init(unsigned char table); static int ddb_add_key(unsigned char table, char *key, char *content); static int ddb_del_key(unsigned char table, char *key); +/** Verify if a table is resident. + * @param[in] table Table of the %DDB Distributed DataBase. + * @return Non-zero if a table is resident; zero is not resident. + */ int ddb_table_is_resident(unsigned char table) { return ddb_resident_table[table] ? 1 : 0; @@ -88,8 +111,10 @@ } */ -/** - * +/** Copy a malloc in the memory. + * @param[in] buf Buffer + * @param[in] len Length + * @param[in] p Pointer */ static void DdbCopyMalloc(char *buf, int len, char **p) @@ -104,15 +129,19 @@ } if (!p2) { - p2 = MyMalloc(len + 1); /* El '\0' final */ + p2 = MyMalloc(len + 1); /* The '\0' */ *p = p2; } memcpy(p2, buf, len); p2[len] = '\0'; } -/** - * +/** Calculates the hash. + * @param[in] table Table of the %DDB Distributed DataBase. + * @param[in] id ID number in the table. + * @param[in] mask Mask of the server. + * @param[in] key Key of the registry. + * @param[in] content Content of the registry. */ static void ddb_hash_calculate(unsigned char table, unsigned int id, char *mask, char *key, char *content) @@ -134,11 +163,14 @@ strncpy((char *)buffer, buf, sizeof(buffer) - 1); + /* TODO */ +#if 0 /* Parece que no es necesario, comprobarlo */ while ((p2 = strchr((char *)buffer, '\n'))) *p2 = '\0'; while ((p2 = strchr((char *)buffer, '\r'))) *p2 = '\0'; +#endif k[0] = k[1] = 0; x[0] = ddb_hashtable_hi[table]; @@ -154,8 +186,7 @@ ddb_hashtable_lo[table] = x[1]; } -/** initialize Distributed DataBase - * +/** Initialize %DDB Distributed DataBases. */ void ddb_init(void) @@ -168,33 +199,92 @@ memset(ddb_resident_table, 0, sizeof(ddb_resident_table)); /* - * Las longitudes DEBEN ser potencias de 2, - * y no deben ser superiores a HASHSIZE, ya que ello - * solo desperdiciaria memoria. + * The lengths MUST be powers of 2 and do not have + * to be superior to HASHSIZE. */ 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_drop_memory(table, 0); - ddb_db_read(NULL, table, 0, 0); -/* ddb_hash_read(table); */ - } + ddb_table_init(table); /* - * La operacion anterior puede ser una operacion larga. - * Resincronizamos tiempo. + * The previous operation it can be a long operation. + * Updates time. */ CurrentTime = time(NULL); } -/** - * +/** Initialize a table of %DDB. + * @param[in] table + */ +static void ddb_table_init(unsigned char table) +{ + unsigned int hi, lo; + + /* First drop table */ + ddb_drop_memory(table, 0); + + /* Read the table on file or database */ + ddb_db_read(NULL, table, 0, 0); + + /* Read hashes */ + ddb_db_hash_read(table, &hi, &lo); + + /* Compare memory hashes with local hashes */ + sendto_opmask_butone(0, SNO_OLDSNO, "Lo: %d Hashtable_Lo: %d Hi: %d Hashtable_Hi %d", + lo, ddb_hashtable_lo[table], hi, ddb_hashtable_hi[table]); + +#if 0 + if ((ddb_hashtable_hi[table] != hi) || (ddb_hashtable_lo[table] != lo)) + { + struct DLink *lp; + char buf[1024]; + + log_write(LS_DDB, L_INFO, 0, "WARNING - Table '%c' is corrupt. Droping table...", table); + ddb_db_drop(table); + + ircd_snprintf(0, buf, sizeof(buf), "Table '%c' is corrupt. Reloading via remote burst...", table); + ddb_splithubs_butone(NULL, buf); + + log_write(LS_DDB, L_INFO, 0, "Solicit a copy of table '%s' to neighboring nodes", table); + + /* Solicit a copy to only hubs*/ + for (lp = cli_serv(&me)->down; lp; lp = lp->next) + { + if (IsHub(lp->value.cptr)) + sendcmdto_one(&me, CMD_DB, lp->value.cptr, "%C 0 J %u %c", + lp->value.cptr, ddb_id_table[table], table); + } + } + else +#endif + { + ddb_db_hash_write(table); + + if (ddb_resident_table[table]) + { + ddb_del_key(table, "*"); + log_write(LS_DDB, L_INFO, 0, "Loading Table '%c' finished: S=%u R=%u", + table, ddb_id_table[table], ddb_count_table[table]); + } + else if (ddb_count_table[table]) + log_write(LS_DDB, L_INFO, 0, "Loading Table '%c' finished: S=%u NoResident", + table, ddb_id_table[table]); + } +} + +/** Add a new register from the network or reading when ircd is starting. + * @param[in] cptr %Server sending a new register. If is NULL, it is own server during ircd start. + * @param[in] table Table of the %DDB Distributed DataBases. + * @param[in] id Identify number of the register. + * @param[in] mask Servermask of the register. + * @param[in] key Key of the register. + * @param[in] content Content of the key. */ void -ddb_new_register(struct Client *cptr, unsigned char table, char *mask, unsigned int id, char *key, char *content) +ddb_new_register(struct Client *cptr, unsigned char table, unsigned int id, char *mask, char *key, char *content) { static char *keytemp = NULL; static int key_len = 0; @@ -204,30 +294,27 @@ ddb_hash_calculate(table, id, mask, key, content); - /* Al iniciar, cptr no existe y por lo tanto no se escribe */ + /* In the ircd starting, cptr is NULL and it not writing on file or database */ if (cptr) { - ddb_db_write(table, mask, id, key, content); - ddb_hash_write(table); + ddb_db_write(table, id, mask, key, content); + ddb_db_hash_write(table); } ddb_id_table[table] = id; - /* Solo ponemos en memoria registros cuya mascara - * concuerda con el servidor. - * Y por supuesto, que sean residentes - */ + /* If the table is not resident, do not save in memory */ if (!ddb_resident_table[table]) return; - /* Usamos collapse+match por un bug en lastNNServer del find_match_server */ + /* If a mask is not concerned with me, do not save in memory */ + /* For lastNNServer bug (find_match_server) it use collapse + match */ collapse(mask); if (!match(mask, cli_name(&me))) { - int i = 0; +/* int i = 0; */ int update = 0; - /* pasamos el key en minusculas */ if ((strlen(key) + 1 > key_len) || (!keytemp)) { key_len = strlen(key) + 1; @@ -238,17 +325,21 @@ assert(0 != keytemp); } strcpy(keytemp, key); + +/* while (keytemp[i]) { -/* keytemp[i] = ToLower(keytemp[i]); */ + keytemp[i] = ToLower(keytemp[i]); i++; } +*/ if (content) update = ddb_add_key(table, keytemp, content); else ddb_del_key(table, keytemp); + /* TODO */ /* Ejecutamos los eventos */ /* if (!cptr && ddb_events_table[table]) */ if (ddb_events_table[table]) @@ -257,8 +348,11 @@ } -/** - * +/** Add or update an register on the memory. + * @param[in] table Table of the %DDB Distributed DataBases. + * @param[in] key Key of the register. + * @param[in] content Content of the key. + * @return 1 is an update, 0 is a new register. */ static int ddb_add_key(unsigned char table, char *key, char *content) @@ -281,7 +375,6 @@ strcpy(k, key); strcpy(c, content); - /* paso a minusculas */ /* while (c[i] != 0) { @@ -290,23 +383,25 @@ } */ - ddb->key = k; - ddb->content = c; - ddb->next = NULL; + ddb_key(ddb) = k; + ddb_content(ddb) = c; + ddb_next(ddb) = NULL; - hashi = ddb_hash_register(ddb->key, ddb_resident_table[table]); + hashi = ddb_hash_register(ddb_key(ddb), ddb_resident_table[table]); - Debug((DEBUG_INFO, "Inserto T='%c' K='%s' C='%s' H=%u",table, ddb->key, ddb->content, hashi)); + Debug((DEBUG_INFO, "Add DDB: T='%c' K='%s' C='%s' H=%u", table, ddb_key(ddb), ddb_content(ddb), hashi)); - ddb->next = ddb_data_table[table][hashi]; + ddb_next(ddb) = ddb_data_table[table][hashi]; ddb_data_table[table][hashi] = ddb; ddb_count_table[table]++; - return delete; + return delete; } -/** - * +/** Delete an register from memory. + * @param[in] table Table of the %DDB Distributed DataBases. + * @param[in] key Key of the register. + * @return 1 on success; 0 do not delete. */ static int ddb_del_key(unsigned char table, char *key) @@ -322,8 +417,8 @@ for (ddb = *ddb3; ddb; ddb = ddb2) { - ddb2 = ddb->next; - if (!strcmp(ddb->key, key)) + ddb2 = ddb_next(ddb); + if (!strcmp(ddb_key(ddb), key)) { *ddb3 = ddb2; delete = 1; @@ -331,30 +426,31 @@ ddb_count_table[table]--; break; } - ddb3 = &(ddb->next); + ddb3 = &(ddb_next(ddb)); } return delete; } -/** - * +/** Deletes a table. + * @param[in] table Table of the %DDB Distributed DataBases. */ void ddb_drop(unsigned char table) { - /* Borramos el fichero de la tabla */ + /* Delete file or database of the table */ ddb_db_drop(table); - /* Borramos la tabla en la memoria */ + /* Delete table from memory */ ddb_drop_memory(table, 0); - - ddb_hash_write(table); - ddb_corrupt_table[table] = 0; + + /* Write hash on file or database */ + ddb_db_hash_write(table); } -/** - * +/** Deletes a table from memory. + * @param[in] table Table of the %DDB Distributed DataBases. + * @param[in] events Non-zero impliques events. */ void ddb_drop_memory(unsigned char table, int events) @@ -371,10 +467,10 @@ { for (ddb = ddb_data_table[table][i]; ddb; ddb = ddb2) { - ddb2 = ddb->next; + ddb2 = ddb_next(ddb); if (events && ddb_events_table[table]) - ddb_events_table[table](ddb->key, NULL, 0); + ddb_events_table[table](ddb_key(ddb), NULL, 0); DdbFree(ddb); } @@ -395,19 +491,35 @@ ddb_id_table[table] = 0; ddb_hashtable_hi[table] = 0; ddb_hashtable_lo[table] = 0; -/* - tabla_corrupta[tabla] = 0; -*/ } -/** - * +/** Packing the table. + * @param[in] table Table of the %DDB Distributed DataBases. + * @param[in] id Identify number of the register. + * @param[in] content Content of the key. + */ +void +ddb_compact(unsigned char table, unsigned int id, char *content) +{ + log_write(LS_DDB, L_INFO, 0, "Packing table '%c'", table); + ddb_id_table[table] = id; + ddb_db_compact(table); + + ddb_hash_calculate(table, id, "*", "*", content); + ddb_db_write(table, id, "*", "*", content); + ddb_db_hash_write(table); +} + +/** Sending the %DDB burst tables. + * @param[in] cptr %Server sending the petition. */ void ddb_burst(struct Client *cptr) { int i; + sendto_opmask_butone(0, SNO_NETWORK, "Bursting DDB tables"); + sendcmdto_one(&me, CMD_DB, cptr, "* 0 J %u n", ddb_id_table[DDB_NICKDB]); @@ -419,8 +531,8 @@ } } -/** - * +/** Initializes %DDB iterator. + * @return ddb_iterator_key pointer. */ static struct Ddb * ddb_iterator_init(void) @@ -429,16 +541,13 @@ if (ddb_iterator_key) { - ddb_iterator_key = ddb_iterator_key->next; + ddb_iterator_key = ddb_next(ddb_iterator_key); if (ddb_iterator_key) { return ddb_iterator_key; } } - /* - * Indica el PROXIMO valor a utilizar. - */ while (ddb_iterator_hash_pos < ddb_iterator_hash_len) { ddb = ddb_iterator_content[ddb_iterator_hash_pos++]; @@ -456,8 +565,9 @@ return NULL; } -/** - * +/** Initializes iterator for a table. + * @param[in] table Table of the %DDB Distributed DataBase. + * @return First active register on a table. */ struct Ddb * ddb_iterator_first(unsigned char table) @@ -473,9 +583,9 @@ return ddb_iterator_init(); } - -/** - * + +/** Next iterator. + * @return Next active register on a table. */ struct Ddb * ddb_iterator_next(void) @@ -487,15 +597,17 @@ return ddb_iterator_init(); } -/** - * +/** Find a register by the key (internal). + * @param[in] table Table of the %DDB Distributed DataBases. + * @param[in] key Key of the register. + * @return Pointer of the register. */ static struct Ddb *ddb_find_registry_table(unsigned char table, char *key) { struct Ddb *ddb; static char *k = 0; static int k_len = 0; - int i, hashi; + int i = 0, hashi; if ((strlen(key) + 1 > k_len) || (!k)) { @@ -507,30 +619,33 @@ return 0; } strcpy(k, key); - /* paso a minusculas */ - i = 0; + +/* while (k[i]) { -/* k[i] = ToLower(k[i]); */ + k[i] = ToLower(k[i]); i++; } +*/ hashi = ddb_hash_register(k, ddb_resident_table[table]); - for (ddb = ddb_data_table[table][hashi]; ddb; ddb = ddb->next) + for (ddb = ddb_data_table[table][hashi]; ddb; ddb = ddb_next(ddb)) { -/* if (!strcmp(ddb->key, k)) */ - if (!ircd_strcmp(ddb->key, k)) +/* if (!strcmp(ddb_key(ddb), k)) */ + if (!ircd_strcmp(ddb_key(ddb), k)) { - assert(0 != ddb->content); + assert(0 != ddb_content(ddb)); return ddb; } } return NULL; } -/** - * +/** Find a register by the key. + * @param[in] table Table of the %DDB Distributed DataBases. + * @param[in] key Key of the register. + * @return Pointer of the register. */ struct Ddb *ddb_find_key(unsigned char table, char *key) { @@ -547,24 +662,25 @@ if (!ddb) return NULL; - /* Lo que sigue lo sustituye */ - key_init = ddb->key; + key_init = ddb_key(ddb); key_end = key_init + strlen(key_init); - content_init = ddb->content; + content_init = ddb_content(ddb); content_end = content_init + strlen(content_init); DdbCopyMalloc(key_init, key_end - key_init, - &ddb_buf_cache[ddb_buf_cache_i].key); + &ddb_buf_cache[ddb_buf_cache_i].ddb_key); DdbCopyMalloc(content_init, content_end - content_init, - &ddb_buf_cache[ddb_buf_cache_i].content); + &ddb_buf_cache[ddb_buf_cache_i].ddb_content); if (++ddb_buf_cache_i >= DDB_BUF_CACHE) ddb_buf_cache_i = 0; return ddb; } -/** - * +/** Get nick!user@host of the virtual bot. + * @param[in] bot Key of the register. + * @return nick!user@host of the virtual bot if exists and + * if not exists, return my servername. */ char * ddb_get_botname(char *bot) @@ -573,21 +689,19 @@ ddb = ddb_find_key(DDB_CONFIGDB, DDB_NICKSERV); if (ddb) - return ddb->content; + return ddb_content(ddb); else return cli_name(&me); } -/** - * +/** When IRCD is reloading, it is executing. */ void ddb_reload(void) { - sendto_opmask_butone(0, SNO_OLDSNO, "Reload Distributed DataBase..."); log_write(LS_DDB, L_INFO, 0, "Reload Distributed DataBase..."); - ddb_init(); + /* ddb_init(); */ } @@ -641,6 +755,8 @@ server_die(exitmsg); } +/** Finalizes the %DDB subsystem. + */ void ddb_end(void) { Index: ircd-ircdev/ircd/ddb_db_native.c diff -u ircd-ircdev/ircd/ddb_db_native.c:1.3 ircd-ircdev/ircd/ddb_db_native.c:1.4 --- ircd-ircdev/ircd/ddb_db_native.c:1.3 Sat May 7 15:23:40 2005 +++ ircd-ircdev/ircd/ddb_db_native.c Mon May 16 03:17:27 2005 @@ -3,7 +3,7 @@ * * Copyright (C) 2002-2005 IRC-Dev Development Team <de...@ir...> * Copyright (C) 2004-2005 Toni Garcia (zoltan) <zo...@ir...> - * Copyright (C) 1999-2003 Jesus Cea Avion <jc...@ar...> + * Copyright (C) 1999-2003 Jesus Cea Avion <jc...@ar...> Esnet IRC Network * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -21,8 +21,8 @@ * */ /** @file - * @brief Native DataBase implementation of Distributed DataBase. - * @version $Id: ddb_db_native.c,v 1.3 2005/05/07 22:23:40 zolty Exp $ + * @brief Native DataBase implementation of Distributed DataBases. + * @version $Id: ddb_db_native.c,v 1.4 2005/05/16 10:17:27 zolty Exp $ */ #include "config.h" @@ -32,8 +32,10 @@ #include "ircd_features.h" #include "ircd_log.h" #include "ircd_snprintf.h" +#include "ircd_string.h" #include "msg.h" #include "numnicks.h" +#include "s_debug.h" #include "send.h" /* #include <assert.h> -- Now using assert in ircd_log.h */ @@ -42,22 +44,30 @@ #include <string.h> #include <unistd.h> #include <sys/mman.h> + /* -#include <stdlib.h> -#include <sys/stat.h> -*/ + * ddb_db_native + */ +struct ddb_memory_table { + struct ddb_stat file_stat; + char *position; /* Posicion */ + char *point_r; /* Lectura */ +}; static int ddb_read(struct ddb_memory_table *map_table, char *buf); static int ddb_seek(struct ddb_memory_table *map_table, char *buf, unsigned int id); static void get_ddb_stat(int fd, struct ddb_stat *ddbstat); +static char *check_corrupt_table(unsigned char table, struct ddb_stat *ddbstat); -/** - * + +/** Initialize database gestion module of + * %DDB Distributed DataBases. */ void ddb_db_init(void) { char path[1024]; + unsigned char table; int fd; int temp; @@ -71,32 +81,50 @@ ddb_die("Error when creating %s directory", feature_str(FEAT_DDBPATH)); } #endif - /* Verificar archivo hashes */ + + /* Verify if hashes file is exist. */ ircd_snprintf(0, path, sizeof(path), "%s/hashes", feature_str(FEAT_DDBPATH)); alarm(3); fd = open(path, O_WRONLY, S_IRUSR | S_IWUSR); if (fd == -1) { - unsigned char tabletemp; fd = open(path, O_WRONLY | O_CREAT, S_IRUSR | S_IWUSR); if (fd == -1) - ddb_die("Error when creating hashes file"); + ddb_die("Error when creating hashes file (OPEN)"); - for (tabletemp = DDB_INIT; tabletemp <= DDB_END; tabletemp++) + for (table = DDB_INIT; table <= DDB_END; table++) { - ircd_snprintf(0, path, sizeof(path), "%c AAAAAAAAAAAA\n", tabletemp); + ircd_snprintf(0, path, sizeof(path), "%c AAAAAAAAAAAA\n", table); write(fd, path, 15); } } close(fd); alarm(0); - /* Verificar archivos de las tablas */ - + /* Verify if tables file is exist. */ + for (table = DDB_INIT; table <= DDB_END; table++) + { + ircd_snprintf(0, path, sizeof(path), "%s/table.%c", + feature_str(FEAT_DDBPATH), table); + alarm(3); + fd = open(path, O_WRONLY, S_IRUSR | S_IWUSR); + if (fd == -1) + { + fd = open(path, O_CREAT, S_IRUSR | S_IWUSR); + if (fd == -1) + ddb_die("Error when creating table '%c' (OPEN)", table); + } + close(fd); + alarm(0); + } } -/** - * +/** Read the table. + * @param[in] cptr %Server if is exists, it sends to server. + * @param[in] table Table of the %DDB Distributed DataBase. + * @param[in] id ID number in the table. + * @param[in] count Number of registers to be read. + * @return 1 No data pending, 0 have data pending, -1 error. */ int ddb_db_read(struct Client *cptr, unsigned char table, unsigned int id, int count) @@ -122,15 +150,13 @@ MAP_SHARED | MAP_NORESERVE, fd, 0); if (fd == -1) -/* ddb_die("Error when reading table '%c' (OPEN)", table); */ - return -1; + ddb_die("Error when reading table '%c' (OPEN)", table); if ((map_table.file_stat.size != 0) && (map_table.position == MAP_FAILED)) ddb_die("Error when reading table '%c' (MMAP)", table); close(fd); alarm(0); -/* map_table->point_r = map_table->point_w = map_table->position; */ map_table.point_r = map_table.position; cont = ddb_seek(&map_table, buf, id); @@ -140,7 +166,7 @@ return -1; } - /* Leer */ + /* Read registers */ do { char *mask, *key, *content; @@ -165,8 +191,8 @@ *content++ = '\0'; if (!cptr) - /* Inicio del ircd */ - ddb_new_register(NULL, table, mask, cid, key, content); + /* IRCD starting */ + ddb_new_register(NULL, table, cid, mask, key, content); else { /* Burst */ @@ -187,34 +213,40 @@ } while(ddb_read(&map_table, buf) != -1); - /* CERRAR FICHERO */ + /* Close mmap file */ munmap(map_table.position, map_table.file_stat.size); return int_return; } -/** - * +/** Write the table. + * @param[in] table Table of the %DDB Distributed DataBase. + * @param[in] id ID number in the table. + * @param[in] mask Mask of the server. + * @param[in] key Key of the registry. + * @param[in] content Content of the registry. */ void -ddb_db_write(unsigned char table, char *mask, unsigned int id, char *key, char *content) +ddb_db_write(unsigned char table, unsigned int id, char *mask, char *key, char *content) { struct ddb_stat ddbstat; char path[1024]; + char *corrupt; int fd, offset; ircd_snprintf(0, path, sizeof(path), "%s/table.%c", feature_str(FEAT_DDBPATH), table); alarm(3); - fd = open(path, O_CREAT | O_APPEND | O_WRONLY, S_IRUSR | S_IWUSR); + fd = open(path, O_WRONLY | O_APPEND, S_IRUSR | S_IWUSR); if (fd == -1) ddb_die("Error when saving new key in table '%c' (OPEN)", table); get_ddb_stat(fd, &ddbstat); - /* TODO: Comprobar corrupcion - * comprueba_corrupcion(table, &ddbstat); - */ + corrupt = check_corrupt_table(table, &ddbstat); + if (corrupt) + ddb_die("A nonauthorized modification is detect in table '%c' [%s]", + table, corrupt); offset = lseek(fd, 0 , SEEK_CUR); if (offset < 0) @@ -233,8 +265,8 @@ alarm(0); } -/** - * +/** Delete a table. + * @param[in] table Table of the %DDB Distributed DataBase. */ void ddb_db_drop(unsigned char table) @@ -257,20 +289,21 @@ alarm(0); } -/** - * +/** Pack the table. + * @param[in] table Table of the %DDB Distributed DataBase. */ void -ddb_db_compact(unsigned char table, char *mask, unsigned int id, char *comment) +ddb_db_compact(unsigned char table) { - } -/** - * +/** Read the hashes. + * @param[in] table Table of the %DDB Distributed DataBase. + * @param[out] hi Hi hash. + * @param[out] lo Lo hash. */ void -ddb_hash_read(unsigned char table, unsigned int *hi, unsigned int *lo) +ddb_db_hash_read(unsigned char table, unsigned int *hi, unsigned int *lo) { char path[1024]; char c; @@ -278,6 +311,7 @@ ircd_snprintf(0, path, sizeof(path), "%s/hashes", feature_str(FEAT_DDBPATH)); + alarm(3); fd = open(path, O_RDONLY, S_IRUSR | S_IWUSR); if (fd == -1) { @@ -300,11 +334,11 @@ *lo = base64toint(path + 6); } -/** - * +/** Write the hash. + * @param[in] table Table of the %DDB Distributed DataBase. */ void -ddb_hash_write(unsigned char table) +ddb_db_hash_write(unsigned char table) { char path[1024]; char hash[20]; @@ -329,8 +363,7 @@ } -/** - * +/** Executes when finalizes the %DDB subsystem. */ void ddb_db_end(void) @@ -338,8 +371,9 @@ /* Backup copy? */ } -/** - * +/** Read the table. + * @param[in,out] map_table Structure ddb_memory_table. + * @param[in] buf Buffer. */ static int ddb_read(struct ddb_memory_table *map_table, char *buf) @@ -366,8 +400,10 @@ return -1; } -/** - * +/** Seek the table. + * @param[in,out] memory_table Structure ddb_memory_table. + * @param[in] buf Buffer. + * @param[in] id ID number in the table. */ static int ddb_seek(struct ddb_memory_table *map_table, char *buf, unsigned int id) @@ -411,8 +447,9 @@ return ddb_read(map_table, buf); } -/** - * +/** Fstat wrapper. + * @param[in] fd File Descriptor. + * @param[out] ddbstat Structure ddb_stat. */ static void get_ddb_stat(int fd, struct ddb_stat *ddbstat) @@ -427,3 +464,58 @@ ddbstat->size = st.st_size; ddbstat->mtime = st.st_mtime; } + +/** Checking if a table is corrupt + * @param[in] table Table of the %DDB Distributed DataBase. + * @param[in] ddbstat Structure ddb_stat + * @return If is NULL, the table is not corrupt else, return the reason message. + */ +static char * +check_corrupt_table(unsigned char table, struct ddb_stat *ddbstat) +{ + char *msg = NULL; + + /* TODO */ + return msg; + if (memcmp(&ddbstat, &ddb_stats_table[table], sizeof(ddbstat))) + { + char buf[1024]; + char *space = ""; + + if (ddbstat->dev != ddb_stats_table[table].dev) + { + ircd_snprintf(0, buf, sizeof(buf), "DEVICE %llu<>%llu", + ddbstat->dev, ddb_stats_table[table].dev); + space = " "; + Debug((DEBUG_INFO, "check_corrupt1: %s", buf)); + } + + if (ddbstat->ino != ddb_stats_table[table].ino) + { + ircd_snprintf(0, buf + strlen(buf), sizeof(buf), "%sINODE %llu<>%llu", + space, ddbstat->ino, ddb_stats_table[table].ino); + space = " "; + Debug((DEBUG_INFO, "check_corrupt2: %s", buf)); + } + + if (ddbstat->size != ddb_stats_table[table].size) + { + ircd_snprintf(0, buf + strlen(buf), sizeof(buf), "%sSIZE %llu<>%llu", + space, ddbstat->size, ddb_stats_table[table].size); + space = " "; + Debug((DEBUG_INFO, "check_corrupt3: %s", buf)); + } + + if (ddbstat->mtime != ddb_stats_table[table].mtime) + { + ircd_snprintf(0, buf + strlen(buf), sizeof(buf), "%sMTIME %llu<>%llu", + space, ddbstat->mtime, ddb_stats_table[table].mtime); + Debug((DEBUG_INFO, "check_corrupt4: %s", buf)); + } + Debug((DEBUG_INFO, "check_corrupt: %s", buf)); + ircd_strncpy(msg, buf, strlen(buf)); + } +/* TODO */ + return NULL; + return msg; +} Index: ircd-ircdev/ircd/ddb_db_template.c diff -u ircd-ircdev/ircd/ddb_db_template.c:1.1 ircd-ircdev/ircd/ddb_db_template.c:1.2 --- ircd-ircdev/ircd/ddb_db_template.c:1.1 Wed Mar 23 10:34:47 2005 +++ ircd-ircdev/ircd/ddb_db_template.c Mon May 16 03:17:27 2005 @@ -1,9 +1,8 @@ /* - * IRC-Dev IRCD - An advanced and innovative IRC Daemon, ircd/ddb_db_example.c + * IRC-Dev IRCD - An advanced and innovative IRC Daemon, ircd/ddb_db_template.c * * Copyright (C) 2002-2005 IRC-Dev Development Team <de...@ir...> * Copyright (C) 2004-2005 Toni Garcia (zoltan) <zo...@ir...> - * Copyright (C) 1999-2003 Jesus Cea Avion <jc...@ar...> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -21,59 +20,150 @@ * */ /** @file - * @brief Implementation of Distributed DataBase. - * @version $Id: ddb_db_template.c,v 1.1 2005/03/23 18:34:47 zolty Exp $ + * @brief Template DataBase mplementation of Distributed DataBases. + * @version $Id: ddb_db_template.c,v 1.2 2005/05/16 10:17:27 zolty Exp $ */ #include "config.h" #include "ddb.h" +#include "client.h" +#include "ircd.h" +#include "ircd_log.h" +#include "ircd_snprintf.h" +#include "ircd_string.h" +#include "msg.h" #include "numnicks.h" +#include "send.h" -#include <fcntl.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <sys/mman.h> -#include <sys/stat.h> -#include <unistd.h> +/* #include <assert.h> -- Now using assert in ircd_log.h */ -int -ddb_db_open(unsigned char table, unsigned int id, struct ddb_memory_table *mt) +/** Initialize database gestion module of + * %DDB Distributed DataBases. + */ +void +ddb_db_init(void) { - return 1; } - -void ddb_db_close(struct ddb_memory_table *mt) +/** Read the table. + * @param[in] cptr %Server if is exists, it sends to server. + * @param[in] table Table of the %DDB Distributed DataBase. + * @param[in] id ID number in the table. + * @param[in] count Number of registers to be read. + * @return 1 No data pending, 0 have data pending, -1 error. + */ +int +ddb_db_read(struct Client *cptr, unsigned char table, unsigned int id, int count) { -} + int int_return; -int ddb_db_read(struct ddb_memory_table *mt, char *mask, char *id, char *key, char *content) -{ - return 1; -} + int_return = 1; /* 1 = success */ + + /* Open file or database */ -void ddb_db_write(unsigned char table, char *mask, unsigned int id, char *key, char *content) + + /* Read registers */ + do + { + if (!cptr) + /* IRCD starting */ + ddb_new_register(NULL, table, mask, cid, key, content); + else + { + /* Burst */ + if (content) + sendcmdto_one(&me, CMD_DB, cptr, "%s %u %c %s :%s", + mask, cid, table, key, content); + else + sendcmdto_one(&me, CMD_DB, cptr, "%s %u %c %s", + mask, cid, table, key); + + if (!(--cont)) + { + int_return = 0; + break; + } + } + + } while(0) /* While read function */ + + /* Close File or Database */ + + return int_return; +} + +/** Write the table. + * @param[in] table Table of the %DDB Distributed DataBase. + * @param[in] id ID number in the table. + * @param[in] mask Mask of the server. + * @param[in] key Key of the registry. + * @param[in] content Content of the registry. + */ +void +ddb_db_write(unsigned char table, char *mask, unsigned int id, char *key, char *content) { + char buf[1024]; + + ircd_snprintf(0, buf, sizeof(buf), "%d %s %s%s%s\n", id, mask, key, + content ? " " : "", content ? content : ""); } -void ddb_db_drop(unsigned char table) +/** Delete a table. + * @param[in] table Table of the %DDB Distributed DataBase. + */ +void +ddb_db_drop(unsigned char table) { } +/** Pack the table. + * @param[in] table Table of the %DDB Distributed DataBase. + */ void ddb_db_compact(unsigned char table, char *mask, unsigned int id, char *comment) { - } +/** Read the hashes. + * @param[in] table Table of the %DDB Distributed DataBase. + * @param[out] hi Hi hash. + * @param[out] lo Lo hash. + */ +void +ddb_db_hash_read(unsigned char table, unsigned int *hi, unsigned int *lo) +{ + char buf[30]; + + /* Read buf + * buf = lala; + */ + buf[12] = '\0'; + c = buf[6]; + buf[6] = '\0'; + *hi = base64toint(buf); + buf[6] = c; + *lo = base64toint(buf + 6); +} -void ddb_hash_read(unsigned char table, unsigned int *hi, unsigned int *lo) +/** Write the hash. + * @param[in] table Table of the %DDB Distributed DataBase. + */ +void +ddb_db_hash_write(unsigned char table) { + char hash[20]; + + inttobase64(hash, ddb_hashtable_hi[table], 6); + inttobase64(hash + 6, ddb_hashtable_lo[table], 6); + ircd_snprintf(0, path, sizeof(path), "%c %s\n", table, hash); } -void ddb_hash_write(unsigned char table) +/** Executes whe finalizes the %DDB subsystem. + */ +void +ddb_db_end(void) { } + Index: ircd-ircdev/ircd/ddb_events.c diff -u ircd-ircdev/ircd/ddb_events.c:1.3 ircd-ircdev/ircd/ddb_events.c:1.4 --- ircd-ircdev/ircd/ddb_events.c:1.3 Sat May 7 15:23:40 2005 +++ ircd-ircdev/ircd/ddb_events.c Mon May 16 03:17:27 2005 @@ -20,8 +20,8 @@ * */ /** @file - * @brief Events of Distributed DataBase. - * @version $Id: ddb_events.c,v 1.3 2005/05/07 22:23:40 zolty Exp $ + * @brief Events of Distributed DataBases. + * @version $Id: ddb_events.c,v 1.4 2005/05/16 10:17:27 zolty Exp $ */ #include "config.h" @@ -39,14 +39,17 @@ #include <stdio.h> #include <string.h> - +/** It indicates events is initialized */ static int events_init = 0; +/** Events table engine */ +ddb_events_table_td ddb_events_table[DDB_TABLE_MAX]; + 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_td ddb_events_table[DDB_TABLE_MAX]; - +/** Initialize events module of %DDB Distributed DataBases. + */ void ddb_events_init(void) { @@ -60,7 +63,11 @@ events_init = 1; } - +/** Handle events on Nick Table. + * @param[in] key Key of registry. + * @param[in] content Content of registry. + * @param[in] update Update of registry or no. + */ static void ddb_events_table_n(char *key, char *content, int update) { @@ -86,20 +93,17 @@ send_umode_out(cptr, cptr, &oldflags, IsRegistered(cptr)); } - else + else if (content) { /* New Key or Update Key */ - char c = content[strlen(content) - 1]; int nick_suspend = 0; - int nick_forbid = 0; - if (c == '+') + if (content[strlen(content) - 1] == '+') nick_suspend = 1; - else if (c == '*') - nick_forbid = 1; - if (nick_forbid) + if (*content == '*') { + /* Forbid Nick */ sendcmdbotto_one(botname, CMD_NOTICE, cptr, "%C :*** Your nick %C has been forbided, cannot be used", cptr, cptr); nick_renames = 1; @@ -180,6 +184,11 @@ } } +/** Handle events on Config Table. + * @param[in] key Key of registry. + * @param[in] content Content of registry. + * @param[in] update Update of registry or no. + */ static void ddb_events_table_z(char *key, char *content, int update) { Index: ircd-ircdev/ircd/ircd_log.c diff -u ircd-ircdev/ircd/ircd_log.c:1.10 ircd-ircdev/ircd/ircd_log.c:1.11 --- ircd-ircdev/ircd/ircd_log.c:1.10 Sat May 7 15:23:40 2005 +++ ircd-ircdev/ircd/ircd_log.c Mon May 16 03:17:27 2005 @@ -22,7 +22,7 @@ */ /** @file * @brief IRC logging implementation. - * @version $Id: ircd_log.c,v 1.10 2005/05/07 22:23:40 zolty Exp $ + * @version $Id: ircd_log.c,v 1.11 2005/05/16 10:17:27 zolty Exp $ */ #include "config.h" @@ -157,7 +157,7 @@ S(WHO, -1, 0), S(NETWORK, -1, SNO_NETWORK), #ifdef DDB - S(DDB, -1, 0), + S(DDB, -1, SNO_NETWORK), #endif S(OPERKILL, -1, 0), S(SERVKILL, -1, 0), Index: ircd-ircdev/ircd/m_db.c diff -u ircd-ircdev/ircd/m_db.c:1.5 ircd-ircdev/ircd/m_db.c:1.6 --- ircd-ircdev/ircd/m_db.c:1.5 Sat May 7 15:23:40 2005 +++ ircd-ircdev/ircd/m_db.c Mon May 16 03:17:27 2005 @@ -22,17 +22,17 @@ */ /** @file * @brief Handlers for DB command. - * @version $Id: m_db.c,v 1.5 2005/05/07 22:23:40 zolty Exp $ + * @version $Id: m_db.c,v 1.6 2005/05/16 10:17:27 zolty Exp $ */ -/* TODO-ZOLTAN - * Traducidr los comentarios al ingles */ #include "config.h" #include "ddb.h" #include "client.h" #include "ircd.h" +#include "ircd_features.h" #include "ircd_log.h" #include "ircd_reply.h" +#include "ircd_snprintf.h" #include "list.h" #include "match.h" #include "msg.h" @@ -88,18 +88,18 @@ id = atoi(parv[2]); if (!id) { - /* No es un registro */ + /* It is not a register */ id = atoi(parv[4]); if (parc == 6) { table = *parv[5]; if ((table < DDB_INIT) || (table > DDB_END)) { - /* Se pide un HASH Global de todas las tablas */ + /* A global HASH of all the tables is requested */ if ((table == '*') && ((*parv[3] == 'Q') || (*parv[3] == 'R'))) table = '*'; #if 1 - /* COMPATIBILIDAD IRC-HISPANO */ + /* ESNET Compatibility */ else if (table == '2') table = DDB_NICKDB; #endif @@ -114,7 +114,7 @@ switch (*parv[3]) { - /* Peticion de Burst (quedan registros) */ + /* Burst command (Pending registers for send) */ case 'B': if (IsHub(cptr)) sendcmdto_one(&me, CMD_DB, cptr, "%s 0 J %u %c", parv[0], ddb_id_table[table], table); @@ -126,61 +126,60 @@ if (!IsHub(cptr)) break; - /* Enviamos el mensaje al resto de servidores */ + /* Send the message to the rest of servers */ for (lp = cli_serv(&me)->down; lp; lp = lp->next) { if (lp->value.cptr != cptr) { sendcmdto_one(&me, CMD_DB, lp->value.cptr, "%s 0 D %s %c", parv[1], parv[4], table); - /* TODO-ZOLTAN: Mirar si es necesario (IRC-Hispano) */ + /* TODO-ZOLTAN: Mirar si es necesario (ESNET) */ /* cli_serv(lp->value.cptr)->ddb_open &= ~ddb_mask); */ } } - - /* Usamos collapse+match por un bug en lastNNServer del find_match_server() */ + + /* For lastNNServer bug (find_match_server) it use collapse + match */ collapse(parv[1]); - /* Si no es para nosotros, lo ignoramos */ + /* If it is not for us, it ignored */ if (match(parv[1], cli_name(&me))) break; - /* Borramos la tabla en memoria y en disco */ + /* Drop the table on memory and disk */ ddb_drop(table); - /* Desconectamos con todos los hubs menos el que nos envia la orden */ - log_write(LS_DDB, L_INFO, 0, "DB Drop Table %c from %#C", table, cptr); - ircd_snprintf(0, ddb_buf, sizeof(ddb_buf), "DB DROP Table %c from %s", - table, cli_name(cptr)); + /* Disconnect with all hubs except which it sends to us */ + log_write(LS_DDB, L_INFO, 0, "DB Drop Table %c from %C", table, cptr); + ircd_snprintf(0, ddb_buf, sizeof(ddb_buf), "DB DROP Table %c from %C", + table, cptr); ddb_splithubs_butone(cptr, ddb_buf); - /* Mandamos la respuesta de conformidad */ + /* Send the conformity response */ sendcmdto_one(&me, CMD_DB, cptr, "%s 0 E %s %c", cli_name(cptr), parv[4], table); /* TODO-ZOLTAN: Creo que hay que mandar a todos */ cli_serv(cptr)->ddb_open &= ~ddb_mask; - /* Solicitamos de nuevo la tabla */ sendcmdto_one(&me, CMD_DB, cptr, "%s 0 J %u %c", cli_name(cptr), ddb_id_table[table], table); break; } - /* Respuesta de Drop */ + /* Drop response */ case 'E': - /* Si no es para nosotros, lo pasamos a otros */ + /* If it is not for us, passed it to others */ if ((acptr = find_match_server(parv[1])) && (!IsMe(acptr))) sendcmdto_one(sptr, CMD_DB, acptr, "%s 0 E %s %c", cli_name(acptr), parv[4], table); break; - /* Comprobacion de Hash automatico leaf <=> hub */ + /* Automatic verification of HASH leaf <=> Hub */ case 'H': { char *hash; unsigned int hash_lo, hash_hi; - if (IsHub(&me)) + if (feature_bool(FEAT_HUB)) return protocol_violation(cptr, "Don't HASH check to HUBs, table %c from %#C", table, cptr); hash = parv[4]; @@ -192,58 +191,59 @@ hash[6] = parv[4][6]; hash_hi = base64toint(hash + 6); + sendto_opmask_butone(0, SNO_OLDSNO, "Lo: %d Hashtable_Lo: %d Hi: %d Hashtable_Hi %d", + hash_lo, ddb_hashtable_lo[table], hash_hi, ddb_hashtable_hi[table]); +#if 0 if (!((hash_lo == ddb_hashtable_lo[table]) && (hash_hi == ddb_hashtable_hi[table]))) { - /* El HASH es incorrecto, a borrar */ - sendto_opmask_butone(0, SNO_OLDSNO, "DB HASH Check failed, droping table %c", table); + /* The HASH is incorrect, to erase */ log_write(LS_DDB, L_INFO, 0, "DB HASH Check failed, droping table %c", table); - /* Borramos la tabla en memoria y en disco*/ + /* Drop the table on memory and disk */ ddb_drop(table); - /* Solicitamos de nuevo la tabla */ sendcmdto_one(&me, CMD_DB, cptr, "%s 0 J %u %c", cli_name(cptr), ddb_id_table[table], table); } +#endif break; } /* Join */ case 'J': { - int burst; + int end_burst; if (id >= ddb_id_table[table]) { - /* Registros individuales */ + /* Individual registers*/ cli_serv(cptr)->ddb_open |= ddb_mask; break; } else if ((cli_serv(cptr)->ddb_open) & ddb_mask) { - /* Grifo abierto y registros antiguos. - * Ocurre si la copia de cptr de la DDB - * esta corrupta + /* Open faucet and old registers. + * It happens if the copy of cptr of the DDB + * is corrupt. */ (cli_serv(cptr)->ddb_open) &= ~ddb_mask; - /* Borramos su DDB para curarnos en salud */ + /* Drop your DDB */ sendcmdto_one(&me, CMD_DB, cptr, "%s 0 D DDB_CORRUPT %c", cli_name(cptr), table); break; } - /* En el Burst de tabla, se hacen rafagas de 1000 registros, - * se envia una en cada petición de JOIN. La funcion devuelve 1 - * si se han mandado todos los datos en el rafaga y 0 si aún hay - * datos pendientes. - * La comprobacion automatica de HASH solo se debe hacer a los - * leafs, NUNCA a HUBS, ya que si un HUB tiene la DB corrupta, - * toda la red se va a tomar por viento con un borrado masivo. + /* In the burst of table, bursts become of 1000 registers, is send + * one in each JOIN request. This function gives back 1 if all the + * data is sent and 0 if still there are pending data. + * The automatic HASH verification is due to do to leafs, NEVER to + * HUBS, since if a HUB has the corrupt DB, all the network is down + * by wind with a massive erasure. */ - burst = ddb_db_read(cptr, table, (id + 1), 1000); - if (burst == 1) + end_burst = ddb_db_read(cptr, table, (id + 1), 1000); + if (end_burst == 1) { cli_serv(cptr)->ddb_open |= ((unsigned int)1) << (table - DDB_INIT); if (IsHub(cptr)) @@ -254,26 +254,26 @@ sendcmdto_one(&me, CMD_DB, cptr, "%s 0 H %s %c", cli_name(cptr), ddb_buf, table); } - else if (burst == 0) + else if (end_burst == 0) sendcmdto_one(&me, CMD_DB, cptr, "%s 0 B %u %c", cli_name(cptr), ddb_id_table[table], table); break; } - /* Query de hash para comprobaciones desde un service */ + /* Hash Query command for verify from a service */ case 'Q': { if (!IsHub(cptr)) break; - /* Usamos collapse+match por un bug en lastNNServer del find_match_server() */ + /* For lastNNServer bug (find_match_server) it use collapse + match */ collapse(parv[1]); - /* Solo si es para nosotros si lo ignoramos */ + /* If it is not for us, passed it to others */ if (!match(parv[1], cli_name(&me))) { if (table == '*') { - /* HASH de todas las tablas */ + /* HASH of all the tables */ unsigned int hashes_hi = 0; unsigned int hashes_lo = 0; unsigned int id_tables = 1; @@ -297,7 +297,7 @@ } else { - /* Una tabla */ + /* One table */ inttobase64(ddb_buf, ddb_hashtable_hi[table], 6); inttobase64(ddb_buf + 6, ddb_hashtable_lo[table], 6); @@ -307,7 +307,7 @@ } } - /* Enviamos la petición a los demas */ + /* Send the petition to the others */ for (lp = cli_serv(&me)->down; lp; lp = lp->next) { if (lp->value.cptr != cptr) @@ -317,52 +317,44 @@ break; } - /* Respuesta de hash */ + /* Hash response */ case 'R': - /* Si no es para nosotros, lo pasamos a otros */ + /* If it is not for us, passed it to others */ if ((acptr = find_match_server(parv[1])) && (!IsMe(acptr))) sendcmdto_one(sptr, CMD_DB, acptr, "%s 0 R %s %c", cli_name(acptr), parv[4], table); break; - /* Registro nuevo, el parv[3] es la tabla */ + /* New register, parv[3] is the table */ default: { int delete; - /* Solo se aceptan registros procedentes de un HUB */ -/* Hablitarlo + /* Only accepted registers coming from a HUB */ if (!IsHub(cptr)) return 0; -*/ + table = *parv[3]; if (table < DDB_INIT || table > DDB_END) - { -#if 0 - /* COMPATIBILIDAD IRC-HISPANO */ - if (table == 'N') - table = DDB_NICKDB; -#endif return 0; - } id = atoi(parv[2]); - /* Rechazamos registros con ID inferior al nuestro */ + /* Rejected registers with ID lower to our */ if (id <= ddb_id_table[table]) return 0; if (parc == 5) - /* Borrado del registro */ + /* Delete register */ delete = 1; else if (parc > 5) - /* Insertado del registro */ + /* Add register */ delete = 0; else - /* No deberia ocurrir */ return protocol_violation(sptr, "DB Incorrect parameters"); ddb_mask = ((unsigned int) 1) << (table - DDB_INIT); - /* Propagamos a nuestros servidores hijos */ + + /* Propagated to our child servers */ for (lp = cli_serv(&me)->down; lp; lp = lp->next) { if ((lp->value.cptr != cptr) && @@ -378,11 +370,9 @@ } if (strcmp(parv[4], "*")) - ddb_new_register(cptr, table, parv[1], id, parv[4], (!delete ? parv[5] : NULL)); -/* + ddb_new_register(cptr, table, id, parv[1], parv[4], (!delete ? parv[5] : NULL)); else - ddb_compact(table, parv[1], id, parv[5]); -*/ + ddb_compact(table, id, parv[5]); break; } Index: ircd-ircdev/ircd/m_dbq.c diff -u ircd-ircdev/ircd/m_dbq.c:1.3 ircd-ircdev/ircd/m_dbq.c:1.4 --- ircd-ircdev/ircd/m_dbq.c:1.3 Wed Mar 23 10:34:51 2005 +++ ircd-ircdev/ircd/m_dbq.c Mon May 16 03:17:27 2005 @@ -21,7 +21,7 @@ */ /** @file * @brief Handlers for DBQ command. - * @version $Id: m_dbq.c,v 1.3 2005/03/23 18:34:51 zolty Exp $ + * @version $Id: m_dbq.c,v 1.4 2005/05/16 10:17:27 zolty Exp $ */ #include "config.h" @@ -77,7 +77,7 @@ if (parc == 3) { - server = NULL; /* no nos indican server */ + server = NULL; table = *parv[parc - 2]; key = parv[parc - 1]; } @@ -96,15 +96,14 @@ /* NOT BROADCAST */ if (!(acptr = find_match_server(server))) { - /* joer, el server de destino no existe */ send_reply(sptr, ERR_NOSUCHSERVER, server); return 0; } - if (!IsMe(acptr)) /* no es para mi, a rutar */ + if (!IsMe(acptr)) { sendcmdto_one(acptr, CMD_DBQ, sptr, "%s %c %s", server, table, key); - return 0; /* ok, rutado, fin del trabajo */ + return 0; } } } @@ -129,11 +128,11 @@ sendcmdto_one(&me, CMD_NOTICE, sptr, "%C :DBQ OK Table='%c' Key='%s' Content='%... [truncated message content] |
From: Toni G. <zo...@us...> - 2005-05-16 19:51:49
|
CVSROOT : /cvsroot/irc-dev Module : ircd-ircdev Commit time: 2005-05-16 11:31:30 UTC Modified files: ChangeLog ChangeLog.es include/patchlevel.h Added files: ircd/test/channel-1.cmd ircd/test/client-1.cmd ircd/test/die.cmd ircd/test/gline-1.cmd ircd/test/ircd-t1.conf ircd/test/run-tests.sh ircd/test/stats-1.cmd ircd/test/test-driver.pl Log message: Author: zoltan <zo...@ir...> Log message: 2005-05-16 Toni García <zo...@ir...> 1.0.alpha35 * Utilidades de Testing ---------------------- diff included ---------------------- Index: ircd-ircdev/ChangeLog diff -u ircd-ircdev/ChangeLog:1.36 ircd-ircdev/ChangeLog:1.37 --- ircd-ircdev/ChangeLog:1.36 Mon May 16 04:22:48 2005 +++ ircd-ircdev/ChangeLog Mon May 16 04:31:19 2005 @@ -1,10 +1,13 @@ # # ChangeLog for ircd-ircdev # -# $Id: ChangeLog,v 1.36 2005/05/16 11:22:48 zolty Exp $ +# $Id: ChangeLog,v 1.37 2005/05/16 11:31:19 zolty Exp $ # # Insert new changes at beginning of the change list. # +2005-05-16 Toni García <zo...@ir...> 1.0.alpha35 + * Testing tools + 2005-05-16 Toni García <zo...@ir...> 1.0.alpha34 * Undernet synchronization Index: ircd-ircdev/ChangeLog.es diff -u ircd-ircdev/ChangeLog.es:1.36 ircd-ircdev/ChangeLog.es:1.37 --- ircd-ircdev/ChangeLog.es:1.36 Mon May 16 04:22:48 2005 +++ ircd-ircdev/ChangeLog.es Mon May 16 04:31:19 2005 @@ -1,10 +1,13 @@ # # Log de Cambios para ircd-ircdev # -# $Id: ChangeLog.es,v 1.36 2005/05/16 11:22:48 zolty Exp $ +# $Id: ChangeLog.es,v 1.37 2005/05/16 11:31:19 zolty Exp $ # # Insertar los nuevos cambios al principio de esta lista de cambios. # +2005-05-16 Toni García <zo...@ir...> 1.0.alpha35 + * Utilidades de Testing + 2005-05-16 Toni García <zo...@ir...> 1.0.alpha34 * Sincronización Undernet Index: ircd-ircdev/include/patchlevel.h diff -u ircd-ircdev/include/patchlevel.h:1.35 ircd-ircdev/include/patchlevel.h:1.36 --- ircd-ircdev/include/patchlevel.h:1.35 Mon May 16 04:22:50 2005 +++ ircd-ircdev/include/patchlevel.h Mon May 16 04:31:20 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.35 2005/05/16 11:22:50 zolty Exp $ + * $Id: patchlevel.h,v 1.36 2005/05/16 11:31:20 zolty Exp $ * */ -#define PATCHLEVEL ".alpha34" +#define PATCHLEVEL ".alpha35" #define RELEASE "1.0" Index: ircd-ircdev/ircd/test/channel-1.cmd diff -u /dev/null ircd-ircdev/ircd/test/channel-1.cmd:1.1 --- /dev/null Mon May 16 04:31:30 2005 +++ ircd-ircdev/ircd/test/channel-1.cmd Mon May 16 04:31:20 2005 @@ -0,0 +1,48 @@ +define srv localhost:7701 + +connect cl1 Alex alex %srv% :Test client 1 +connect cl2 Bubb bubb %srv% :Test client 2 +:cl1 join #test +:cl1 join #test2 +:cl1 mode #test +bb *!*@127.0.0.1 *!*@127.0.0.2 +:cl2 wait cl1 +:cl2 join #test +:cl1 wait cl2 +:cl1 invite Bubb #test +:cl2 expect *cl1 invite #test +:cl2 join #test +:cl2 privmsg #test :Hello, *cl1. +:cl2 nick Buba +:cl2 mode #test +l 15 +:cl1 wait cl2 +:cl1 privmsg #test :Hello, *cl2. +:cl1 mode #test -b+kv *!*@127.0.0.1 secret Bubb +:cl1 mode #test +b foo!bar@baz +:cl1 mode #test +b +:cl1 mode #test : +:cl1 mode #test +:cl1 raw who #test %lfuh +:cl2 wait cl1 +:cl2 part #test +:cl1 wait cl2 +:cl2 join #test public +:cl2 join #test secret +:cl1 join 0 +:cl1 join #test2 +:cl2 wait cl1 +:cl2 join #test2 +:cl1 wait cl2 +:cl1 mode #test2 +smtinrDlAU 15 apples oranges +:cl1 mode #test2 +:cl2 wait cl1 +:cl2 join #test2 apples +:cl2 privmsg #test2 :Hello, oplevels. +:cl2 mode #test2 +:cl2 mode #test2 -io+v Alex Alex +:cl1 wait cl2 +:cl1 part #test2 +:cl1 join #test2 +:cl2 wait cl1 +:cl2 mode #test2 -D +:cl2 mode #test +v Alex +:cl1 wait cl2 Index: ircd-ircdev/ircd/test/client-1.cmd diff -u /dev/null ircd-ircdev/ircd/test/client-1.cmd:1.1 --- /dev/null Mon May 16 04:31:30 2005 +++ ircd-ircdev/ircd/test/client-1.cmd Mon May 16 04:31:20 2005 @@ -0,0 +1,15 @@ +define srv localhost:7701 + +connect cl1 Alex alex %srv% :Test client 1 +:cl1 oper oper1 oper1 +connect cl2 Bubb bubb %srv% :Test client 2 +:cl2 oper oper3 oper4 +:cl2 oper oldoper wrongpass +:cl2 oper md5oper wrongpass +:cl2 oper cryptoper wrongpass +:cl2 oper oper2 oper2 +:cl2 raw :privs Alex Alex +:cl1 wait cl2 +:cl1 raw :privs Bubb +:cl1 nick A +:cl1 nick Alexey Index: ircd-ircdev/ircd/test/die.cmd diff -u /dev/null ircd-ircdev/ircd/test/die.cmd:1.1 --- /dev/null Mon May 16 04:31:30 2005 +++ ircd-ircdev/ircd/test/die.cmd Mon May 16 04:31:20 2005 @@ -0,0 +1,5 @@ +connect cl1 Alex alex localhost:7701 :Test client 1 +:cl1 oper oper1 oper1 +:cl1 raw :restart brb +:cl1 oper oper1 oper1 +:cl1 raw :die :testing over Index: ircd-ircdev/ircd/test/gline-1.cmd diff -u /dev/null ircd-ircdev/ircd/test/gline-1.cmd:1.1 --- /dev/null Mon May 16 04:31:30 2005 +++ ircd-ircdev/ircd/test/gline-1.cmd Mon May 16 04:31:20 2005 @@ -0,0 +1,26 @@ +define srv localhost:7701 + +connect cl1 Alex alex %srv% :Test client 1 +:cl1 oper oper1 oper1 +:cl1 raw :gline !+$Rbubb 30 :Bubb is not welcome here +:cl1 sleep 35 +:cl1 raw :gline !+127.2.* 3600 :Localclone? +:cl1 sleep 5 +:cl1 raw :gline !+127.2.* 3600 :Localclone? +connect cl2 Bubb bubb %srv% :Test client 2 +:cl1 raw :gline +:cl1 raw :gline $Rbubb +:cl1 raw :gline -$Rbubb +:cl1 wait cl2 +:cl1 raw :gline !+$Rbubb * 3600 :Bubb is not welcome here +:cl1 sleep 5 +:cl1 raw :gline -$Rbubb +:cl1 raw :gline +#warez 30 :Warez r bad mmkay +:cl2 wait cl1 +:cl2 join #warez +:cl1 sleep 35 +:cl1 raw :stats glines +:cl1 raw :gline !+*@127.0.0.2 3600 :Localclone? +:cl1 raw :gline !+127.1.* 3600 :Localclone? +:cl1 raw :stats memory +:cl2 raw :gline Index: ircd-ircdev/ircd/test/ircd-t1.conf diff -u /dev/null ircd-ircdev/ircd/test/ircd-t1.conf:1.1 --- /dev/null Mon May 16 04:31:30 2005 +++ ircd-ircdev/ircd/test/ircd-t1.conf Mon May 16 04:31:20 2005 @@ -0,0 +1,97 @@ +General { + name = "test-1.example.net"; + vhost = "127.0.0.1"; + vhost = "::1"; + description = "Test Server 1"; + numeric = 1; +}; + +Admin { + location = "Somewhere"; + contact = "Someone"; +}; + +Class { + name = "Server"; + pingfreq = 180 seconds; + connectfreq = 300 seconds; + maxlinks = 1; + sendq = 9000000; +}; + +Class { + name = "others"; + pingfreq = 180 seconds; + sendq = 160000; + maxlinks = 100; + usermode = "+oiwx"; +}; + +Class { + name = "Opers"; + pingfreq = 180 seconds; + sendq = 160000; + maxlinks = 10; + local = no; +}; + +Connect { + name = "bogus.example.net"; + host = "example.net"; + password = "bogus_example"; + port = 7700; + class = "Server"; + maxhops = 2; + hub = "*.example.net"; + autoconnect = yes; # forces a DNS resolution attempt +}; + +CRule { + server = "bogus.example.net"; + all = yes; + rule = "connected(*)"; +}; + +CRule { + server = "bogus.example.net"; + all = no; + rule = "directcon(*)"; +}; + +UWorld { + name = "uworld.example.net"; + name = "uworld2.example.net"; +}; + +Jupe { + nick = "A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q"; + nick = "R,S,T,U,V,W,X,Y,Z,{,|,},~,-,_,`"; +}; + +Operator { name = "oper1"; host = "*@*"; password = "$PLAIN$oper1"; class = "Opers"; }; +Operator { name = "oper2"; host = "*@*"; password = "$PLAIN$oper2"; class = "Opers"; local = yes; }; +Operator { name = "oldoper"; host = "*@*"; password = "Xlfc26b4eYGWs"; class = "Opers"; }; +Operator { name = "md5oper"; host = "*@*"; password = "$SMD5$2O$4O.rSAmhE4Fg05MmG.047/"; class = "Opers"; }; +Operator { name = "cryptoper"; host = "*@*"; password = "$CRYPT$41ndrxPQu3B66"; class = "Opers"; }; + +Kill { username = "sub7"; realname = "s*7*"; reason = "You are infected with a Trojan"; }; +Kill { realname = "Chloe"; reason = "drones"; }; +Kill { username = "sub7"; reason = "You are infected with a Trojan"; }; + +Client { class = "others"; ip = "*"; }; + +Port { server = yes; port = 7700; }; +Port { server = no; port = 7701; }; + +Quarantine { + "#shells" = "Thou shalt not support the h4><0rz"; +}; + +Pseudo "X" { + name = "X"; + nick = "X...@ch..."; +}; + +Features { + "HIS_STATS_k" = "FALSE"; +}; Index: ircd-ircdev/ircd/test/run-tests.sh diff -u /dev/null ircd-ircdev/ircd/test/run-tests.sh:1.1 --- /dev/null Mon May 16 04:31:30 2005 +++ ircd-ircdev/ircd/test/run-tests.sh Mon May 16 04:31:20 2005 @@ -0,0 +1,12 @@ +#! /bin/sh +set -e +srcdir=$1 +for script in channel-1 client-1 stats-1 gline-1 ; do + echo "Running test $script." + ${srcdir}/test-driver.pl ${srcdir}/${script}.cmd +done +echo "Terminating server." +${srcdir}/test-driver.pl ${srcdir}/die.cmd +../ircd -? +../ircd -v +../ircd -x 6 -k -d ${srcdir} -f ircd-t1.conf -c user@127.0.0.1 Index: ircd-ircdev/ircd/test/stats-1.cmd diff -u /dev/null ircd-ircdev/ircd/test/stats-1.cmd:1.1 --- /dev/null Mon May 16 04:31:30 2005 +++ ircd-ircdev/ircd/test/stats-1.cmd Mon May 16 04:31:20 2005 @@ -0,0 +1,91 @@ +# Connect to server +connect cl1 Alex alex localhost:7701 :Test client 1 +:cl1 oper oper1 oper1 + +# Single letter stats commands +:cl1 raw :stats a +:cl1 raw :stats c +:cl1 raw :stats d +:cl1 raw :stats D +:cl1 raw :stats e +:cl1 raw :stats f +:cl1 raw :stats g +:cl1 raw :stats i +:cl1 raw :stats j +:cl1 raw :stats J +:cl1 raw :stats k +:cl1 raw :stats l +:cl1 raw :stats L +:cl1 raw :stats m +:cl1 raw :stats o +:cl1 raw :stats p +:cl1 raw :stats q +:cl1 raw :stats r +:cl1 raw :stats R +:cl1 raw :stats t +:cl1 raw :stats T +:cl1 raw :stats u +:cl1 raw :stats U +:cl1 raw :stats v +:cl1 raw :stats V +:cl1 raw :stats w +:cl1 raw :stats x +:cl1 raw :stats z +:cl1 raw :stats * + +# Named stats commands +:cl1 raw :stats nameservers +:cl1 raw :stats connect +:cl1 raw :stats maskrules +:cl1 raw :stats crules +:cl1 raw :stats engine +:cl1 raw :stats features +:cl1 raw :stats glines +:cl1 raw :stats access +:cl1 raw :stats histogram +:cl1 raw :stats jupes +:cl1 raw :stats klines +:cl1 raw :stats links +:cl1 raw :stats modules +:cl1 raw :stats commands +:cl1 raw :stats operators +:cl1 raw :stats ports +:cl1 raw :stats quarantines +:cl1 raw :stats mappings +:cl1 raw :stats usage +:cl1 raw :stats motds +:cl1 raw :stats locals +:cl1 raw :stats uworld +:cl1 raw :stats uptime +:cl1 raw :stats vservers +:cl1 raw :stats vserversmach +:cl1 raw :stats userload +:cl1 raw :stats memusage +:cl1 raw :stats classes +:cl1 raw :stats memory +:cl1 raw :stats help +:cl1 raw :hash +:cl1 raw :rehash +:cl1 nick Alexey + +# Varparam stats +:cl1 raw :stats access * 127.0.0.1 +:cl1 raw :stats access * * +:cl1 raw :stats klines * * +:cl1 raw :stats klines * *@* +:cl1 raw :stats links * * +:cl1 raw :stats ports * 7700 +:cl1 raw :stats quarantines * #frou-frou +:cl1 raw :stats vservers * *.example.net + +# Invalid or nonexistent stats requests +:cl1 raw :stats y +:cl1 raw :stats ÿ +:cl1 raw :stats mºDãç +:cl1 raw :stats long_garbage_here_to_hopefully_trigger_the_core_reported_by_dan + +# Drop oper status and try a few others +:cl1 mode Alex -o +:cl1 raw :stats k +:cl1 raw :stats k * * +:cl1 raw :stats k * *@* Index: ircd-ircdev/ircd/test/test-driver.pl diff -u /dev/null ircd-ircdev/ircd/test/test-driver.pl:1.1 --- /dev/null Mon May 16 04:31:30 2005 +++ ircd-ircdev/ircd/test/test-driver.pl Mon May 16 04:31:20 2005 @@ -0,0 +1,541 @@ +#! /usr/bin/perl -wT + +# If you edit this file, please check carefully that the garbage +# collection isn't broken. POE is sometimes too clever for our good +# in finding references to sessions, and keeps running even after we +# want to stop. +# $Id: test-driver.pl,v 1.1 2005/05/16 11:31:20 zolty Exp $ + +# This interprets a simple scripting language. Lines starting with a +# hash mark (#, aka octothorpe, pound sign, etc) are ignored. The +# special commands look like this, where angle brackets indicate a +# metavariable: +# define <macro> <value> +# undef <macro> +# connect <name> <nick> <ident> <server> :<userinfo> +# sync <name1>,<name2>[,<name3>]* +# :<name> <command>[ <args]* +# For the last line syntax, <command> may be an IRC or IRC-like +# command. Supported non-IRC commands are: +# :<name> expect <source|*name2> [...] +# :<name> raw <text> +# :<name> sleep <seconds> +# :<name> wait <name2> + +require 5.006; + +use bytes; +use warnings; +use strict; +use vars; +use constant DELAY => 2; +use constant EXPECT_TIMEOUT => 15; +use constant RECONNECT_TIMEOUT => 5; +use constant THROTTLED_TIMEOUT => 90; + +use FileHandle; +use POE; +use POE::Component::IRC; + +# this defines commands that take "zero time" to execute +# (specifically, those which do not send commands from the issuing +# client to the server) +our $zero_time = { + expect => 1, + sleep => 1, + wait => 1, + }; + +# Create the main session and start POE. +# All the empty anonymous subs are just to make POE:Session::ASSERT_STATES happy. +POE::Session->create(inline_states => + { + # POE kernel interaction + _start => \&drv_start, + _child => sub {}, + _stop => sub { + my $heap = $_[HEAP]; + print "\nThat's all, folks!"; + print "(exiting at line $heap->{lineno}: $heap->{line})" + if $heap->{line}; + print "\n"; + }, + _default => \&drv_default, + # generic utilities or miscellaneous functions + heartbeat => \&drv_heartbeat, + timeout_expect => \&drv_timeout_expect, + reconnect => \&drv_reconnect, + enable_client => sub { $_[ARG0]->{ready} = 1; }, + disable_client => sub { $_[ARG0]->{ready} = 0; }, + die => sub { $_[KERNEL]->signal($_[SESSION], 'TERM'); }, + # client-based command issuers + cmd_die => \&cmd_generic, + cmd_expect => \&cmd_expect, + cmd_invite => \&cmd_generic, + cmd_join => \&cmd_generic, + cmd_mode => \&cmd_generic, + cmd_nick => \&cmd_generic, + cmd_notice => \&cmd_message, + cmd_oper => \&cmd_generic, + cmd_part => \&cmd_generic, + cmd_privmsg => \&cmd_message, + cmd_quit => \&cmd_generic, + cmd_raw => \&cmd_raw, + cmd_sleep => \&cmd_sleep, + cmd_wait => \&cmd_wait, + # handlers for messages from IRC + irc_001 => \&irc_connected, # Welcome to ... + irc_snotice => sub {}, # notice from a server (anonymous/our uplink) + irc_notice => \&irc_notice, # NOTICE to self or channel + irc_msg => \&irc_msg, # PRIVMSG to self + irc_public => \&irc_public, # PRIVMSG to channel + irc_connected => sub {}, + irc_ctcp_action => sub {}, + irc_ctcp_ping => sub {}, + irc_ctcp_time => sub {}, + irc_ctcpreply_ping => sub {}, + irc_ctcpreply_time => sub {}, + irc_invite => \&irc_invite, # INVITE to channel + irc_join => sub {}, + irc_kick => sub {}, + irc_kill => sub {}, + irc_mode => sub {}, + irc_nick => sub {}, + irc_part => sub {}, + irc_ping => sub {}, + irc_quit => sub {}, + irc_topic => sub {}, + irc_error => \&irc_error, + irc_disconnected => \&irc_disconnected, + irc_socketerr => \&irc_socketerr, + }, + args => [@ARGV]); + +$| = 1; +$poe_kernel->run(); +exit; + +# Core/bookkeeping test driver functions + +sub drv_start { + my ($kernel, $session, $heap) = @_[KERNEL, SESSION, HEAP]; + + # initialize heap + $heap->{clients} = {}; # session details, indexed by (short) session name + $heap->{sessions} = {}; # session details, indexed by session ref + $heap->{servers} = {}; # server addresses, indexed by short names + $heap->{macros} = {}; # macros + + # Parse arguments + foreach my $arg (@_[ARG0..$#_]) { + if ($arg =~ /^-D$/) { + $heap->{irc_debug} = 1; + } elsif ($arg =~ /^-V$/) { + $heap->{verbose} = 1; + } elsif ($arg =~ /^-vhost=(.*)$/) { + $heap->{vhost} = $1; + } else { + die "Extra command-line argument $arg\n" if $heap->{script}; + $heap->{script} = new FileHandle($arg, 'r') + or die "Unable to open $arg for reading: $!\n"; + } + } + die "No test name specified\n" unless $heap->{script}; + + # hook in to POE + $kernel->alias_set('control'); + $kernel->yield('heartbeat'); +} + +sub drv_heartbeat { + my ($kernel, $session, $heap) = @_[KERNEL, SESSION, HEAP]; + my $script = $heap->{script}; + my $used = {}; + my $delay = DELAY; + + while (1) { + my ($line, $lineno); + if ($heap->{line}) { + $line = delete $heap->{line}; + } elsif (defined($line = <$script>)) { + $heap->{lineno} = $.; + print "." unless $heap->{irc_debug}; + } else { + # close all connections + foreach my $client (values %{$heap->{clients}}) { + $kernel->call($client->{irc}, 'quit', "I fell off the end of my script"); + $client->{quitting} = 1; + } + # unalias the control session + $kernel->alias_remove('control'); + # die in a few seconds + $kernel->delay_set('die', 5); + return; + } + + chomp $line; + # ignore comments and blank lines + next if $line =~ /^\#/ or $line !~ /\S/; + + # expand any macros in the line + $line =~ s/(?<=[^\\])%(\S+?)%/$heap->{macros}->{$1} + or die "Use of undefined macro $1 at $heap->{lineno}\n"/eg; + # remove any \-escapes + $line =~ s/\\(.)/$1/g; + # figure out the type of line + if ($line =~ /^#/) { + # comment, silently ignore it + } elsif ($line =~ /^define (\S+) (.+)$/i) { + # define a new macro + $heap->{macros}->{$1} = $2; + } elsif ($line =~ /^undef (\S+)$/i) { + # remove the macro + delete $heap->{macros}->{$1}; + } elsif ($line =~ /^connect (\S+) (\S+) (\S+) (\S+) :(.+)$/i) { + # connect a new session (named $1) to server $4 + my ($name, $nick, $ident, $server, $userinfo, $port) = ($1, $2, $3, $4, $5, 6667); + $server = $heap->{servers}->{$server} || $server; + if ($server =~ /(.+):(\d+)/) { + $server = $1; + $port = $2; + } + die "Client with nick $nick already exists (line $heap->{lineno})" if $heap->{clients}->{$nick}; + my $alias = "client_$name"; + POE::Component::IRC->new($alias) + or die "Unable to create new user $nick (line $heap->{lineno}): $!"; + my $client = { name => $name, + nick => $nick, + ready => 0, + expect => [], + expect_alarms => [], + irc => $kernel->alias_resolve($alias), + params => { Nick => $nick, + Server => $server, + Port => $port, + Username => $ident, + Ircname => $userinfo, + Debug => $heap->{irc_debug}, + } + }; + $client->params->{LocalAddr} = $heap->{vhost} + if $heap->{vhost}; + $heap->{clients}->{$client->{name}} = $client; + $heap->{sessions}->{$client->{irc}} = $client; + $kernel->call($client->{irc}, 'register', 'all'); + $kernel->call($client->{irc}, 'connect', $client->{params}); + $used->{$name} = 1; + } elsif ($line =~ /^sync (.+)$/i) { + # do multi-way synchronization between every session named in $1 + my @synced = split(/,|\s/, $1); + # first, check that they exist and are ready + foreach my $clnt (@synced) { + die "Unknown session name $clnt (line $heap->{lineno})" unless $heap->{clients}->{$clnt}; + goto REDO unless $heap->{clients}->{$clnt}->{ready}; + } + # next we actually send the synchronization signals + foreach my $clnt (@synced) { + my $client = $heap->{clients}->{$clnt}; + $client->{sync_wait} = [map { $_ eq $clnt ? () : $heap->{clients}->{$_}->{nick} } @synced]; + $kernel->call($client->{irc}, 'notice', $client->{sync_wait}, 'SYNC'); + $kernel->call($session, 'disable_client', $client); + } + } elsif ($line =~ /^:(\S+) (\S+)(.*)$/i) { + # generic command handler + my ($names, $cmd, $args) = ($1, lc($2), $3); + my (@avail, @unavail); + # figure out whether each listed client is available or not + foreach my $c (split ',', $names) { + my $client = $heap->{clients}->{$c}; + if (not $client) { + print "ERROR: Unknown session name $c (line $heap->{lineno}; ignoring)\n"; + } elsif (($used->{$c} and not $zero_time->{$cmd}) or not $client->{ready}) { + push @unavail, $c; + } else { + push @avail, $c; + } + } + # redo command with unavailable clients + if (@unavail) { + # This will break if the command can cause a redo for + # available clients.. this should be fixed sometime + $line = ':'.join(',', @unavail).' '.$cmd.$args; + $heap->{redo} = 1; + } + # do command with available clients + if (@avail) { + # split up the argument part of the line + $args =~ /^((?:(?: [^:])|[^ ])+)?(?: :(.+))?$/; + $args = [($1 ? split(' ', $1) : ()), ($2 ? $2 : ())]; + # find the client and figure out if we need to wait + foreach my $c (@avail) { + my $client = $heap->{clients}->{$c}; + die "Client $c used twice as source (line $heap->{lineno})" if $used->{c} and not $zero_time->{$cmd}; + $kernel->call($session, 'cmd_'.$cmd, $client, $args); + $used->{$c} = 1 unless $zero_time->{$cmd}; + } + } + } else { + die "Unrecognized input line $heap->{lineno}: $line"; + } + if ($heap->{redo}) { + REDO: + delete $heap->{redo}; + $heap->{line} = $line; + last; + } + } + # issue new heartbeat with appropriate delay + $kernel->delay_set('heartbeat', $delay); +} + +sub drv_timeout_expect { + my ($kernel, $session, $client) = @_[KERNEL, SESSION, ARG0]; + print "ERROR: Dropping timed-out expectation by $client->{name}: ".join(',', @{$client->{expect}->[0]})."\n"; + $client->{expect_alarms}->[0] = undef; + unexpect($kernel, $session, $client); +} + +sub drv_reconnect { + my ($kernel, $session, $client) = @_[KERNEL, SESSION, ARG0]; + $kernel->call($client->{irc}, 'connect', $client->{params}); +} + +sub drv_default { + my ($kernel, $heap, $sender, $session, $state, $args) = @_[KERNEL, HEAP, SENDER, SESSION, ARG0, ARG1]; + if ($state =~ /^irc_(\d\d\d)$/) { + my $client = $heap->{sessions}->{$sender}; + if (@{$client->{expect}} + and $args->[0] eq $client->{expect}->[0]->[0] + and $client->{expect}->[0]->[1] eq "$1") { + my $expect = $client->{expect}->[0]; + my $mismatch; + for (my $x=2; ($x<=$#$expect) and ($x<=$#$args) and not $mismatch; $x++) { + $mismatch = 1 unless $args->[$x] =~ /$expect->[$x]/i; + } + unexpect($kernel, $session, $client) unless $mismatch; + } + return undef; + } + print "ERROR: Unexpected event $state to test driver (from ".$sender->ID.")\n"; + return undef; +} + +# client-based command issuers + +sub cmd_message { + my ($kernel, $heap, $event, $client, $args) = @_[KERNEL, HEAP, STATE, ARG0, ARG1]; + die "Missing arguments" unless $#$args >= 1; + # translate each target as appropriate (e.g. *sessionname) + my @targets = split(/,/, $args->[0]); + foreach my $target (@targets) { + if ($target =~ /^\*(.+)$/) { + my $other = $heap->{clients}->{$1} or die "Unknown session name $1 (line $heap->{lineno})\n"; + $target = $other->{nick}; + } + } + $kernel->call($client->{irc}, substr($event, 4), \@targets, $args->[1]); +} + +sub cmd_generic { + my ($kernel, $heap, $event, $client, $args) = @_[KERNEL, HEAP, STATE, ARG0, ARG1]; + $event =~ s/^cmd_//; + $kernel->call($client->{irc}, $event, @$args); +} + +sub cmd_raw { + my ($kernel, $heap, $client, $args) = @_[KERNEL, HEAP, ARG0, ARG1]; + die "Missing argument" unless $#$args >= 0; + $kernel->call($client->{irc}, 'sl', $args->[0]); +} + +sub cmd_sleep { + my ($kernel, $session, $heap, $client, $args) = @_[KERNEL, SESSION, HEAP, ARG0, ARG1]; + die "Missing argument" unless $#$args >= 0; + $kernel->call($session, 'disable_client', $client); + $kernel->delay_set('enable_client', $args->[0], $client); +} + +sub cmd_wait { + my ($kernel, $session, $heap, $client, $args) = @_[KERNEL, SESSION, HEAP, ARG0, ARG1]; + die "Missing argument" unless $#$args >= 0; + # if argument was comma-delimited, split it up (space-delimited is split by generic parser) + $args = [split(/,/, $args->[0])] if $args->[0] =~ /,/; + # make sure we only wait if all the other clients are ready + foreach my $other (@$args) { + if (not $heap->{clients}->{$other}->{ready}) { + $heap->{redo} = 1; + return; + } + } + # disable this client, make the others send SYNC to it + $kernel->call($session, 'disable_client', $client); + $client->{sync_wait} = [map { $heap->{clients}->{$_}->{nick} } @$args]; + foreach my $other (@$args) { + die "Cannot wait on self" if $other eq $client->{name}; + $kernel->call($heap->{clients}->{$other}->{irc}, 'notice', $client->{nick}, 'SYNC'); + } +} + +sub cmd_expect { + my ($kernel, $session, $heap, $client, $args) = @_[KERNEL, SESSION, HEAP, ARG0, ARG1]; + die "Missing argument" unless $#$args >= 0; + push @{$client->{expect}}, $args; + push @{$client->{expect_alarms}}, $kernel->delay_set('timeout_expect', EXPECT_TIMEOUT, $client); + $kernel->call($session, 'disable_client', $client); +} + +# handlers for messages from IRC + +sub unexpect { + my ($kernel, $session, $client) = @_; + shift @{$client->{expect}}; + my $alarm_id = shift @{$client->{expect_alarms}}; + $kernel->alarm_remove($alarm_id) if $alarm_id; + $kernel->call($session, 'enable_client', $client) unless @{$client->{expect}}; +} + +sub check_expect { + my ($kernel, $session, $heap, $poe_sender, $sender, $text) = @_[KERNEL, SESSION, HEAP, SENDER, ARG0, ARG1]; + my $client = $heap->{sessions}->{$poe_sender}; + my $expected = $client->{expect}->[0]; + + # check sender + if ($expected->[0] =~ /\*(.+)/) { + # we expect *sessionname, so look up session's current nick + my $exp = $1; + $sender =~ /^(.+)!/; + return 0 if lc($heap->{clients}->{$exp}->{nick}) ne lc($1); + } elsif ($expected->[0] =~ /^:?(.+!.+)/) { + # expect :nick!user@host, so compare whole thing + return 0 if lc($1) ne lc($sender); + } else { + # we only expect :nick, so compare that part + $sender =~ /^:?(.+)!/; + return 0 if lc($expected->[0]) ne lc($1); + } + + # compare text + return 0 if lc($text) !~ /$expected->[2]/i; + + # drop expectation of event + unexpect($kernel, $session, $client); +} + +sub irc_connected { + my ($kernel, $session, $heap, $sender) = @_[KERNEL, SESSION, HEAP, SENDER]; + my $client = $heap->{sessions}->{$sender}; + print "Client $client->{name} connected to server $_[ARG0]\n" if $heap->{verbose}; + $kernel->call($session, 'enable_client', $client); +} + +sub irc_disconnected { + my ($kernel, $session, $heap, $sender, $server) = @_[KERNEL, SESSION, HEAP, SENDER, ARG0]; + my $client = $heap->{sessions}->{$sender}; + print "Client $client->{name} disconnected from server $_[ARG0]\n" if $heap->{verbose}; + if ($client->{quitting}) { + $kernel->call($sender, 'unregister', 'all'); + delete $heap->{sessions}->{$sender}; + delete $heap->{clients}->{$client->{name}}; + } else { + if ($client->{disconnect_expected}) { + delete $client->{disconnect_expected}; + } else { + print "Got unexpected disconnect for $client->{name} (nick $client->{nick})\n"; + } + $kernel->call($session, 'disable_client', $client); + $kernel->delay_set('reconnect', $client->{throttled} ? THROTTLED_TIMEOUT : RECONNECT_TIMEOUT, $client); + delete $client->{throttled}; + } +} + +sub irc_socketerr { + my ($kernel, $session, $heap, $sender, $msg) = @_[KERNEL, SESSION, HEAP, SENDER, ARG0]; + my $client = $heap->{sessions}->{$sender}; + print "Client $client->{name} (re-)connect error: $_[ARG0]\n"; + if ($client->{quitting}) { + $kernel->call($sender, 'unregister', 'all'); + delete $heap->{sessions}->{$sender}; + delete $heap->{clients}->{$client->{name}}; + } else { + if ($client->{disconnect_expected}) { + delete $client->{disconnect_expected}; + } else { + print "Got unexpected disconnect for $client->{name} (nick $client->{nick})\n"; + } + $kernel->call($session, 'disable_client', $client); + $kernel->delay_set('reconnect', $client->{throttled} ? THROTTLED_TIMEOUT : RECONNECT_TIMEOUT, $client); + delete $client->{throttled}; + } +} + +sub irc_notice { + my ($kernel, $session, $heap, $sender, $from, $to, $text) = @_[KERNEL, SESSION, HEAP, SENDER, ARG0, ARG1, ARG2]; + my $client = $heap->{sessions}->{$sender}; + if ($client->{sync_wait} and $text eq 'SYNC') { + $from =~ s/!.+$//; + my $x; + # find who sent it.. + for ($x=0; $x<=$#{$client->{sync_wait}}; $x++) { + last if $from eq $client->{sync_wait}->[$x]; + } + # exit if we don't expect them + if ($x>$#{$client->{sync_wait}}) { + print "Got unexpected SYNC from $from to $client->{name} ($client->{nick})\n"; + return; + } + # remove from the list of people we're waiting for + splice @{$client->{sync_wait}}, $x, 1; + # re-enable client if we're done waiting + if ($#{$client->{sync_wait}} == -1) { + delete $client->{sync_wait}; + $kernel->call($session, 'enable_client', $client); + } + } elsif (@{$client->{expect}} + and $client->{expect}->[0]->[1] =~ /notice/i) { + check_expect(@_[0..ARG0], $text); + } +} + +sub irc_msg { + my ($kernel, $session, $heap, $sender, $from, $to, $text) = @_[KERNEL, SESSION, HEAP, SENDER, ARG0, ARG1, ARG2]; + my $client = $heap->{sessions}->{$sender}; + if (@{$client->{expect}} + and $client->{expect}->[0]->[1] =~ /msg/i) { + check_expect(@_[0..ARG0], $text); + } +} + +sub irc_public { + my ($kernel, $session, $heap, $sender, $from, $to, $text) = @_[KERNEL, SESSION, HEAP, SENDER, ARG0, ARG1, ARG2]; + my $client = $heap->{sessions}->{$sender}; + if (@{$client->{expect}} + and $client->{expect}->[0]->[1] =~ /public/i + and grep($client->{expect}->[0]->[2], @$to)) { + splice @{$client->{expect}->[0]}, 2, 1; + check_expect(@_[0..ARG0], $text); + } +} + +sub irc_invite { + my ($kernel, $session, $heap, $sender, $from, $to) = @_[KERNEL, SESSION, HEAP, SENDER, ARG0, ARG1, ARG2]; + my $client = $heap->{sessions}->{$sender}; + if (ref $client->{expect} eq 'ARRAY' + and $client->{expect}->[0]->[1] =~ /invite/i + and $to =~ /$client->{expect}->[0]->[2]/) { + check_expect(@_[0..ARG0], $to); + } +} + +sub irc_error { + my ($kernel, $session, $heap, $sender, $what) = @_[KERNEL, SESSION, HEAP, SENDER, ARG0]; + my $client = $heap->{sessions}->{$sender}; + if (@{$client->{expect}} + and $client->{expect}->[0]->[1] =~ /error/i) { + splice @{$client->{expect}->[0]}, 2, 1; + unexpect($kernel, $session, $client); + $client->{disconnect_expected} = 1; + } else { + print "ERROR: From server to $client->{name}: $what\n"; + } + $client->{throttled} = 1 if $what =~ /throttled/i; +} ----------------------- End of diff ----------------------- |
From: Toni G. <zo...@us...> - 2005-05-07 22:32:45
|
CVSROOT : /cvsroot/irc-dev Module : ircd-ircdev Commit time: 2005-05-07 22:32:30 UTC Modified files: doc/ircd.sample-en.conf doc/ircd.sample-es.conf Log message: Actualizacion .confs ---------------------- diff included ---------------------- Index: ircd-ircdev/doc/ircd.sample-en.conf diff -u ircd-ircdev/doc/ircd.sample-en.conf:1.20 ircd-ircdev/doc/ircd.sample-en.conf:1.21 --- ircd-ircdev/doc/ircd.sample-en.conf:1.20 Sat Apr 23 08:57:02 2005 +++ ircd-ircdev/doc/ircd.sample-en.conf Sat May 7 15:32:20 2005 @@ -1,6 +1,6 @@ # ircd.conf - configuration file for IRC-Dev's IRCD. # -# Last Updated: 23, Apr 2005. +# Last Updated: 8, May 2005. # # Written by Niels <ni...@un...>, based on the original example.conf, # server code and some real-life (ahem) experience. @@ -519,12 +519,15 @@ # class = "classname"; # maxhops = 2; # hub = "*.eu.irc-dev.net"; +# autoconnect = no; # }; # # The "port" field defines the default port the server tries to connect # to if an operator uses /connect without specifying a port. This is also # the port used when the server attempts to auto-connect to the remote # server. (See "Class" blocks for more informationa about auto-connects). +# You may tell ircu to not automatically connect to a server by adding +# "autoconnect = no;"; the default is to autoconnect. # # The "maxhops" field causes an SQUIT if a hub tries to introduce # servers farther away than that; the element "leaf," is an alias for Index: ircd-ircdev/doc/ircd.sample-es.conf diff -u ircd-ircdev/doc/ircd.sample-es.conf:1.15 ircd-ircdev/doc/ircd.sample-es.conf:1.16 --- ircd-ircdev/doc/ircd.sample-es.conf:1.15 Sat Apr 23 08:57:13 2005 +++ ircd-ircdev/doc/ircd.sample-es.conf Sat May 7 15:32:20 2005 @@ -1,6 +1,6 @@ # ircd.conf - archivo de configuración para el IRCD de IRC-Dev. # -# Ultima actualización: 23, Abr 2005. +# Ultima actualización: 8, May 2005. # # Escrito por Niels <ni...@un...>, basado en el archivo example.conf # original, en el código del servidor y la experiencia de la vida real. @@ -544,6 +544,7 @@ # class = "nombreclase"; # maxhops = 2; # hub = "*.eu.irc-dev.net"; +# autoconnect = no; # }; # # El campo "port" define el puerto por defecto que el servidor intentará @@ -551,6 +552,8 @@ # un puerto. Este también es el puerto usado para los intentos del servidor # de autoconectar con el servidor remoto. (Véase los bloques "Class" para # más informacion sobre "auto-connects"). +# Puedes hacer que el ircd no se conecte automáticamente con un servidor +# añadiendo "autoconnect = no"; por defecto está la autoconexión. # # El campo "maxhops" causa un SQUIT si un hub intenta introducir servidores # más lejos que eso, el elemento "leaf"; es un alias para "maxhops = 0;". ----------------------- End of diff ----------------------- |
From: Toni G. <zo...@us...> - 2005-05-07 22:24:03
|
CVSROOT : /cvsroot/irc-dev Module : ircd-ircdev Commit time: 2005-05-07 22:23:50 UTC Modified files: ChangeLog ChangeLog.es Doxyfile doc/en/log.txt include/ircd_log.h include/numeric.h include/patchlevel.h ircd/channel.c ircd/ddb.c ircd/ddb_db_native.c ircd/ddb_events.c ircd/engine_epoll.c ircd/ircd_auth.c ircd/ircd_log.c ircd/m_db.c ircd/m_invite.c ircd/m_join.c ircd/m_svsnick.c ircd/numnicks.c ircd/s_err.c ircd/s_misc.c ircd/s_stats.c ircd/s_user.c Log message: Author: zoltan <zo...@ir...> Log message: 2005-05-08 Toni García <zo...@ir...> 1.0.alpha32 * Fix de bugs ---------------------- diff included ---------------------- Index: ircd-ircdev/ChangeLog diff -u ircd-ircdev/ChangeLog:1.33 ircd-ircdev/ChangeLog:1.34 --- ircd-ircdev/ChangeLog:1.33 Sat May 7 05:43:28 2005 +++ ircd-ircdev/ChangeLog Sat May 7 15:23:39 2005 @@ -1,10 +1,13 @@ # # ChangeLog for ircd-ircdev # -# $Id: ChangeLog,v 1.33 2005/05/07 12:43:28 zolty Exp $ +# $Id: ChangeLog,v 1.34 2005/05/07 22:23:39 zolty Exp $ # # Insert new changes at beginning of the change list. # +2005-05-08 Toni García <zo...@ir...> 1.0.alpha32 + * Fix bugs + 2005-05-07 Toni García <zo...@ir...> 1.0.alpha31 * Native DB: Tables read and save * Burst DB Index: ircd-ircdev/ChangeLog.es diff -u ircd-ircdev/ChangeLog.es:1.33 ircd-ircdev/ChangeLog.es:1.34 --- ircd-ircdev/ChangeLog.es:1.33 Sat May 7 05:43:28 2005 +++ ircd-ircdev/ChangeLog.es Sat May 7 15:23:39 2005 @@ -1,10 +1,13 @@ # # Log de Cambios para ircd-ircdev # -# $Id: ChangeLog.es,v 1.33 2005/05/07 12:43:28 zolty Exp $ +# $Id: ChangeLog.es,v 1.34 2005/05/07 22:23:39 zolty Exp $ # # Insertar los nuevos cambios al principio de esta lista de cambios. # +2005-05-08 Toni García <zo...@ir...> 1.0.alpha32 + * Fix de bugs + 2005-05-07 Toni García <zo...@ir...> 1.0.alpha31 * DB nativo: Lectura y escritura de tablas * DB Burst Index: ircd-ircdev/Doxyfile diff -u ircd-ircdev/Doxyfile:1.3 ircd-ircdev/Doxyfile:1.4 --- ircd-ircdev/Doxyfile:1.3 Mon Mar 21 10:38:47 2005 +++ ircd-ircdev/Doxyfile Sat May 7 15:23:39 2005 @@ -41,7 +41,8 @@ # (Japanese with English messages), Korean, Norwegian, Polish, Portuguese, # Romanian, Russian, Serbian, Slovak, Slovene, Spanish, Swedish, and Ukrainian. -OUTPUT_LANGUAGE = English +#OUTPUT_LANGUAGE = English +OUTPUT_LANGUAGE = Spanish # This tag can be used to specify the encoding used in the generated output. # The encoding is not always determined by the language that is chosen, @@ -691,7 +692,7 @@ # The RTF output is optimised for Word 97 and may not look very pretty with # other RTF readers or editors. -GENERATE_RTF = NO +GENERATE_RTF = YES # The RTF_OUTPUT tag is used to specify where the RTF docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be Index: ircd-ircdev/doc/en/log.txt diff -u ircd-ircdev/doc/en/log.txt:1.1 ircd-ircdev/doc/en/log.txt:1.2 --- ircd-ircdev/doc/en/log.txt:1.1 Wed Jan 5 10:00:34 2005 +++ ircd-ircdev/doc/en/log.txt Sat May 7 15:23:39 2005 @@ -1,4 +1,4 @@ -$Id: log.txt,v 1.1 2005/01/05 18:00:34 zolty Exp $ +$Id: log.txt,v 1.2 2005/05/07 22:23:39 zolty Exp $ Older versions of ircd had no consistent way of logging various actions. Some things, such as G-lines, were written out to log files @@ -109,15 +109,15 @@ * SOCKET - Used to report problems with sockets. By default, log messages to this subsystem go nowhere. + * IAUTH - Used to report connects, disconnects and errors for the + IAuth authorization mechanism. By default, log messages to this + subsystem go to the "NETWORK" server notice mask. + * DEBUG - Used only when debugging is enabled. All log messages to this subsystem go either to the console or to the debug log file compiled into the server, as well as to the "DEBUG" server notice mask. This is the only subsystem with a default log file. - * OLDLOG - Not used anywhere. This is a left-over from when the - logging subsystem was first created. Log messages to this - subsystem go nowhere. - Configuration The true power of the logging subsystem comes from its extremely Index: ircd-ircdev/include/ircd_log.h diff -u ircd-ircdev/include/ircd_log.h:1.6 ircd-ircdev/include/ircd_log.h:1.7 --- ircd-ircdev/include/ircd_log.h:1.6 Wed Mar 23 10:34:25 2005 +++ ircd-ircdev/include/ircd_log.h Sat May 7 15:23:39 2005 @@ -21,7 +21,7 @@ */ /** @file * @brief IRC logging interface. - * @version $Id: ircd_log.h,v 1.6 2005/03/23 18:34:25 zolty Exp $ + * @version $Id: ircd_log.h,v 1.7 2005/05/07 22:23:39 zolty Exp $ */ #ifndef INCLUDED_ircd_log_h #define INCLUDED_ircd_log_h @@ -70,8 +70,8 @@ LS_OPER, /**< Users becoming operators. */ LS_RESOLVER, /**< DNS resolver errors. */ LS_SOCKET, /**< Unexpected socket operation errors. */ + LS_IAUTH, /**< IAuth status. */ LS_DEBUG, /**< Debug messages. */ - LS_OLDLOG, /**< Old logging messages (no longer used). */ LS_LAST_SYSTEM /**< Count of valid LogSys values. */ }; Index: ircd-ircdev/include/numeric.h diff -u ircd-ircdev/include/numeric.h:1.12 ircd-ircdev/include/numeric.h:1.13 --- ircd-ircdev/include/numeric.h:1.12 Mon Apr 11 01:44:59 2005 +++ ircd-ircdev/include/numeric.h Sat May 7 15:23:39 2005 @@ -21,7 +21,7 @@ */ /** @file * @brief Declarations of numeric replies and supporting functions. - * @version $Id: numeric.h,v 1.12 2005/04/11 08:44:59 zolty Exp $ + * @version $Id: numeric.h,v 1.13 2005/05/07 22:23:39 zolty Exp $ */ #ifndef INCLUDED_numeric_h #define INCLUDED_numeric_h @@ -462,13 +462,14 @@ ERR_WHOLIMEXCEED 523 dalnet */ #define ERR_QUARANTINED 524 /* Undernet extension -Vampire */ -#define ERR_NOTLOWEROPLEVEL 550 /* Undernet extension */ -#define ERR_NOTMANAGER 551 /* Undernet extension */ -#define ERR_CHANSECURED 552 /* Undernet extension */ -#define ERR_UPASSSET 553 /* Undernet extension */ -#define ERR_UPASSNOTSET 554 /* Undernet extension */ -#define ERR_NOMANAGER_LONG 555 /* Undernet extension */ -#define ERR_NOMANAGER_SHORT 556 /* Undernet extension */ +#define ERR_NOTLOWEROPLEVEL 560 /* Undernet extension */ +#define ERR_NOTMANAGER 561 /* Undernet extension */ +#define ERR_CHANSECURED 562 /* Undernet extension */ +#define ERR_UPASSSET 563 /* Undernet extension */ +#define ERR_UPASSNOTSET 564 /* Undernet extension */ +#define ERR_NOMANAGER_LONG 565 /* Undernet extension */ +#define ERR_NOMANAGER_SHORT 566 /* Undernet extension */ +#define ERR_UPASS_SAME_APASS 567 /* Undernet extension */ #define RPL_LOGON 600 /* Dalnet extension */ #define RPL_LOGOFF 601 /* Dalnet extension */ Index: ircd-ircdev/include/patchlevel.h diff -u ircd-ircdev/include/patchlevel.h:1.32 ircd-ircdev/include/patchlevel.h:1.33 --- ircd-ircdev/include/patchlevel.h:1.32 Sat May 7 05:43:28 2005 +++ ircd-ircdev/include/patchlevel.h Sat May 7 15:23:40 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.32 2005/05/07 12:43:28 zolty Exp $ + * $Id: patchlevel.h,v 1.33 2005/05/07 22:23:40 zolty Exp $ * */ -#define PATCHLEVEL ".alpha31" +#define PATCHLEVEL ".alpha32" #define RELEASE "1.0" Index: ircd-ircdev/ircd/channel.c diff -u ircd-ircdev/ircd/channel.c:1.19 ircd-ircdev/ircd/channel.c:1.20 --- ircd-ircdev/ircd/channel.c:1.19 Sun Apr 24 15:18:05 2005 +++ ircd-ircdev/ircd/channel.c Sat May 7 15:23:40 2005 @@ -21,7 +21,7 @@ */ /** @file * @brief Channel management and maintanance - * @version $Id: channel.c,v 1.19 2005/04/24 22:18:05 zolty Exp $ + * @version $Id: channel.c,v 1.20 2005/05/07 22:23:40 zolty Exp $ */ #include "config.h" @@ -2624,6 +2624,11 @@ send_reply(state->sptr, ERR_UPASSNOTSET, state->chptr->chname, state->chptr->chname); return; } + /* cannot set a +U password that is the same as +A */ + if (state->dir == MODE_ADD && !ircd_strcmp(state->chptr->mode.apass, t_str)) { + send_reply(state->sptr, ERR_UPASS_SAME_APASS, state->chptr->chname); + return; + } /* can't add a upass if one is set, nor can one remove the wrong upass */ if ((state->dir == MODE_ADD && *state->chptr->mode.upass) || (state->dir == MODE_DEL && @@ -3535,7 +3540,9 @@ remove_user_from_channel(jbuf->jb_source, chan); } else { #if defined(UNDERNET) - int oplevel = chan->mode.apass[0] ? 0 : MAXOPLEVEL; + int oplevel = !chan->mode.apass[0] ? MAXOPLEVEL + : (flags & CHFL_CHANNEL_MANAGER) ? 0 + : 1; /* Add user to channel */ if ((chan->mode.mode & MODE_DELJOINS) && !(flags & CHFL_VOICED_OR_OPPED)) add_user_to_channel(chan, jbuf->jb_source, flags | CHFL_DELAYED, oplevel); @@ -3551,16 +3558,24 @@ /* send notification to all servers */ if (jbuf->jb_type != JOINBUF_TYPE_CREATE && !IsLocalChannel(chan->chname)) - sendcmdto_serv_butone(jbuf->jb_source, CMD_JOIN, jbuf->jb_connect, - "%H %Tu", chan, chan->creationtime); + { +#if defined(UNDERNET) + if (flags & CHFL_CHANOP) + sendcmdto_serv_butone(jbuf->jb_source, CMD_JOIN, jbuf->jb_connect, + "%u:%H %Tu", oplevel, chan, chan->creationtime); + else +#endif + sendcmdto_serv_butone(jbuf->jb_source, CMD_JOIN, jbuf->jb_connect, + "%H %Tu", chan, chan->creationtime); + } if (!((chan->mode.mode & MODE_DELJOINS) && !(flags & CHFL_VOICED_OR_OPPED))) { /* Send the notification to the channel */ sendcmdto_channel_butserv_butone(jbuf->jb_source, CMD_JOIN, chan, NULL, 0, "%H", chan); /* send an op, too, if needed */ - if (!MyUser(jbuf->jb_source) && jbuf->jb_type == JOINBUF_TYPE_CREATE) - sendcmdto_channel_butserv_butone(jbuf->jb_source, CMD_MODE, chan, NULL, 0, "%H +o %C", + if (flags & CHFL_CHANOP) + sendcmdto_channel_butserv_butone(&me, CMD_MODE, chan, NULL, 0, "%H +o %C", chan, jbuf->jb_source); } else if (MyUser(jbuf->jb_source)) sendcmdto_one(jbuf->jb_source, CMD_JOIN, jbuf->jb_source, ":%H", chan); Index: ircd-ircdev/ircd/ddb.c diff -u ircd-ircdev/ircd/ddb.c:1.7 ircd-ircdev/ircd/ddb.c:1.8 --- ircd-ircdev/ircd/ddb.c:1.7 Sat May 7 05:43:29 2005 +++ ircd-ircdev/ircd/ddb.c Sat May 7 15:23:40 2005 @@ -21,7 +21,7 @@ */ /** @file * @brief Implementation of Distributed DataBase. - * @version $Id: ddb.c,v 1.7 2005/05/07 12:43:29 zolty Exp $ + * @version $Id: ddb.c,v 1.8 2005/05/07 22:23:40 zolty Exp $ */ #include "config.h" @@ -31,6 +31,7 @@ #include "ircd_chattr.h" #include "ircd_log.h" #include "ircd_reply.h" +#include "ircd_snprintf.h" #include "ircd_string.h" #include "ircd_tea.h" #include "list.h" @@ -124,9 +125,11 @@ /* ID Mask Key Content */ if (content) - sprintf(buf, "%u %s %s %s", id, mask, key, content); + ircd_snprintf(0, buf, sizeof(buf), "%u %s %s %s", + id, mask, key, content); else - sprintf(buf, "%u %s %s", id, mask, key); + ircd_snprintf(0, buf, sizeof(buf), "%u %s %s", + id, mask, key); memset(buffer, 0, sizeof(buffer)); strncpy((char *)buffer, buf, sizeof(buffer) - 1); @@ -623,7 +626,7 @@ vsprintf(exitmsg2, pattern, vl); va_end(vl); - sprintf(exitmsg, "DDB Error: %s", exitmsg2); + ircd_snprintf(0, exitmsg, sizeof(exitmsg), "DDB Error: %s", exitmsg2); for (i = 0; i <= HighestFd; i++) { Index: ircd-ircdev/ircd/ddb_db_native.c diff -u ircd-ircdev/ircd/ddb_db_native.c:1.2 ircd-ircdev/ircd/ddb_db_native.c:1.3 --- ircd-ircdev/ircd/ddb_db_native.c:1.2 Sat May 7 05:43:29 2005 +++ ircd-ircdev/ircd/ddb_db_native.c Sat May 7 15:23:40 2005 @@ -22,7 +22,7 @@ */ /** @file * @brief Native DataBase implementation of Distributed DataBase. - * @version $Id: ddb_db_native.c,v 1.2 2005/05/07 12:43:29 zolty Exp $ + * @version $Id: ddb_db_native.c,v 1.3 2005/05/07 22:23:40 zolty Exp $ */ #include "config.h" @@ -321,7 +321,7 @@ inttobase64(hash, ddb_hashtable_hi[table], 6); inttobase64(hash + 6, ddb_hashtable_lo[table], 6); - sprintf(path, "%c %s\n", table, hash); + ircd_snprintf(0, path, sizeof(path), "%c %s\n", table, hash); if (write(fd, path, strlen(path)) == -1) ddb_die("Error when saving table '%c' hashes (WRITE)", table); close(fd); Index: ircd-ircdev/ircd/ddb_events.c diff -u ircd-ircdev/ircd/ddb_events.c:1.2 ircd-ircdev/ircd/ddb_events.c:1.3 --- ircd-ircdev/ircd/ddb_events.c:1.2 Thu Apr 28 15:00:08 2005 +++ ircd-ircdev/ircd/ddb_events.c Sat May 7 15:23:40 2005 @@ -21,7 +21,7 @@ */ /** @file * @brief Events of Distributed DataBase. - * @version $Id: ddb_events.c,v 1.2 2005/04/28 22:00:08 zolty Exp $ + * @version $Id: ddb_events.c,v 1.3 2005/05/07 22:23:40 zolty Exp $ */ #include "config.h" @@ -29,6 +29,7 @@ #include "client.h" #include "hash.h" #include "ircd.h" +#include "ircd_snprintf.h" #include "ircd_tea.h" #include "msg.h" #include "numnicks.h" @@ -161,7 +162,8 @@ if (x[0] >= 4294000000ul) continue; - sprintf(newnick, "Guest%.6d", (int)(x[0] % 1000000)); + ircd_snprintf(0, newnick, sizeof(newnick), "Guest%.6d", + (int)(x[0] % 1000000)); acptr = FindUser(newnick); } while (acptr); @@ -170,7 +172,7 @@ parv[0] = cli_name(cptr); parv[1] = newnick; - sprintf(tmp, "%lu", TStime()); + ircd_snprintf(0, tmp, sizeof(tmp), "%T", TStime()); parv[2] = tmp; set_nick_name(cptr, cptr, newnick, 3, parv, flags); Index: ircd-ircdev/ircd/engine_epoll.c diff -u ircd-ircdev/ircd/engine_epoll.c:1.9 ircd-ircdev/ircd/engine_epoll.c:1.10 --- ircd-ircdev/ircd/engine_epoll.c:1.9 Mon Mar 21 10:39:06 2005 +++ ircd-ircdev/ircd/engine_epoll.c Sat May 7 15:23:40 2005 @@ -21,7 +21,7 @@ */ /** @file * @brief Linux epoll_*() event engine. - * @version $Id: engine_epoll.c,v 1.9 2005/03/21 18:39:06 zolty Exp $ + * @version $Id: engine_epoll.c,v 1.10 2005/05/07 22:23:40 zolty Exp $ */ #include "config.h" @@ -279,9 +279,9 @@ gen_ref_dec(sock); continue; } - } - - switch (s_state(sock)) { + } else if (events[i].events & EPOLLHUP) { + event_generate(ET_EOF, sock, 0); + } else switch (s_state(sock)) { case SS_CONNECTING: if (events[i].events & EPOLLOUT) /* connection completed */ event_generate(ET_CONNECT, sock, 0); @@ -294,12 +294,6 @@ case SS_NOTSOCK: case SS_CONNECTED: - if (events[i].events & EPOLLIN) - event_generate((events[i].events & EPOLLHUP) ? ET_EOF : ET_READ, sock, 0); - if (events[i].events & EPOLLOUT) - event_generate(ET_WRITE, sock, 0); - break; - case SS_DATAGRAM: case SS_CONNECTDG: if (events[i].events & EPOLLIN) Index: ircd-ircdev/ircd/ircd_auth.c diff -u ircd-ircdev/ircd/ircd_auth.c:1.5 ircd-ircdev/ircd/ircd_auth.c:1.6 --- ircd-ircdev/ircd/ircd_auth.c:1.5 Mon Mar 21 10:39:07 2005 +++ ircd-ircdev/ircd/ircd_auth.c Sat May 7 15:23:40 2005 @@ -22,7 +22,7 @@ */ /** @file * @brief IAuth client implementation for an IRC server. - * @version $Id: ircd_auth.c,v 1.5 2005/03/21 18:39:07 zolty Exp $ + * @version $Id: ircd_auth.c,v 1.6 2005/05/07 22:23:40 zolty Exp $ */ #include "config.h" #include "client.h" @@ -245,6 +245,7 @@ memset(&i_addr(iauth), 0, sizeof(i_addr(iauth))); i_port(iauth) = port; iauth_active = iauth; + timer_init(&i_reconn_timer(iauth)); i_reconnect(iauth) = reconnect; iauth_reconnect(iauth); } @@ -313,7 +314,7 @@ if (t_active(&i_request_timer(iauth))) timer_del(&i_request_timer(iauth)); /* Disconnect from the server. */ - if (s_fd(&i_socket(iauth)) != -1) + if (i_GetConnected(iauth)) iauth_disconnect(iauth); /* Free memory. */ MyFree(iauth); @@ -400,7 +401,7 @@ { close(s_fd(&i_socket(iauth))); socket_del(&i_socket(iauth)); - s_fd(&i_socket(iauth)) = -1; + i_ClrConnected(iauth); } /** DNS completion callback for an %IAuth connection. @@ -411,11 +412,11 @@ { struct IAuth *iauth = vptr; if (!he) { - sendto_opmask_butone(0, SNO_OLDSNO, "IAuth connection to %s failed: host lookup failed", i_host(iauth)); + log_write(LS_IAUTH, L_NOTICE, 0, "IAuth connection to %s failed: host lookup failed", i_host(iauth)); } else { memcpy(&i_addr(iauth).addr, &he->addr, sizeof(i_addr(iauth).addr)); if (!irc_in_addr_valid(&i_addr(iauth).addr)) { - sendto_opmask_butone(0, SNO_OLDSNO, "IAuth connection to %s failed: host came back as unresolved", i_host(iauth)); + log_write(LS_IAUTH, L_NOTICE, 0, "IAuth connection to %s failed: host came back as unresolved", i_host(iauth)); return; } iauth_reconnect(iauth); @@ -437,9 +438,12 @@ static void iauth_schedule_reconnect(struct IAuth *iauth) { struct Timer *timer; - assert(!t_active(&i_reconn_timer(iauth))); - timer = timer_init(&i_reconn_timer(iauth)); - timer_add(timer, iauth_reconnect_ev, iauth, TT_RELATIVE, i_reconnect(iauth)); + timer = &i_reconn_timer(iauth); + if (t_onqueue(timer)) + timer_chg(timer, TT_RELATIVE, i_reconnect(iauth)); + else + timer_add(&i_reconn_timer(iauth), iauth_reconnect_ev, + iauth, TT_RELATIVE, i_reconnect(iauth)); } /** Initiate a (re-)connection to \a iauth. @@ -451,7 +455,12 @@ IOResult result; int fd; - Debug((DEBUG_INFO, "IAuth attempt connection to %s port %p.", i_host(iauth), i_port(iauth))); + if (i_GetConnected(iauth)) { + iauth_disconnect(iauth); + iauth_schedule_reconnect(iauth); + return; + } + log_write(LS_IAUTH, L_DEBUG, 0, "IAuth attempt connection to %s port %p.", i_host(iauth), i_port(iauth)); if (!irc_in_addr_valid(&i_addr(iauth).addr) && !ircd_aton(&i_addr(iauth).addr, i_host(iauth))) { i_query(iauth).vptr = iauth; @@ -461,26 +470,32 @@ } local = irc_in_addr_is_ipv4(&i_addr(iauth).addr) ? &VirtualHost_v4 : &VirtualHost_v6; fd = os_socket(local, SOCK_STREAM, "IAuth"); - if (fd < 0) + if (fd < 0) { + iauth_schedule_reconnect(iauth); return; + } if (!os_set_sockbufs(fd, SERVER_TCP_WINDOW, SERVER_TCP_WINDOW)) { - close(fd); - sendto_opmask_butone(0, SNO_OLDSNO, "IAuth reconnect unable to set socket buffers: %s", strerror(errno)); - return; + log_write(LS_IAUTH, L_WARNING, 0, "IAuth reconnect unable to set socket buffers: %s", strerror(errno)); + goto failure; } + s_fd(&i_socket(iauth)) = fd; result = os_connect_nonb(fd, &i_addr(iauth)); if (result == IO_FAILURE) { - close(fd); - sendto_opmask_butone(0, SNO_OLDSNO, "IAuth reconnect unable to initiate connection: %s", strerror(errno)); - return; + log_write(LS_IAUTH, L_NOTICE, 0, "IAuth reconnect unable to initiate connection: %s", strerror(errno)); + goto failure; } if (!socket_add(&i_socket(iauth), iauth_sock_callback, iauth, (result == IO_SUCCESS) ? SS_CONNECTED : SS_CONNECTING, SOCK_EVENT_READABLE | SOCK_EVENT_WRITABLE, fd)) { - close(fd); - sendto_opmask_butone(0, SNO_OLDSNO, "IAuth reconnect unable to add socket: %s", strerror(errno)); - return; + log_write(LS_IAUTH, L_WARNING, 0, "IAuth reconnect unable to add socket: %s", strerror(errno)); + goto failure; } + return; +failure: + close(fd); + i_ClrConnected(iauth); + iauth_schedule_reconnect(iauth); + return; } /** Read input from \a iauth. @@ -494,8 +509,11 @@ char readbuf[SERVER_TCP_WINDOW]; length = 0; - if (IO_FAILURE == os_recv_nonb(s_fd(&i_socket(iauth)), readbuf, sizeof(readbuf), &length)) - return; + if (IO_FAILURE == os_recv_nonb(s_fd(&i_socket(iauth)), readbuf, sizeof(readbuf), &length) + || length == 0) { + iauth_reconnect(iauth); + return; + } i_recvB(iauth) += length; if (i_recvB(iauth) > 1023) { i_recvK(iauth) += i_recvB(iauth) >> 10; @@ -609,13 +627,12 @@ i_ClrBlocked(iauth); iauth_write(iauth); break; - case ET_EOF: - iauth_disconnect(iauth); - break; case ET_ERROR: - sendto_opmask_butone(0, SNO_OLDSNO, "IAuth socket error: %s", strerror(ev_data(ev))); - log_write(LS_SOCKET, L_ERROR, 0, "IAuth socket error: %s", strerror(ev_data(ev))); + log_write(LS_IAUTH, L_ERROR, 0, "IAuth socket error: %s", strerror(ev_data(ev))); + /* and fall through to the ET_EOF case */ + case ET_EOF: iauth_disconnect(iauth); + iauth_schedule_reconnect(iauth); break; default: assert(0 && "Unrecognized event type"); @@ -632,7 +649,7 @@ { /* TODO: this could probably be more intelligent */ if (ev_type(ev) == ET_EXPIRE) { - sendto_opmask_butone(0, SNO_OLDSNO, "IAuth request timed out; reconnecting"); + log_write(LS_IAUTH, L_NOTICE, 0, "IAuth request timed out; reconnecting"); iauth_reconnect(t_data(ev_timer(ev))); } } @@ -683,6 +700,7 @@ /* Allocate and initialize IAuthRequest struct. */ if (!(iar = MyCalloc(1, sizeof(*iar)))) return exit_client(cptr, cptr, &me, "IAuth memory allocation failed"); + cli_iauth(cptr) = iar; iar->iar_next = &i_list_head(iauth); iar->iar_prev = i_list_head(iauth).iar_prev; iar->iar_client = cptr; @@ -704,8 +722,10 @@ if (cli_iauth(cptr)) { iauth_dispose_request(iauth_active, cli_iauth(cptr)); cli_iauth(cptr) = NULL; - } else if (IsIAuthed(cptr) && i_GetIClass(iauth_active)) { - /* TODO: report quit to iauth */ + } + if (iauth_active && i_GetConnected(iauth_active)) { + iauth_send(iauth_active, "ExitUser %x", cptr); + iauth_write(iauth_active); } } @@ -736,7 +756,7 @@ static void iauth_dispose_request(struct IAuth *iauth, struct IAuthRequest *iar) { assert(iar->iar_client != NULL); - if (iar->iar_timed) + if (iar->iar_timed && t_active(&i_request_timer(iauth))) timer_del(&i_request_timer(iauth)); cli_iauth(iar->iar_client) = NULL; iar->iar_prev->iar_next = iar->iar_next; Index: ircd-ircdev/ircd/ircd_log.c diff -u ircd-ircdev/ircd/ircd_log.c:1.9 ircd-ircdev/ircd/ircd_log.c:1.10 --- ircd-ircdev/ircd/ircd_log.c:1.9 Wed Mar 23 10:34:48 2005 +++ ircd-ircdev/ircd/ircd_log.c Sat May 7 15:23:40 2005 @@ -22,7 +22,7 @@ */ /** @file * @brief IRC logging implementation. - * @version $Id: ircd_log.c,v 1.9 2005/03/23 18:34:48 zolty Exp $ + * @version $Id: ircd_log.c,v 1.10 2005/05/07 22:23:40 zolty Exp $ */ #include "config.h" @@ -165,8 +165,8 @@ S(OPER, -1, SNO_OLDREALOP), S(RESOLVER, -1, 0), S(SOCKET, -1, 0), + S(IAUTH, -1, SNO_NETWORK), S(DEBUG, -1, SNO_DEBUG), - S(OLDLOG, -1, 0), #undef S { LS_LAST_SYSTEM, 0, 0, -1, 0, -1, 0 } }; Index: ircd-ircdev/ircd/m_db.c diff -u ircd-ircdev/ircd/m_db.c:1.4 ircd-ircdev/ircd/m_db.c:1.5 --- ircd-ircdev/ircd/m_db.c:1.4 Sat May 7 05:43:29 2005 +++ ircd-ircdev/ircd/m_db.c Sat May 7 15:23:40 2005 @@ -22,7 +22,7 @@ */ /** @file * @brief Handlers for DB command. - * @version $Id: m_db.c,v 1.4 2005/05/07 12:43:29 zolty Exp $ + * @version $Id: m_db.c,v 1.5 2005/05/07 22:23:40 zolty Exp $ */ /* TODO-ZOLTAN * Traducidr los comentarios al ingles */ @@ -149,14 +149,15 @@ /* Desconectamos con todos los hubs menos el que nos envia la orden */ log_write(LS_DDB, L_INFO, 0, "DB Drop Table %c from %#C", table, cptr); - sprintf(ddb_buf, "DB DROP Table %c from %s", table, cli_name(cptr)); + ircd_snprintf(0, ddb_buf, sizeof(ddb_buf), "DB DROP Table %c from %s", + table, cli_name(cptr)); ddb_splithubs_butone(cptr, ddb_buf); /* Mandamos la respuesta de conformidad */ sendcmdto_one(&me, CMD_DB, cptr, "%s 0 E %s %c", cli_name(cptr), parv[4], table); - /* TODO-ZOLTAN: Cosa de ryden. Creo que hay que mandar a todos */ + /* TODO-ZOLTAN: Creo que hay que mandar a todos */ cli_serv(cptr)->ddb_open &= ~ddb_mask; /* Solicitamos de nuevo la tabla */ @@ -368,10 +369,10 @@ (cli_serv(lp->value.cptr)->ddb_open & ddb_mask)) { if (!delete) - sendcmdto_one(&me, CMD_DB, lp->value.cptr, "%s %u %c %s %s :%s", + sendcmdto_one(&me, CMD_DB, lp->value.cptr, "%s %u %c %s :%s", parv[1], id, table, parv[4], parv[5]); else - sendcmdto_one(&me, CMD_DB, lp->value.cptr, "%s %u %c %s %s", + sendcmdto_one(&me, CMD_DB, lp->value.cptr, "%s %u %c %s", parv[1], id, table, parv[4]); } } Index: ircd-ircdev/ircd/m_invite.c diff -u ircd-ircdev/ircd/m_invite.c:1.10 ircd-ircdev/ircd/m_invite.c:1.11 --- ircd-ircdev/ircd/m_invite.c:1.10 Thu Apr 28 15:00:08 2005 +++ ircd-ircdev/ircd/m_invite.c Sat May 7 15:23:40 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.10 2005/04/28 22:00:08 zolty Exp $ + * $Id: m_invite.c,v 1.11 2005/05/07 22:23:40 zolty Exp $ * */ @@ -179,6 +179,9 @@ if (MyConnect(acptr)) { add_invite(acptr, chptr); sendcmdto_one(sptr, CMD_INVITE, acptr, "%s %H", cli_name(acptr), chptr); + } else { + sendcmdto_one(sptr, CMD_INVITE, acptr, "%s %H %Tu", cli_name(acptr), chptr, + chptr->creationtime); } if (!IsLocalChannel(chptr->chname) || MyConnect(acptr)) { @@ -189,7 +192,7 @@ "%H %C %C :%C has been invited by %C", chptr, acptr, sptr, acptr, sptr); /* Announce to servers with channel operators. */ - sendcmdto_channel_servers_butone(sptr, NULL, TOK_INVITE, chptr, NULL, SKIP_NONOPS, + sendcmdto_channel_servers_butone(sptr, NULL, TOK_INVITE, chptr, acptr, SKIP_NONOPS, "%s %H %Tu", cli_name(acptr), chptr, chptr->creationtime); } @@ -281,8 +284,11 @@ return 0; if (MyConnect(acptr)) { - add_invite(acptr, chptr); - sendcmdto_one(sptr, CMD_INVITE, acptr, "%s %H", cli_name(acptr), chptr); + add_invite(acptr, chptr); + sendcmdto_one(sptr, CMD_INVITE, acptr, "%s %H", cli_name(acptr), chptr); + } else { + sendcmdto_one(sptr, CMD_INVITE, acptr, "%s %H %Tu", cli_name(acptr), chptr, + chptr->creationtime); } if (feature_bool(FEAT_ANNOUNCE_INVITES)) { @@ -292,11 +298,10 @@ "%H %C %C :%C has been invited by %C", chptr, acptr, sptr, acptr, sptr); /* Announce to servers with channel operators. */ - sendcmdto_channel_servers_butone(sptr, NULL, TOK_INVITE, chptr, NULL, SKIP_NONOPS, + sendcmdto_channel_servers_butone(sptr, NULL, TOK_INVITE, chptr, acptr, SKIP_NONOPS, "%s %H %Tu", cli_name(acptr), chptr, chptr->creationtime); } return 0; } - Index: ircd-ircdev/ircd/m_join.c diff -u ircd-ircdev/ircd/m_join.c:1.10 ircd-ircdev/ircd/m_join.c:1.11 --- ircd-ircdev/ircd/m_join.c:1.10 Mon Mar 21 10:39:08 2005 +++ ircd-ircdev/ircd/m_join.c Sat May 7 15:23:40 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_join.c,v 1.10 2005/03/21 18:39:08 zolty Exp $ + * $Id: m_join.c,v 1.11 2005/05/07 22:23:40 zolty Exp $ * */ @@ -169,9 +169,6 @@ struct Channel *chptr; struct JoinBuf join; struct JoinBuf create; -#if defined(UNDERNET) - struct ModeBuf mbuf; -#endif struct Gline *gline; unsigned int flags = 0; int i, j, k = 0; @@ -249,8 +246,7 @@ #if defined(UNDERNET) int is_level0_op = 0; if (!BadPtr(keys) && *chptr->mode.apass) { - /* Don't use compall for the apass, only a single key is allowed. - Test Apass first in case someone set Apass and upass equal. */ + /* Don't use compall for the apass, only a single key is allowed. */ if (strcmp(chptr->mode.apass, keys) == 0) { is_level0_op = 1; flags &= ~CHFL_DEOPPED; @@ -307,18 +303,6 @@ } /* else if ((i = can_join(sptr, chptr, keys))) */ joinbuf_join(&join, chptr, flags); -#if defined(UNDERNET) - if (is_level0_op) - { - joinbuf_flush(&join); - modebuf_init(&mbuf, &me, cptr, chptr, - MODEBUF_DEST_CHANNEL | /* Send mode to channel */ - MODEBUF_DEST_SERVER); /* And send it to the other servers */ - modebuf_mode_client(&mbuf, - MODE_ADD | MODE_CHANOP, sptr); /* Give ops to the level0 op */ - modebuf_flush(&mbuf); - } -#endif } else if (!(chptr = get_channel(sptr, name, CGT_CREATE))) continue; /* couldn't get channel */ else if (check_target_limit(sptr, chptr, chptr->chname, 1)) @@ -365,7 +349,7 @@ struct Membership *member; struct Channel *chptr; struct JoinBuf join; - unsigned int flags = 0; + unsigned int flags; time_t creation = 0; char *p = 0; char *chanlist; @@ -398,6 +382,21 @@ if (join0(&join, cptr, sptr, name)) /* did client do a JOIN 0? */ continue; +#if defined(UNDERNET) + if (name[0] == '0' && name[1] == ':') + { + flags = CHFL_CHANOP | CHFL_CHANNEL_MANAGER; + name += 2; + } + else if (name[0] == '1' && name[1] == ':') + { + flags = CHFL_CHANOP; + name += 2; + } + else + flags = CHFL_DEOPPED; +#endif + if (IsLocalChannel(name) || !IsChannelName(name)) { protocol_violation(cptr, "%s tried to join %s", cli_name(sptr), name); @@ -413,9 +412,9 @@ name,cli_name(sptr)); continue; } - flags = CHFL_DEOPPED | (HasFlag(sptr, FLAG_TS8) ? CHFL_SERVOPOK : 0); + flags |= HasFlag(sptr, FLAG_TS8) ? CHFL_SERVOPOK : 0; - /* when the network is 2.10.11+ then remove MAGIC_REMOTE_JOIN_TS */ + /* when the network is 2.10.11+ then remove MAGIC_REMOTE_JOIN_TS */ chptr->creationtime = creation ? creation : MAGIC_REMOTE_JOIN_TS; } else { /* We have a valid channel? */ @@ -430,12 +429,12 @@ chptr = FindChannel(name); } else - flags = CHFL_DEOPPED | (HasFlag(sptr, FLAG_TS8) ? CHFL_SERVOPOK : 0); + flags |= HasFlag(sptr, FLAG_TS8) ? CHFL_SERVOPOK : 0; /* Always copy the timestamp when it is older, that is the only way to ensure network-wide synchronization of creation times. */ if (creation && creation < chptr->creationtime) chptr->creationtime = creation; - } + } joinbuf_join(&join, chptr, flags); } Index: ircd-ircdev/ircd/m_svsnick.c diff -u ircd-ircdev/ircd/m_svsnick.c:1.1 ircd-ircdev/ircd/m_svsnick.c:1.2 --- ircd-ircdev/ircd/m_svsnick.c:1.1 Thu Mar 31 04:58:04 2005 +++ ircd-ircdev/ircd/m_svsnick.c Sat May 7 15:23:40 2005 @@ -21,7 +21,7 @@ */ /** @file * @brief Handlers for SVSNICK command. - * @version $Id: m_svsnick.c,v 1.1 2005/03/31 12:58:04 zolty Exp $ + * @version $Id: m_svsnick.c,v 1.2 2005/05/07 22:23:40 zolty Exp $ */ #include "config.h" @@ -122,7 +122,8 @@ if (x[0] >= 4294000000ul) continue; - sprintf(newnick, "Guest%.6d", (int)(x[0] % 1000000)); + ircd_snprintf(0, newnick, sizeof(newnick), "Guest%.6d", + (int)(x[0] % 1000000)); bcptr = FindUser(newnick); } while (bcptr); @@ -141,7 +142,7 @@ parv[1] = newnick; { char tmp[100]; - sprintf(tmp, "%lu", TStime()); + ircd_snprintf(0, tmp, sizeof(tmp), "%T", TStime()); parv[2] = tmp; } Index: ircd-ircdev/ircd/numnicks.c diff -u ircd-ircdev/ircd/numnicks.c:1.7 ircd-ircdev/ircd/numnicks.c:1.8 --- ircd-ircdev/ircd/numnicks.c:1.7 Fri Apr 22 09:22:13 2005 +++ ircd-ircdev/ircd/numnicks.c Sat May 7 15:23:40 2005 @@ -21,7 +21,7 @@ */ /** @file * @brief Implementation of numeric nickname operations. - * @version $Id: numnicks.c,v 1.7 2005/04/22 16:22:13 zolty Exp $ + * @version $Id: numnicks.c,v 1.8 2005/05/07 22:23:40 zolty Exp $ */ #include "config.h" @@ -505,9 +505,12 @@ memset(addr, 0, sizeof(*addr)); if (strlen(input) == 6) { unsigned int in = base64toint(input); - addr->in6_16[5] = htons(65535); - addr->in6_16[6] = htons(in >> 16); - addr->in6_16[7] = htons(in & 65535); + /* An all-zero address should stay that way. */ + if (in) { + addr->in6_16[5] = htons(65535); + addr->in6_16[6] = htons(in >> 16); + addr->in6_16[7] = htons(in & 65535); + } } else { unsigned int pos = 0; do { Index: ircd-ircdev/ircd/s_err.c diff -u ircd-ircdev/ircd/s_err.c:1.18 ircd-ircdev/ircd/s_err.c:1.19 --- ircd-ircdev/ircd/s_err.c:1.18 Thu Apr 28 15:00:09 2005 +++ ircd-ircdev/ircd/s_err.c Sat May 7 15:23:40 2005 @@ -21,7 +21,7 @@ */ /** @file * @brief Error handling support. - * @version $Id: s_err.c,v 1.18 2005/04/28 22:00:09 zolty Exp $ + * @version $Id: s_err.c,v 1.19 2005/05/07 22:23:40 zolty Exp $ */ #include "config.h" @@ -1146,22 +1146,6 @@ { 0 }, /* 549 */ { 0 }, -#if defined(UNDERNET) -/* 550 */ - { ERR_NOTLOWEROPLEVEL, "%s %s %hu %hu :Cannot %s someone with %s op-level", "550" }, -/* 551 */ - { ERR_NOTMANAGER, "%s :You must be channel Admin to add or remove a password. Use /JOIN %s <AdminPass>.", "551" }, -/* 552 */ - { ERR_CHANSECURED, "%s :Channel is older than 48 hours and secured. Cannot change Admin pass anymore", "552" }, -/* 553 */ - { ERR_UPASSSET, "%s :Cannot remove Admin pass (+A) while User pass (+U) is still set. First use /MODE %s -U <userpass>", "553" }, -/* 554 */ - { ERR_UPASSNOTSET, "%s :Cannot set user pass (+U) while Admin pass (+A) is set. First use /MODE %s +A <adminpass>", "554" }, - /* 555 */ - { ERR_NOMANAGER_LONG, "%s :Re-create the channel. The channel must be *empty* for 48 continuous hours before it can be recreated.", "555" }, - /* 556 */ - { ERR_NOMANAGER_SHORT, "%s :Re-create the channel. The channel must be *empty* for a minute or two before it can be recreated.", "556" }, -#else /* 550 */ { 0 }, /* 551 */ @@ -1176,13 +1160,30 @@ { 0 }, /* 556 */ { 0 }, -#endif /* 557 */ { 0 }, /* 558 */ { 0 }, /* 559 */ { 0 }, +#if defined(UNDERNET) +/* 560 */ + { ERR_NOTLOWEROPLEVEL, "%s %s %hu %hu :Cannot %s someone with %s op-level", "550" }, +/* 561 */ + { ERR_NOTMANAGER, "%s :You must be channel Admin to add or remove a password. Use /JOIN %s <AdminPass>.", "551" }, +/* 562 */ + { ERR_CHANSECURED, "%s :Channel is older than 48 hours and secured. Cannot change Admin pass anymore", "552" }, +/* 563 */ + { ERR_UPASSSET, "%s :Cannot remove Admin pass (+A) while User pass (+U) is still set. First use /MODE %s -U <userpass>", "553" }, +/* 564 */ + { ERR_UPASSNOTSET, "%s :Cannot set user pass (+U) while Admin pass (+A) is set. First use /MODE %s +A <adminpass>", "554" }, +/* 565 */ + { ERR_NOMANAGER_LONG, "%s :Re-create the channel. The channel must be *empty* for 48 continuous hours before it can be recreated.", "555" }, +/* 566 */ + { ERR_NOMANAGER_SHORT, "%s :Re-create the channel. The channel must be *empty* for a minute or two before it can be recreated.", "556" }, +/* 567 */ + { ERR_UPASS_SAME_APASS, "%s :Cannot use the same pass for both admin (+A) and user (+U) pass.", "567" }, +#else /* 560 */ { 0 }, /* 561 */ @@ -1199,6 +1200,7 @@ { 0 }, /* 567 */ { 0 }, +#endif /* 568 */ { 0 }, /* 569 */ Index: ircd-ircdev/ircd/s_misc.c diff -u ircd-ircdev/ircd/s_misc.c:1.9 ircd-ircdev/ircd/s_misc.c:1.10 --- ircd-ircdev/ircd/s_misc.c:1.9 Sat Apr 2 11:47:35 2005 +++ ircd-ircdev/ircd/s_misc.c Sat May 7 15:23:40 2005 @@ -21,7 +21,7 @@ */ /** @file * @brief Miscellaneous support functions. - * @version $Id: s_misc.c,v 1.9 2005/04/02 19:47:35 zolty Exp $ + * @version $Id: s_misc.c,v 1.10 2005/05/07 22:23:40 zolty Exp $ */ #include "config.h" @@ -251,9 +251,8 @@ --UserStats.opers; if (MyConnect(bcptr)) Count_clientdisconnects(bcptr, UserStats); - else { + else Count_remoteclientquits(UserStats, bcptr); - } } else if (IsServer(bcptr)) { @@ -290,7 +289,7 @@ /* bcptr->user->server->serv->client_list[IndexYXX(bcptr)] = NULL; */ RemoveYXXClient(cli_user(bcptr)->server, cli_yxx(bcptr)); if (IsIAuthed(bcptr) || cli_iauth(bcptr)) - iauth_exit_client(bcptr); + iauth_exit_client(bcptr); } /* Remove bcptr from the client list */ Index: ircd-ircdev/ircd/s_stats.c diff -u ircd-ircdev/ircd/s_stats.c:1.13 ircd-ircdev/ircd/s_stats.c:1.14 --- ircd-ircdev/ircd/s_stats.c:1.13 Thu Apr 28 15:00:09 2005 +++ ircd-ircdev/ircd/s_stats.c Sat May 7 15:23:40 2005 @@ -22,7 +22,7 @@ /** @file * @brief Report configuration lines and other statistics from this * server. - * @version $Id: s_stats.c,v 1.13 2005/04/28 22:00:09 zolty Exp $ + * @version $Id: s_stats.c,v 1.14 2005/05/07 22:23:40 zolty Exp $ * * Note: The info is reported in the order the server uses * it--not reversed as in ircd.conf! @@ -175,12 +175,15 @@ { if (aconf->status != CONF_CLIENT) continue; - if ((!wilds && (!match(aconf->host, param) || - !match(aconf->name, param))) || - (wilds && (!mmatch(param, aconf->host) || - !mmatch(param, aconf->name)))) + if (wilds ? ((aconf->host && !mmatch(aconf->host, param)) + || (aconf->name && !mmatch(aconf->name, param))) + : ((aconf->host && !match(param, aconf->host)) + || (aconf->name && !match(param, aconf->name)))) { - send_reply(to, RPL_STATSILINE, 'I', aconf->host, aconf->name, + send_reply(to, RPL_STATSILINE, + (aconf->host ? aconf->host : "*"), aconf->maximum, + (aconf->name && aconf->name[0] == ':' ? "0" : ""), + aconf->name ? aconf->name : "*", aconf->address.port, get_conf_class(aconf)); if (--count == 0) break; Index: ircd-ircdev/ircd/s_user.c diff -u ircd-ircdev/ircd/s_user.c:1.16 ircd-ircdev/ircd/s_user.c:1.17 --- ircd-ircdev/ircd/s_user.c:1.16 Thu Apr 28 15:00:09 2005 +++ ircd-ircdev/ircd/s_user.c Sat May 7 15:23:40 2005 @@ -21,7 +21,7 @@ */ /** @file * @brief Miscellaneous user-related helper functions. - * @version $Id: s_user.c,v 1.16 2005/04/28 22:00:09 zolty Exp $ + * @version $Id: s_user.c,v 1.17 2005/05/07 22:23:40 zolty Exp $ */ #include "config.h" @@ -1738,9 +1738,7 @@ int i; struct Flags c_flags = cli_flags(cptr); - if (HasPriv(cptr, PRIV_PROPAGATE)) - FlagSet(&c_flags, FLAG_OPER); - else + if (!HasPriv(cptr, PRIV_PROPAGATE)) FlagClr(&c_flags, FLAG_OPER); for (i = 0; i < USERMODELIST_SIZE; ++i) ----------------------- End of diff ----------------------- |
From: Toni G. <zo...@us...> - 2005-05-07 12:44:54
|
CVSROOT : /cvsroot/irc-dev Module : ircd-ircdev Commit time: 2005-05-07 12:44:47 UTC Modified files: TODO.es Log message: actualizacion TODO ---------------------- diff included ---------------------- Index: ircd-ircdev/TODO.es diff -u ircd-ircdev/TODO.es:1.22 ircd-ircdev/TODO.es:1.23 --- ircd-ircdev/TODO.es:1.22 Thu Apr 28 15:02:37 2005 +++ ircd-ircdev/TODO.es Sat May 7 05:44:36 2005 @@ -1,14 +1,14 @@ # # TODO para ircd-ircdev # -# $Id: TODO.es,v 1.22 2005/04/28 22:02:37 zolty Exp $ +# $Id: TODO.es,v 1.23 2005/05/07 12:44:36 zolty Exp $ # # Insertar las nuevas entradas al principio de la lista TODO. # URGENTE -------------------------------------------------------------------------------------- - - [D] Implementar el protocolo DDB (ddb_db). + - [D] DDB: compactado, hashes, seguridad y documentacion. - [D] Implementar tabla o de Operadores - [D] Implementar tabla p de Privilegios - [D] Implementar tabla f de Features ----------------------- End of diff ----------------------- |