diff -crN ../ircu2.10.06-no_whois_secret/CAMBIOS ../ircu2.10.06-VIP/CAMBIOS *** ../ircu2.10.06-no_whois_secret/CAMBIOS Tue Sep 14 14:17:22 1999 --- ../ircu2.10.06-VIP/CAMBIOS Thu Sep 30 20:50:23 1999 *************** *** 1,3 **** --- 1,43 ---- + * 1999/09/14 savage@apostols.org (patch.vip) FEATURE + ----------------------------------------------------------------------- + Se introducen dos nuevos flags de usuario: +x y +X, el primero oculta + la dirección ip(o hostname) del usuario y el segundo (+X) permite ver + las direcciónes reales al ejecutar /WHOIS /WHO /USERIP y /USERHOST + Solo los usuarios +r acceden, automaticamente, a +x, pudiendo cambiar + a -x y +x a voluntad mientras perdure el flag +r + Solo los usuarios +o (ircops) y +h (OPERS) pueden activar el flag +X + El formato de las direcciones es @GaRaBaTo12Ch.virtual, y este valor + se calcula en todos los servers cuando el usuario activa +x, + guardandose en un campo especifico: User->virtualhost + Si los servers encuentran en la nueva tabla V un registro para el nick + en cuestión, instalan el valor del registro en User->virtualhost, + permitiendo así definir ips virtuales fijas para ciertos usuarios. + El valor del GaRaBaTo12Ch se calcula en make_virtualhost() de s_user.c + y es basicamente: + + garabato = base64(tea(tea(nick,password),ip<<32+xyz<<8)); + + haciendose imposible crear una relación de ips virtuales a reales, asi + como su desencriptación por parte de los usuarios. La unica forma de + conseguir averiguar una ip a partir de una virtual sera analizando los + logs de los distintos servidores de servicios. + + he modificado además el codigo refernete a BAN para que acepte ban por + virtual, y el ban a real afecte tambien a los +x. + + he cambiado el antiguo codigo 378 (ke ya movimos en su dia) al 380 + he ocupado el codigo 378 para que nos indique la ip/host real del user + tal como lo hacen otros daemons de irc. El 379 lo he reservado para + que muestre los modos de usn usuario, como enotras redes, pero esto es + asunto de otro parche. + + El comando /TRACE solo será accesible a Opers +o y HelpOps +h, antes + era accesible a todos. Este comando no oculta IPs. + + No puedo considerar el codigo terminado, la version queda reflejada + como VIP+, activandose en el configurador dentro de la sección HISPANO, + siendo desactivable por si nos da problemas. + * 1999/09/14 savage@apostols.org (patch.no_whois_secret) UNFEATURE ----------------------------------------------------------------------- Elimina completamente el parche patch.whois_secret diff -crN ../ircu2.10.06-no_whois_secret/config/config-sh.in ../ircu2.10.06-VIP/config/config-sh.in *** ../ircu2.10.06-no_whois_secret/config/config-sh.in Sat Jul 31 06:13:02 1999 --- ../ircu2.10.06-VIP/config/config-sh.in Thu Sep 30 18:00:41 1999 *************** *** 366,371 **** --- 366,372 ---- bool 'HISPANO: OPER_DB features only on registered (CHAN_DB) channels' DBH_OPER_HACK_ONLYREG y bool 'HISPANO: OPER_DB members can be Chanserv (+k)' DBH_OPER_HACK_KMODE y fi + bool 'Ocultación de IP de los usuarios registrados' DBH_VIP y bool 'Proteccion contra Wingates y Socks4 proxies' PROXY_PROTECTION y fi bool 'XMODE Networking - ESNET' XMODE_ESNET y diff -crN ../ircu2.10.06-no_whois_secret/doc/Configure.help ../ircu2.10.06-VIP/doc/Configure.help *** ../ircu2.10.06-no_whois_secret/doc/Configure.help Sat Jul 31 06:13:02 1999 --- ../ircu2.10.06-VIP/doc/Configure.help Thu Sep 30 17:47:34 1999 *************** *** 1162,1164 **** --- 1162,1170 ---- En cuanto el usuario conecta se le presenta un texto informando de lo que se intenta hacer, y si es aceptable o no. + Ocultación de IP de los usuarios registrados + DBH_VIP + Si activamos esta opción, el servidor de irc ocultara la IP + real de los usuarios con modo +x excepto si quien lo mira es + un operador con modo +X + diff -crN ../ircu2.10.06-no_whois_secret/include/numeric.h ../ircu2.10.06-VIP/include/numeric.h *** ../ircu2.10.06-no_whois_secret/include/numeric.h Sat Jul 31 06:13:03 1999 --- ../ircu2.10.06-VIP/include/numeric.h Thu Sep 30 13:46:48 1999 *************** *** 205,211 **** #define RPL_ENDOFMOTD 376 #if defined(DB_HISPANO) || defined(DB_ESNET) ! #define RPL_USERIP 378 /* Undernet extension FIXED */ #endif #define RPL_YOUREOPER 381 --- 205,213 ---- #define RPL_ENDOFMOTD 376 #if defined(DB_HISPANO) || defined(DB_ESNET) ! #define RPL_WHOISHOST 378 /* Hispano extension */ ! #define RPL_WHOISMODES 379 /* Hispano extension */ ! #define RPL_USERIP 380 /* Undernet extension FIXED */ #endif #define RPL_YOUREOPER 381 diff -crN ../ircu2.10.06-no_whois_secret/include/s_bsd.h ../ircu2.10.06-VIP/include/s_bsd.h *** ../ircu2.10.06-no_whois_secret/include/s_bsd.h Sat Jul 31 06:13:03 1999 --- ../ircu2.10.06-VIP/include/s_bsd.h Thu Sep 30 10:38:07 1999 *************** *** 190,199 **** #define HMODE_WRSOCKS 0x00000008 /* se tiene ke escribir en socks */ #define HMODE_HELPOP 0x00000010 /* Es un oper con modo +h */ #define HMODE_SERVICESBOT 0x00000020 /* Es un bot de canales */ /* Modos hispano a propagar */ #define SEND_HMODES \ ! (HMODE_NICKREGISTERED | HMODE_HELPOP | HMODE_SERVICESBOT) /* Modos hispano TODOS */ #define ALL_HMODES \ --- 190,201 ---- #define HMODE_WRSOCKS 0x00000008 /* se tiene ke escribir en socks */ #define HMODE_HELPOP 0x00000010 /* Es un oper con modo +h */ #define HMODE_SERVICESBOT 0x00000020 /* Es un bot de canales */ + #define HMODE_HIDDEN 0x00000040 /* Ip Oculta */ + #define HMODE_HIDDENVIEWER 0x00000080 /* Ip Oculta */ /* Modos hispano a propagar */ #define SEND_HMODES \ ! (HMODE_NICKREGISTERED | HMODE_HELPOP | HMODE_SERVICESBOT | HMODE_HIDDEN | HMODE_HIDDENVIEWER) /* Modos hispano TODOS */ #define ALL_HMODES \ *************** *** 205,210 **** --- 207,214 ---- #define DoingWrSocks(x) ((x)->hmodes & HMODE_WRSOCKS) #define IsHelpOp(x) ((x)->hmodes & HMODE_HELPOP) #define IsServicesBot(x) ((x)->hmodes & HMODE_SERVICESBOT) + #define IsHidden(x) ((x)->hmodes & HMODE_HIDDEN) + #define IsHiddenViewer(x) ((x)->hmodes & HMODE_HIDDENVIEWER) /* Macros para poner modos hispano */ #define SetNickRegistered(x) ((x)->hmodes |= HMODE_NICKREGISTERED) *************** *** 212,217 **** --- 216,223 ---- #define SetWrSocks(x) ((x)->hmodes |= HMODE_WRSOCKS) #define SetHelpOp(x) ((x)->hmodes |= HMODE_HELPOP) #define SetServicesBot(x) ((x)->hmodes |= HMODE_SERVICESBOT) + #define SetHidden(x) ((x)->hmodes |= HMODE_HIDDEN) + #define SetHiddenViewer(x) ((x)->hmodes |= HMODE_HIDDENVIEWER) /* Macros para borrar modos hispano */ #define ClearNickRegistered(x) ((x)->hmodes &= ~HMODE_NICKREGISTERED) *************** *** 219,224 **** --- 225,232 ---- #define ClearWrSocks(x) ((x)->hmodes &= ~HMODE_WRSOCKS) #define ClearHelpOp(x) ((x)->hmodes &= ~HMODE_HELPOP) #define ClearServicesBot(x) ((x)->hmodes &= ~HMODE_SERVICESBOT) + #define ClearHidden(x) ((x)->hmodes &= ~HMODE_HIDDEN) + #define ClearHiddenViewer(x) ((x)->hmodes &= ~HMODE_HIDDENVIEWER) #endif /* DB_HISPANO || DB_ESNET */ diff -crN ../ircu2.10.06-no_whois_secret/include/s_user.h ../ircu2.10.06-VIP/include/s_user.h *** ../ircu2.10.06-no_whois_secret/include/s_user.h Sat Jul 31 06:13:03 1999 --- ../ircu2.10.06-VIP/include/s_user.h Thu Sep 30 20:39:34 1999 *************** *** 72,77 **** --- 72,80 ---- extern void add_target(aClient *sptr, void *target); #if defined(DB_HISPANO) || defined(DB_ESNET) extern unsigned int base64toint(const char *str); + #ifdef DBH_VIP + extern char *get_virtualhost(aClient *sptr); + #endif #endif extern const char *inttobase64(unsigned int i); diff -crN ../ircu2.10.06-no_whois_secret/include/struct.h ../ircu2.10.06-VIP/include/struct.h *** ../ircu2.10.06-no_whois_secret/include/struct.h Sat Jul 31 06:13:03 1999 --- ../ircu2.10.06-VIP/include/struct.h Thu Sep 30 20:39:01 1999 *************** *** 163,168 **** --- 163,171 ---- unsigned int joined; /* number of channels joined */ char username[USERLEN + 1]; char host[HOSTLEN + 1]; + #ifdef DBH_VIP + char virtualhost[HOSTLEN + 1]; + #endif #ifdef LIST_DEBUG struct Client *bcptr; #endif *************** *** 186,191 **** --- 189,195 ---- #define DBH_OPERDB 'O' #define DBH_CHANDB 'C' #define DBH_BOTSDB 'B' + #define DBH_VIRTUALDB 'V' #define ESNET_NICKDB 'n' /* Para las features del Virtual CHaN */ diff -crN ../ircu2.10.06-no_whois_secret/ircd/channel.c ../ircu2.10.06-VIP/ircd/channel.c *** ../ircu2.10.06-no_whois_secret/ircd/channel.c Sat Jul 31 06:13:23 1999 --- ../ircu2.10.06-VIP/ircd/channel.c Thu Sep 30 17:49:13 1999 *************** *** 373,380 **** return (member->flags & CHFL_BANNED); } s = make_nick_user_host(cptr->name, cptr->user->username, cptr->user->host); ! for (tmp = chptr->banlist; tmp; tmp = tmp->next) { if ((tmp->flags & CHFL_BAN_IPMASK)) --- 373,382 ---- return (member->flags & CHFL_BANNED); } + #ifndef DBH_VIP s = make_nick_user_host(cptr->name, cptr->user->username, cptr->user->host); ! #endif ! for (tmp = chptr->banlist; tmp; tmp = tmp->next) { if ((tmp->flags & CHFL_BAN_IPMASK)) *************** *** 384,391 **** if (match(tmp->value.ban.banstr, ip_s) == 0) break; } ! else if (match(tmp->value.ban.banstr, s) == 0) ! break; } if (member) --- 386,406 ---- if (match(tmp->value.ban.banstr, ip_s) == 0) break; } ! else ! #ifdef DBH_VIP ! { ! s = make_nick_user_host(cptr->name, cptr->user->username, cptr->user->host); ! #endif ! if (match(tmp->value.ban.banstr, s) == 0) ! break; ! #ifdef DB_HISPANO ! if(IsHidden(cptr)) { ! s = make_nick_user_host(cptr->name, cptr->user->username, get_virtualhost(cptr)); ! if (match(tmp->value.ban.banstr, s) == 0) ! break; ! } ! } ! #endif } if (member) *************** *** 2075,2083 **** if (IsServer(sptr)) psblen = sprintf_irc(sendbuf, ":%s MODE %s -b", sptr->name, chptr->chname) - sendbuf; ! else /* We rely on IsRegistered(sptr) being true for MODE */ psblen = sprintf_irc(sendbuf, ":%s!%s@%s MODE %s -b", sptr->name, sptr->user->username, sptr->user->host, chptr->chname) - sendbuf; while (delayed || (ban = next_removed_overlapped_ban())) { if (!delayed) --- 2090,2105 ---- if (IsServer(sptr)) psblen = sprintf_irc(sendbuf, ":%s MODE %s -b", sptr->name, chptr->chname) - sendbuf; ! else ! #ifdef DBH_VIP ! /* We rely on IsRegistered(sptr) being true for MODE */ ! psblen = sprintf_irc(sendbuf, ":%s!%s@%s MODE %s -b", sptr->name, ! sptr->user->username, get_virtualhost(sptr), chptr->chname) - sendbuf; ! #else ! /* We rely on IsRegistered(sptr) being true for MODE */ psblen = sprintf_irc(sendbuf, ":%s!%s@%s MODE %s -b", sptr->name, sptr->user->username, sptr->user->host, chptr->chname) - sendbuf; + #endif while (delayed || (ban = next_removed_overlapped_ban())) { if (!delayed) diff -crN ../ircu2.10.06-no_whois_secret/ircd/opercmds.c ../ircu2.10.06-VIP/ircd/opercmds.c *** ../ircu2.10.06-no_whois_secret/ircd/opercmds.c Sat Jul 31 06:13:03 1999 --- ../ircu2.10.06-VIP/ircd/opercmds.c Thu Sep 30 17:55:29 1999 *************** *** 1216,1221 **** --- 1216,1226 ---- int doall, link_s[MAXCONNECTIONS], link_u[MAXCONNECTIONS]; int cnt = 0, wilds, dow; + #ifdef DBH_VIP + if( !IsAnOper(cptr) && !IsHelpOp(cptr) && !IsServer(cptr) ) + return 0; /* no puedes */ + #endif + if (parc < 2 || BadPtr(parv[1])) { /* just "TRACE" without parameters. Must be from local client */ diff -crN ../ircu2.10.06-no_whois_secret/ircd/s_debug.c ../ircu2.10.06-VIP/ircd/s_debug.c *** ../ircu2.10.06-no_whois_secret/ircd/s_debug.c Tue Sep 14 14:17:58 1999 --- ../ircu2.10.06-VIP/ircd/s_debug.c Thu Sep 30 16:37:36 1999 *************** *** 224,229 **** --- 224,235 ---- #else '-', #endif + 'V','I','P', + #ifdef DBH_VIP + '+', + #else + '-', + #endif #endif /* DB_HISPANO */ '\0' }; diff -crN ../ircu2.10.06-no_whois_secret/ircd/s_err.c ../ircu2.10.06-VIP/ircd/s_err.c *** ../ircu2.10.06-no_whois_secret/ircd/s_err.c Sat Jul 31 06:13:04 1999 --- ../ircu2.10.06-VIP/ircd/s_err.c Thu Sep 30 13:28:05 1999 *************** *** 472,487 **** {RPL_ENDOFMOTD, ":End of /MOTD command."}, /* 377 */ {0, (char *)NULL}, - /* 378 */ #if defined(DB_HISPANO) || defined(DB_ESNET) {RPL_USERIP, ":"}, #else {0, (char *)NULL}, - #endif /* 379 */ {0, (char *)NULL}, /* 380 */ {0, (char *)NULL}, /* 381 */ {RPL_YOUREOPER, ":You are now an IRC Operator"}, /* 382 */ --- 472,492 ---- {RPL_ENDOFMOTD, ":End of /MOTD command."}, /* 377 */ {0, (char *)NULL}, #if defined(DB_HISPANO) || defined(DB_ESNET) + /* 378 */ + {RPL_WHOISHOST, "%s :Dirección real %s [%s]"}, + /* 379 */ + {RPL_WHOISMODES, "%s :Utiliza los modos [%s]"}, + /* 380 */ {RPL_USERIP, ":"}, #else + /* 378 */ {0, (char *)NULL}, /* 379 */ {0, (char *)NULL}, /* 380 */ {0, (char *)NULL}, + #endif /* 381 */ {RPL_YOUREOPER, ":You are now an IRC Operator"}, /* 382 */ diff -crN ../ircu2.10.06-no_whois_secret/ircd/s_misc.c ../ircu2.10.06-VIP/ircd/s_misc.c *** ../ircu2.10.06-no_whois_secret/ircd/s_misc.c Sat Jul 31 06:13:04 1999 --- ../ircu2.10.06-VIP/ircd/s_misc.c Tue Sep 14 20:39:26 1999 *************** *** 339,345 **** { sprintf_irc(sendbuf, ":%s NOTICE * :*** Notice -- Client exiting: %s (%s@%s) [%s] [%s]", ! me.name, bcptr->name, bcptr->user->username, bcptr->user->host, comment, inetntoa(bcptr->ip)); sendbufto_op_mask(SNO_CONNEXIT); } --- 339,345 ---- { sprintf_irc(sendbuf, ":%s NOTICE * :*** Notice -- Client exiting: %s (%s@%s) [%s] [%s]", ! me.name, bcptr->name, bcptr->user->username, bcptr->user->host, comment, inetntoa(bcptr->ip)); sendbufto_op_mask(SNO_CONNEXIT); } diff -crN ../ircu2.10.06-no_whois_secret/ircd/s_serv.c ../ircu2.10.06-VIP/ircd/s_serv.c *** ../ircu2.10.06-no_whois_secret/ircd/s_serv.c Sat Jul 31 06:13:04 1999 --- ../ircu2.10.06-VIP/ircd/s_serv.c Tue Sep 14 20:55:07 1999 *************** *** 2550,2555 **** --- 2550,2556 ---- tabla_residente[DBH_OPERDB]=1; tabla_residente[DBH_CHANDB]=1; tabla_residente[DBH_BOTSDB]=1; + tabla_residente[DBH_VIRTUALDB]=1; /* --------------------------------------------------- */ for(i=DBH_PRIMERA_TABLA;i<=DBH_ULTIMA_TABLA;i++) diff -crN ../ircu2.10.06-no_whois_secret/ircd/s_user.c ../ircu2.10.06-VIP/ircd/s_user.c *** ../ircu2.10.06-no_whois_secret/ircd/s_user.c Sat Jul 31 06:13:04 1999 --- ../ircu2.10.06-VIP/ircd/s_user.c Thu Sep 30 20:42:54 1999 *************** *** 71,76 **** --- 71,79 ---- /* This is not ANSI, but we have it anyway... */ __BEGIN_DECLS char *crypt(const char *key, const char *salt); + #ifdef DBH_VIP + void make_virtualhost(aClient *acptr); + #endif __END_DECLS /* *INDENT-ON* */ *************** *** 736,741 **** --- 739,746 ---- static int user_hmodes[] = { HMODE_NICKREGISTERED, 'r', HMODE_HELPOP, 'h', + HMODE_HIDDEN, 'x', + HMODE_HIDDENVIEWER, 'X', HMODE_SERVICESBOT, 'B', 0, 0 }; *************** *** 1148,1166 **** nombre=nick; if(legal) { ! sendto_one(cptr, ":%s NOTICE %s :Contraseña aceptada. Bienvenid@ a casa ;)", me.name, nick ); hflag='+'; } else { if(parc<3) { ! sendto_one(cptr, ":%s NOTICE %s :El nick %s está Registrado, necesitas contraseña.", me.name, nombre, nick ); } else { ! sendto_one(cptr, ":%s NOTICE %s :Contraseña Incorrecta para el nick %s.", me.name, nombre, nick ); } ! sendto_one(cptr, ":%s NOTICE %s :Utiliza /QUOTE NICK %s contraseña para identificarte.", me.name, nombre, nick ); sendto_one(cptr,err_str(ERR_NICKREGISTERED), --- 1153,1171 ---- nombre=nick; if(legal) { ! sendto_one(cptr, ":%s NOTICE %s :*** Contraseña aceptada. Bienvenid@ a casa ;)", me.name, nick ); hflag='+'; } else { if(parc<3) { ! sendto_one(cptr, ":%s NOTICE %s :*** El nick %s está Registrado, necesitas contraseña.", me.name, nombre, nick ); } else { ! sendto_one(cptr, ":%s NOTICE %s :*** Contraseña Incorrecta para el nick %s.", me.name, nombre, nick ); } ! sendto_one(cptr, ":%s NOTICE %s :*** Utiliza /QUOTE NICK %s contraseña para identificarte.", me.name, nombre, nick ); sendto_one(cptr,err_str(ERR_NICKREGISTERED), *************** *** 1243,1249 **** } #endif hAddClient(sptr); ! server->serv->ghost = 0; /* :server NICK means end of net.burst */ strncpy(sptr->info, parv[parc - 1], sizeof(sptr->info) - 1); strncpy(sptr->user->host, parv[5], sizeof(sptr->user->host) - 1); --- 1248,1257 ---- } #endif hAddClient(sptr); ! #ifdef DBH_VIP ! if(IsHidden(sptr)) ! make_virtualhost(sptr); ! #endif server->serv->ghost = 0; /* :server NICK means end of net.burst */ strncpy(sptr->info, parv[parc - 1], sizeof(sptr->info) - 1); strncpy(sptr->user->host, parv[5], sizeof(sptr->user->host) - 1); *************** *** 1374,1384 **** --- 1382,1397 ---- if(hflag=='+') { SetNickRegistered(sptr); /* por si era nuevo */ + #ifdef DBH_VIP + SetHidden(sptr); /* lo oculto */ + make_virtualhost(sptr); + #endif if( dbh_buscar_registro_local(DBH_OPERDB, nick) ) SetHelpOp(sptr); } else { ClearNickRegistered(sptr); /* por si era nuevo */ ClearHelpOp(sptr); + ClearHidden(sptr); /* desoculto */ } send_umode_out(cptr, sptr, of, oh); *************** *** 2540,2548 **** { if (i < j) *sbuf++ = ' '; sbuf = sprintf_irc(sbuf, "%s%s=%c%s@%s", acptr->name, IsAnOper(acptr) ? "*" : "", (acptr->user->away) ? '-' : '+', ! acptr->user->username, acptr->user->host); } else { --- 2553,2568 ---- { if (i < j) *sbuf++ = ' '; + #ifdef DBH_VIP + sbuf = sprintf_irc(sbuf, "%s%s=%c%s@%s", acptr->name, + IsAnOper(acptr) ? "*" : "", (acptr->user->away) ? '-' : '+', + acptr->user->username, + IsHiddenViewer(sptr)?acptr->user->host:get_virtualhost(acptr)); + #else sbuf = sprintf_irc(sbuf, "%s%s=%c%s@%s", acptr->name, IsAnOper(acptr) ? "*" : "", (acptr->user->away) ? '-' : '+', ! acptr->user->username, acptr->user->host); ! #endif } else { *************** *** 2582,2590 **** --- 2602,2617 ---- { if (i < j) *sbuf++ = ' '; + #ifdef DB_HISPANO + sbuf = sprintf_irc(sbuf, "%s%s=%c%s@%s", acptr->name, + IsAnOper(acptr) ? "*" : "", (acptr->user->away) ? '-' : '+', + acptr->user->username, + (IsHiddenViewer(sptr) || !IsHidden(acptr))?inetntoa(acptr->ip):"127.0.0.1"); + #else sbuf = sprintf_irc(sbuf, "%s%s=%c%s@%s", acptr->name, IsAnOper(acptr) ? "*" : "", (acptr->user->away) ? '-' : '+', acptr->user->username, inetntoa(acptr->ip)); + #endif } else { *************** *** 2817,2825 **** --- 2844,2865 ---- if( !(sethmodes & HMODE_HELPOP) && !( IsNickRegistered(sptr) && dbh_buscar_registro_local(DBH_OPERDB,sptr->name)) ) ClearHelpOp(sptr); + if( !(sethmodes & HMODE_HIDDEN) && !( IsNickRegistered(sptr) ) ) + ClearHidden(sptr); + + if( !(sethmodes & HMODE_HIDDENVIEWER) && !( IsHelpOp(sptr) || IsAnOper(sptr) ) ) + ClearHiddenViewer(sptr); + if( !(sethmodes & HMODE_SERVICESBOT) ) ClearServicesBot(sptr); } + + #ifdef DBH_VIP + /* si acaba de hacerse +x, calculo el virtualhost */ + if( !(sethmodes & HMODE_HIDDEN) && IsHidden(sptr) ) + make_virtualhost(sptr); + #endif + #endif /* *************** *** 2831,2837 **** && !IsOper(sptr) #endif #if defined(DB_HISPANO) && defined(DBH_OPER_HACK_KMODE) ! && !( IsNickRegistered(sptr) && dbh_buscar_registro_local(DBH_OPERDB,sptr->name) ) #endif ) sptr->flags &= ~FLAGS_CHSERV; --- 2871,2877 ---- && !IsOper(sptr) #endif #if defined(DB_HISPANO) && defined(DBH_OPER_HACK_KMODE) ! && !IsHelpOp(sptr) #endif ) sptr->flags &= ~FLAGS_CHSERV; *************** *** 3286,3288 **** --- 3326,3407 ---- } return 0; } + + #ifdef DBH_VIP + /* + * char *get_virtualhost(acptr) ** MIGRAR A hispano.c ** + * + * nos da la ip real o la virtual de una conexion dependiendo + * del userflag +x/-x + * + */ + char *get_virtualhost(aClient *acptr) + { + if(!IsUser(acptr)) + return ""; /* esto no deberia salir nunca */ + + if(!IsHidden(acptr)) + return acptr->user->host; + else + return acptr->user->virtualhost; + } + + /* + * make_virtualhost(acptr) ** MIGRAR A hispano.c ** + * + * crea la ip virtual + * + */ + void make_virtualhost(aClient *acptr) + { + struct dbh_reg *reg; + unsigned long v[2],k[2],x[2]; + int cont=(NICKLEN+8)/8, ts=0; + char hash[12+1]; + + strcpy(acptr->user->virtualhost, acptr->user->host); + + if( (reg=dbh_buscar_registro_local(DBH_VIRTUALDB, acptr->name)) ) + { + strncpy(acptr->user->virtualhost, reg->valor, sizeof(acptr->user->virtualhost)); + sendto_one(acptr, ":%s NOTICE %s :*** Protección IP: tu dirección virtual es %s", + me.name, acptr->name, acptr->user->virtualhost); + return; + } + + if( !(reg=dbh_buscar_registro_local(ESNET_NICKDB, acptr->name)) && + !(reg=dbh_buscar_registro_local(DBH_NICKDB, acptr->name)) + ) + return; + + strncpy(hash, reg->valor, 12); + + while(1) { + /* resultado */ + x[0]=x[1]=0; + + /* valor */ + v[0]=base64toint(hash); + v[1]=base64toint(hash+6); + + /* clave */ + k[0]=(long)acptr->ip.s_addr; + k[1]=(long)((acptr->yxx[0]<<24)+(acptr->yxx[1]<<16)+(acptr->yxx[2]<<8)+ts); + + tea(v,k,x); + + strcpy(acptr->user->virtualhost, inttobase64(x[0])); + strcat(acptr->user->virtualhost, inttobase64(x[1])); + strcat(acptr->user->virtualhost, ".virtual"); + + if( strchr(acptr->user->virtualhost, '[') == NULL && + strchr(acptr->user->virtualhost, ']') == NULL ) + break; /* nice host name */ + else + ts+=65537; + } + + sendto_one(acptr, ":%s NOTICE %s :*** Protección IP: tu dirección virtual es %s", + me.name, acptr->name, acptr->user->virtualhost); + } + #endif \ No newline at end of file diff -crN ../ircu2.10.06-no_whois_secret/ircd/send.c ../ircu2.10.06-VIP/ircd/send.c *** ../ircu2.10.06-no_whois_secret/ircd/send.c Sat Jul 31 06:13:04 1999 --- ../ircu2.10.06-VIP/ircd/send.c Thu Sep 30 17:52:28 1999 *************** *** 309,316 **** } if (*user->host && !MyConnect(from)) { ! strcat(sender, "@"); ! strcat(sender, user->host); flag = 1; } } --- 309,320 ---- } if (*user->host && !MyConnect(from)) { ! strcat(sender, "@"); ! #ifdef DBH_VIP ! strcat(sender, get_virtualhost(from)); ! #else ! strcat(sender, user->host); ! #endif flag = 1; } } *************** *** 321,330 **** --- 325,338 ---- if (!flag && MyConnect(from) && *user->host) { strcat(sender, "@"); + #ifdef DBH_VIP + strcat(sender, get_virtualhost(from)); + #else if (IsUnixSocket(from)) strcat(sender, user->host); else strcat(sender, from->sockhost); + #endif } *sendbuf = ':'; strcpy(&sendbuf[1], sender); diff -crN ../ircu2.10.06-no_whois_secret/ircd/whocmds.c ../ircu2.10.06-VIP/ircd/whocmds.c *** ../ircu2.10.06-no_whois_secret/ircd/whocmds.c Tue Sep 14 14:20:38 1999 --- ../ircu2.10.06-VIP/ircd/whocmds.c Thu Sep 30 18:06:48 1999 *************** *** 219,225 **** --- 219,230 ---- if (!fields || (fields & WHO_FIELD_HOS)) { + #ifdef DBH_VIP + Reg3 char *p2 = (IsHiddenViewer(sptr)) ? + acptr->user->host : get_virtualhost(acptr); + #else Reg3 char *p2 = acptr->user->host; + #endif *(p1++) = ' '; while ((*p2) && (*(p1++) = *(p2++))); } *************** *** 254,260 **** else if (chptr && is_zombie(acptr, chptr)) *(p1++) = '!'; if (IsDeaf(acptr)) ! *(p1++) = 'd'; if (IsAnOper(sptr)) { if (IsInvisible(acptr)) --- 259,276 ---- else if (chptr && is_zombie(acptr, chptr)) *(p1++) = '!'; if (IsDeaf(acptr)) ! *(p1++) = 'd'; ! #ifdef DB_HISPANO ! if(IsHelpOp(acptr)) ! *(p1++) = 'h'; ! if(IsHidden(acptr)) ! *(p1++) = 'x'; ! if(IsHiddenViewer(acptr)) ! *(p1++) = 'X'; ! if(IsNickRegistered(acptr)) ! *(p1++) = 'r'; ! #endif ! if (IsAnOper(sptr)) { if (IsInvisible(acptr)) *************** *** 571,577 **** if ((bitsel & WHOSELECT_OPER) && !IsAnOper(acptr)) continue; if (!(SEE_USER(sptr, acptr, bitsel))) ! continue; if ((mask) && ((!(matchsel & WHO_FIELD_NIC)) || matchexec(acptr->name, mymask, minlen)) --- 587,595 ---- if ((bitsel & WHOSELECT_OPER) && !IsAnOper(acptr)) continue; if (!(SEE_USER(sptr, acptr, bitsel))) ! continue; ! #ifdef DB_HISPANO ! /* tengo ke pensar un rato en ello. 1999/09/14 savage@apostols.org */ if ((mask) && ((!(matchsel & WHO_FIELD_NIC)) || matchexec(acptr->name, mymask, minlen)) *************** *** 587,593 **** || ((((acptr->ip.s_addr & imask.mask.s_addr) != imask.bits.s_addr)) || (imask.fall && matchexec(inet_ntoa(acptr->ip), mymask, minlen))))) ! continue; if (!SHOW_MORE(sptr, counter)) break; do_who(sptr, acptr, NULL, fields, qrt); --- 605,629 ---- || ((((acptr->ip.s_addr & imask.mask.s_addr) != imask.bits.s_addr)) || (imask.fall && matchexec(inet_ntoa(acptr->ip), mymask, minlen))))) ! continue; ! #else ! if ((mask) && ! ((!(matchsel & WHO_FIELD_NIC)) ! || matchexec(acptr->name, mymask, minlen)) ! && ((!(matchsel & WHO_FIELD_UID)) ! || matchexec(acptr->user->username, mymask, minlen)) ! && ((!(matchsel & WHO_FIELD_SER)) ! || (!(acptr->user->server->flags & FLAGS_MAP))) ! && ((!(matchsel & WHO_FIELD_HOS)) ! || matchexec(acptr->user->host, mymask, minlen)) ! && ((!(matchsel & WHO_FIELD_REN)) ! || matchexec(acptr->info, mymask, minlen)) ! && ((!(matchsel & WHO_FIELD_NIP)) ! || ((((acptr->ip.s_addr & imask.mask.s_addr) != imask.bits.s_addr)) ! || (imask.fall ! && matchexec(inet_ntoa(acptr->ip), mymask, minlen))))) ! continue; ! #endif if (!SHOW_MORE(sptr, counter)) break; do_who(sptr, acptr, NULL, fields, qrt); *************** *** 716,723 **** if (user) { a2cptr = user->server; ! sendto_one(sptr, rpl_str(RPL_WHOISUSER), me.name, ! parv[0], name, user->username, user->host, acptr->info); } else { --- 752,765 ---- if (user) { a2cptr = user->server; ! #ifdef DBH_VIP ! sendto_one(sptr, rpl_str(RPL_WHOISUSER), me.name, ! parv[0], name, user->username, ! IsHiddenViewer(sptr)?acptr->user->host:get_virtualhost(acptr), acptr->info); ! #else ! sendto_one(sptr, rpl_str(RPL_WHOISUSER), me.name, ! parv[0], name, user->username, user->host, acptr->info); ! #endif } else { *************** *** 786,792 **** if (IsHelpOp(acptr)) sendto_one(sptr, rpl_str(RPL_WHOISHELPOP), ! me.name, parv[0], name); #endif if (IsAnOper(acptr)) --- 828,840 ---- if (IsHelpOp(acptr)) sendto_one(sptr, rpl_str(RPL_WHOISHELPOP), ! me.name, parv[0], name); ! #ifdef DBH_VIP ! if (IsHidden(acptr) && IsHiddenViewer(sptr)) ! sendto_one(sptr, rpl_str(RPL_WHOISHOST), ! me.name, parv[0], name, user->host, inetntoa(acptr->ip)); ! #endif /* DBH_VIP */ ! #endif if (IsAnOper(acptr)) *************** *** 810,817 **** user = acptr->user; name = (!*acptr->name) ? "?" : acptr->name; a2cptr = user->server; sendto_one(sptr, rpl_str(RPL_WHOISUSER), me.name, ! parv[0], name, user->username, user->host, acptr->info); goto exact_match; } } --- 858,872 ---- user = acptr->user; name = (!*acptr->name) ? "?" : acptr->name; a2cptr = user->server; + #ifdef DBH_VIP + sendto_one(sptr, rpl_str(RPL_WHOISUSER), me.name, + parv[0], name, user->username, + get_virtualhost(acptr), + acptr->info); + #else sendto_one(sptr, rpl_str(RPL_WHOISUSER), me.name, ! parv[0], name, user->username, user->host, acptr->info) ! #endif goto exact_match; } } diff -crN ../ircu2.10.06-no_whois_secret/ircd/whowas.c ../ircu2.10.06-VIP/ircd/whowas.c *** ../ircu2.10.06-no_whois_secret/ircd/whowas.c Sat Jul 31 06:13:04 1999 --- ../ircu2.10.06-VIP/ircd/whowas.c Thu Sep 30 17:55:04 1999 *************** *** 206,212 **** --- 206,216 ---- ww.newww->logoff = now; DupString(ww.newww->name, cptr->name); DupString(ww.newww->username, cptr->user->username); + #ifdef DBH_VIP + DupString(ww.newww->hostname, get_virtualhost(cptr)); + #else DupString(ww.newww->hostname, cptr->user->host); + #endif /* Should be changed to server numeric */ DupString(ww.newww->servername, cptr->user->server->name); DupString(ww.newww->realname, cptr->info);