? ../ircu2.10.06/patch.db27 ? ../ircu2.10.06/patch.db28 ? ../ircu2.10.06/patch.db29 ? ../ircu2.10.06/patch.db30 ? ../ircu2.10.06/patch.clones Index: ../ircu2.10.06/todo.jcea =================================================================== RCS file: /cvsroot/ircd/todo.jcea,v retrieving revision 1.7.2.1 retrieving revision 1.9 diff -c -r1.7.2.1 -r1.9 *** ../ircu2.10.06/todo.jcea 1999/10/13 19:59:56 1.7.2.1 --- ../ircu2.10.06/todo.jcea 1999/10/13 19:35:29 1.9 *************** *** 1,7 **** 13/Oct/99 - BDD de clones. - - 13/Oct/99 La compactacion no elimina registros duplicados. Ese es un problema cuando, por ejemplo, un usuario cambia muchas veces la clave de nick entre dos --- 1,4 ---- Index: ../ircu2.10.06/config/config-sh.in =================================================================== RCS file: /cvsroot/ircd/config/config-sh.in,v retrieving revision 1.10 retrieving revision 1.11 diff -c -r1.10 -r1.11 *** ../ircu2.10.06/config/config-sh.in 1999/10/08 10:46:42 1.10 --- ../ircu2.10.06/config/config-sh.in 1999/10/13 19:30:09 1.11 *************** *** 374,379 **** --- 374,380 ---- if [ "$DB_ESNET" = "y" ]; then eval DBPATH_DEFAULT="database" string 'Directory where distributed database resides - ESNET' DBPATH $DBPATH_DEFAULT + bool 'Distributed Clone Control support - ESNET' ESNET_CLONES y fi int 'Max auto connects per class (1!)' MAXIMUM_LINKS 1 echo '* Never define this on a production server:' Index: ../ircu2.10.06/doc/Configure.help =================================================================== RCS file: /cvsroot/ircd/doc/Configure.help,v retrieving revision 1.8 retrieving revision 1.9 diff -c -r1.8 -r1.9 *** ../ircu2.10.06/doc/Configure.help 1999/10/08 10:46:43 1.8 --- ../ircu2.10.06/doc/Configure.help 1999/10/13 19:30:09 1.9 *************** *** 889,894 **** --- 889,898 ---- Path to the Distributed Database directory. This path can be absolute, or relative to the configuration directory (DPATH). + Distributed Clone Control support - ESNET + ESNET_CLONES + Control clones locally using ESNET Distributed DataBases. + Allow local opers to use the REHASH command LOCOP_REHASH Allows a local operator (defined by a lowercase o:line in ircd.conf) Index: ../ircu2.10.06/include/IPcheck.h =================================================================== RCS file: /cvsroot/ircd/include/IPcheck.h,v retrieving revision 1.2 retrieving revision 1.3 diff -c -r1.2 -r1.3 *** ../ircu2.10.06/include/IPcheck.h 1999/10/08 10:33:10 1.2 --- ../ircu2.10.06/include/IPcheck.h 1999/10/13 19:30:09 1.3 *************** *** 13,16 **** --- 13,20 ---- extern void IPcheck_disconnect(aClient *cptr); extern unsigned short IPcheck_nr(aClient *cptr); + #if defined(DB_ESNET) && defined(ESNET_CLONES) + extern int IPbusca_clones(char *host); + #endif + #endif /* IPCHECK_H */ Index: ../ircu2.10.06/include/struct.h =================================================================== RCS file: /cvsroot/ircd/include/struct.h,v retrieving revision 1.14 retrieving revision 1.15 diff -c -r1.14 -r1.15 *** ../ircu2.10.06/include/struct.h 1999/10/08 19:25:35 1.14 --- ../ircu2.10.06/include/struct.h 1999/10/13 19:30:09 1.15 *************** *** 197,202 **** --- 197,203 ---- #define ESNET_BDD 'a' #define ESNET_BDD_END 'z' #define ESNET_NICKDB 'n' + #define ESNET_CLONESDB 'i' /* Para las features del Virtual CHaN */ #define DBH_CHANSERV "ChanServ" Index: ../ircu2.10.06/ircd/IPcheck.c =================================================================== RCS file: /cvsroot/ircd/ircd/IPcheck.c,v retrieving revision 1.3 retrieving revision 1.4 diff -c -r1.3 -r1.4 *** ../ircu2.10.06/ircd/IPcheck.c 1999/10/08 11:09:08 1.3 --- ../ircu2.10.06/ircd/IPcheck.c 1999/10/13 19:30:09 1.4 *************** *** 33,38 **** --- 33,42 ---- #endif #include "send.h" + #if defined(DB_ESNET) && defined(ESNET_CLONES) + #include "s_serv.h" + #endif + RCSTAG_CC("$Id: IPcheck.c,v 1.13 1999/10/04 15:08:13 foxxe Exp $"); extern aClient me; *************** *** 475,477 **** --- 479,491 ---- entry = IPregistry_find(hash, cptr->ip); return (entry ? entry->connected : 0); } + + #if defined(DB_ESNET) && defined(ESNET_CLONES) + int IPbusca_clones(char *host) { + struct dbh_reg *reg; + + reg=dbh_buscar_registro_local(ESNET_CLONESDB,host); + if(reg==NULL) return -1; + return atoi(reg->valor); + } + #endif Index: ../ircu2.10.06/ircd/s_bsd.c =================================================================== RCS file: /cvsroot/ircd/ircd/s_bsd.c,v retrieving revision 1.12 retrieving revision 1.13 diff -c -r1.12 -r1.13 *** ../ircu2.10.06/ircd/s_bsd.c 1999/10/10 01:10:29 1.12 --- ../ircu2.10.06/ircd/s_bsd.c 1999/10/13 19:30:09 1.13 *************** *** 684,691 **** --- 684,696 ---- */ enum AuthorizationCheckResult check_client(aClient *cptr) { + char buf[HOSTLEN+1+1024]; + char host_buf[HOSTLEN+1]; + int num_clones; + int iline=0; static char sockname[HOSTLEN + 1]; Reg2 struct hostent *hp = NULL; + Reg3 const char *hname; Reg3 int i; enum AuthorizationCheckResult acr; *************** *** 714,719 **** --- 719,771 ---- hp = NULL; } } + + /* + ** Gestion Distribuida de Clones + */ + + #if defined(DB_ESNET) && defined(ESNET_CLONES) + + if(hp) { + for (i = 0, hname = hp->h_name; hname; hname = hp->h_aliases[i++]) { + strncpy(host_buf,hname,HOSTLEN); + host_buf[HOSTLEN]='\0'; + num_clones=IPbusca_clones(host_buf); + if(num_clones!=-1) break; /* Tenemos un HIT! */ + } + /* + ** Nos quedamos con el nombre canonico + */ + strncpy(host_buf,hp->h_name,HOSTLEN); + host_buf[HOSTLEN]='\0'; + } else { + strcpy(host_buf,inetntoa(cptr->ip)); + num_clones=IPbusca_clones(host_buf); + } + + /* + ** Clones permitidos para los + ** clientes en general, sin Iline. + */ + if(num_clones==-1) { + num_clones=IPbusca_clones("."); + iline=0; + } else iline=!0; /* Tiene Iline */ + if((num_clones!=-1) && (IPcheck_nr(cptr)>num_clones)) { + sprintf_irc(buf,":%s NOTICE %s :En esta red solo se permiten %d clones para tu IP (%s)", + me.name,cptr->name,num_clones,host_buf); + sendto_one(cptr,buf); + /* + ** Si tiene Iline no debemos permitir + ** Throttle, ya que se supone que es + ** un usuario legitimo de multiples + ** conexiones + */ + if(iline) IPcheck_connect_fail(cptr); + return ACR_TOO_MANY_FROM_IP; + } + + #endif if ((acr = attach_Iline(cptr, hp, sockname))) { Index: ../ircu2.10.06/ircd/s_debug.c =================================================================== RCS file: /cvsroot/ircd/ircd/s_debug.c,v retrieving revision 1.46.2.1 retrieving revision 1.49 diff -c -r1.46.2.1 -r1.49 *** ../ircu2.10.06/ircd/s_debug.c 1999/10/13 19:59:56 1.46.2.1 --- ../ircu2.10.06/ircd/s_debug.c 1999/10/13 19:30:09 1.49 *************** *** 197,202 **** --- 197,209 ---- #else '-', #endif + 'C', + #ifdef ESNET_CLONES + '+', + #else + '-', + #endif + #ifdef DB_HISPANO '.','I','R','C','-', 'H','I','S','P','A','N','O','.','O','R','G',':', 'D','B','H' ,'1','2','+', Index: ../ircu2.10.06/ircd/s_serv.c =================================================================== RCS file: /cvsroot/ircd/ircd/s_serv.c,v retrieving revision 1.30.2.1 retrieving revision 1.33 diff -c -r1.30.2.1 -r1.33 *** ../ircu2.10.06/ircd/s_serv.c 1999/10/13 19:59:56 1.30.2.1 --- ../ircu2.10.06/ircd/s_serv.c 1999/10/13 19:30:09 1.33 *************** *** 1622,1639 **** tabla_serie[que_bdd]=atol(p0); ! switch (*p2) ! { ! case 'N': ! if(p4==NULL) { /* Borrado */ ! dbh_eliminar_registro(que_bdd, p3); ! break; ! } dbh_insertar_registro(que_bdd, p1, p3, p4); - break; - - default: - break; } } --- 1622,1632 ---- tabla_serie[que_bdd]=atol(p0); ! if(tabla_residente[que_bdd]) { ! if(p4==NULL) /* Borrado */ ! dbh_eliminar_registro(que_bdd, p3); ! else dbh_insertar_registro(que_bdd, p1, p3, p4); } } *************** *** 1882,1887 **** --- 1875,1883 ---- char c; tabla_residente[ESNET_NICKDB]=1; + #if defined(DB_ESNET) && defined(ESNET_CLONES) + tabla_residente[ESNET_CLONESDB]=1; + #endif for(c=ESNET_BDD;c<=ESNET_BDD_END;c++) initdb2(c);