[IRC-Dev CVS] [CVS] Module ircd-ircdev: Change committed
Brought to you by:
zolty
From: Toni G. <zo...@us...> - 2005-04-24 22:18:24
|
CVSROOT : /cvsroot/irc-dev Module : ircd-ircdev Commit time: 2005-04-24 22:18:16 UTC Modified files: ChangeLog ChangeLog.es include/patchlevel.h ircd/channel.c ircd/ircd_lexer.l ircd/ircd_parser.y ircd/m_silence.c ircd/m_userhost.c ircd/m_userip.c Log message: Author: zoltan <zo...@ir...> Log message: 2005-04-25 Toni García <zo...@ir...> 1.0.alpha28 * Fix de bugs ---------------------- diff included ---------------------- Index: ircd-ircdev/ChangeLog diff -u ircd-ircdev/ChangeLog:1.29 ircd-ircdev/ChangeLog:1.30 --- ircd-ircdev/ChangeLog:1.29 Fri Apr 22 09:22:11 2005 +++ ircd-ircdev/ChangeLog Sun Apr 24 15:18:05 2005 @@ -1,10 +1,13 @@ # # ChangeLog for ircd-ircdev # -# $Id: ChangeLog,v 1.29 2005/04/22 16:22:11 zolty Exp $ +# $Id: ChangeLog,v 1.30 2005/04/24 22:18:05 zolty Exp $ # # Insert new changes at beginning of the change list. # +2005-04-25 Toni García <zo...@ir...> 1.0.alpha28 + * Fix bugs + 2005-04-22 Toni García <zo...@ir...> 1.0.alpha27 * Undernet synchronization Index: ircd-ircdev/ChangeLog.es diff -u ircd-ircdev/ChangeLog.es:1.29 ircd-ircdev/ChangeLog.es:1.30 --- ircd-ircdev/ChangeLog.es:1.29 Fri Apr 22 09:22:11 2005 +++ ircd-ircdev/ChangeLog.es Sun Apr 24 15:18:05 2005 @@ -1,10 +1,13 @@ # # Log de Cambios para ircd-ircdev # -# $Id: ChangeLog.es,v 1.29 2005/04/22 16:22:11 zolty Exp $ +# $Id: ChangeLog.es,v 1.30 2005/04/24 22:18:05 zolty Exp $ # # Insertar los nuevos cambios al principio de esta lista de cambios. # +2005-04-25 Toni García <zo...@ir...> 1.0.alpha28 + * Fix de bugs + 2005-04-22 Toni García <zo...@ir...> 1.0.alpha27 * Sincronización Undernet Index: ircd-ircdev/include/patchlevel.h diff -u ircd-ircdev/include/patchlevel.h:1.28 ircd-ircdev/include/patchlevel.h:1.29 --- ircd-ircdev/include/patchlevel.h:1.28 Fri Apr 22 09:22:13 2005 +++ ircd-ircdev/include/patchlevel.h Sun Apr 24 15:18:05 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.28 2005/04/22 16:22:13 zolty Exp $ + * $Id: patchlevel.h,v 1.29 2005/04/24 22:18:05 zolty Exp $ * */ -#define PATCHLEVEL ".alpha27" +#define PATCHLEVEL ".alpha28" #define RELEASE "1.0" Index: ircd-ircdev/ircd/channel.c diff -u ircd-ircdev/ircd/channel.c:1.18 ircd-ircdev/ircd/channel.c:1.19 --- ircd-ircdev/ircd/channel.c:1.18 Fri Apr 22 09:22:13 2005 +++ ircd-ircdev/ircd/channel.c Sun Apr 24 15:18:05 2005 @@ -21,7 +21,7 @@ */ /** @file * @brief Channel management and maintanance - * @version $Id: channel.c,v 1.18 2005/04/22 16:22:13 zolty Exp $ + * @version $Id: channel.c,v 1.19 2005/04/24 22:18:05 zolty Exp $ */ #include "config.h" @@ -2837,6 +2837,8 @@ if (!bmatch(ban, newban)) { if (do_free) free_ban(newban); + else + MyFree(newban); return 1; } if (!(ban->flags & (BAN_OVERLAPPED|BAN_DEL))) { @@ -2873,6 +2875,8 @@ } if (do_free) free_ban(newban); + else + MyFree(newban->banstr); return 4; } @@ -2928,7 +2932,7 @@ newban = state->banlist + (state->numbans++); newban->next = 0; newban->flags = ((state->dir == MODE_ADD) ? BAN_ADD : BAN_DEL) - | (*flag_p == 'b' ? 0 : BAN_EXCEPTION); + | (*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); @@ -3031,6 +3035,13 @@ 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); } Index: ircd-ircdev/ircd/ircd_lexer.l diff -u ircd-ircdev/ircd/ircd_lexer.l:1.11 ircd-ircdev/ircd/ircd_lexer.l:1.12 --- ircd-ircdev/ircd/ircd_lexer.l:1.11 Sat Apr 2 11:47:35 2005 +++ ircd-ircdev/ircd/ircd_lexer.l Sun Apr 24 15:18:05 2005 @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: ircd_lexer.l,v 1.11 2005/04/02 19:47:35 zolty Exp $ + * $Id: ircd_lexer.l,v 1.12 2005/04/24 22:18:05 zolty Exp $ * */ @@ -28,6 +28,7 @@ #include <stdlib.h> #include "config.h" #include "ircd.h" +#include "ircd_alloc.h" #include "ircd_string.h" #include "s_debug.h" #include "y.tab.h" @@ -204,7 +205,7 @@ QSTRING \"[^"\n]+[\"\n] %% -{QSTRING} {yytext[yyleng-1] = 0; yylval.text = yytext+1; return QSTRING;} +{QSTRING} {yytext[yyleng-1] = 0; DupString(yylval.text, yytext+1); return QSTRING;} {NUMBER} {yylval.num = strtoul(yytext, NULL, 10); return NUMBER;} {WHITE} ; {SHCOMMENT} ; Index: ircd-ircdev/ircd/ircd_parser.y diff -u ircd-ircdev/ircd/ircd_parser.y:1.18 ircd-ircdev/ircd/ircd_parser.y:1.19 --- ircd-ircdev/ircd/ircd_parser.y:1.18 Fri Apr 22 09:22:13 2005 +++ ircd-ircdev/ircd/ircd_parser.y Sun Apr 24 15:18:05 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.18 2005/04/22 16:22:13 zolty Exp $ + * $Id: ircd_parser.y,v 1.19 2005/04/24 22:18:05 zolty Exp $ * */ %{ @@ -93,7 +93,6 @@ %token <text> QSTRING %token <num> NUMBER -%token <text> FNAME %token GENERAL %token ADMIN @@ -262,6 +261,7 @@ jupenick: NICK '=' QSTRING { addNickJupes($3); + MyFree($3); } ';'; generalblock: GENERAL '{' generalitems '}' @@ -285,16 +285,19 @@ generalname: NAME '=' QSTRING ';' { if (localConf.name == NULL) - DupString(localConf.name, $3); - else if (strcmp(localConf.name, $3)) - parse_error("Redefinition of server name %s (%s)", $3, - localConf.name); + localConf.name = $3; + else { + if (strcmp(localConf.name, $3)) + parse_error("Redefinition of server name %s (%s)", $3, + localConf.name); + MyFree($3); + } }; generaldesc: DESCRIPTION '=' QSTRING ';' { MyFree(localConf.description); - DupString(localConf.description, $3); + localConf.description = $3; ircd_strncpy(cli_info(&me), $3, REALLEN); }; @@ -307,6 +310,7 @@ memcpy(&VirtualHost_v4.addr, &addr, sizeof(addr)); else memcpy(&VirtualHost_v6.addr, &addr, sizeof(addr)); + MyFree($3); }; adminblock: ADMIN '{' adminitems '}' @@ -322,17 +326,17 @@ adminitem: adminlocation | admincontact | error; adminlocation: LOCATION '=' QSTRING ';' { - if (localConf.location1 == NULL) - DupString(localConf.location1, $3); - else if (localConf.location2 == NULL) - DupString(localConf.location2, $3); - /* Otherwise just drop it. -A1kmm */ + if (localConf.location1 == NULL) + localConf.location1 = $3; + else if (localConf.location2 == NULL) + localConf.location2 = $3; + else /* Otherwise just drop it. -A1kmm */ + MyFree($3); }; admincontact: CONTACT '=' QSTRING ';' { - if (localConf.contact != NULL) - MyFree(localConf.contact); - DupString(localConf.contact, $3); + MyFree(localConf.contact); + localConf.contact = $3; }; classblock: CLASS { @@ -366,7 +370,7 @@ classname: NAME '=' QSTRING ';' { MyFree(name); - DupString(name, $3); + name = $3; }; classpingfreq: PINGFREQ '=' timespec ';' { @@ -387,7 +391,7 @@ classusermode: USERMODE '=' QSTRING ';' { MyFree(pass); - DupString(pass, $3); + pass = $3; }; connectblock: CONNECT @@ -395,32 +399,39 @@ maxlinks = 65535; } '{' connectitems '}' { - if (name != NULL && pass != NULL && host != NULL && c_class != NULL - && !strchr(host, '*') && !strchr(host, '?')) - { - struct ConfItem *aconf = make_conf(CONF_SERVER); - aconf->name = name; - aconf->origin_name = origin; - aconf->passwd = pass; - aconf->conn_class = c_class; - aconf->address.port = port; - aconf->host = host; - aconf->maximum = maxlinks; - aconf->hub_limit = hub_limit; - lookup_confhost(aconf); - } - else - { - MyFree(name); - MyFree(pass); - MyFree(host); - MyFree(origin); - MyFree(hub_limit); - parse_error("Bad connect block"); - } - name = pass = host = origin = hub_limit = NULL; - c_class = NULL; - port = 0; + struct ConfItem *aconf = NULL; + if (name == NULL) + parse_error("Missing name in connect block"); + else if (pass == NULL) + parse_error("Missing password in connect block"); + else if (host == NULL) + parse_error("Missing host in connect block"); + else if (strchr(host, '*') || strchr(host, '?')) + parse_error("Invalid host '%s' in connect block", host); + else if (c_class == NULL) + parse_error("Missing class in connect block"); + else { + aconf = make_conf(CONF_SERVER); + aconf->name = name; + aconf->origin_name = origin; + aconf->passwd = pass; + aconf->conn_class = c_class; + aconf->address.port = port; + aconf->host = host; + aconf->maximum = maxlinks; + aconf->hub_limit = hub_limit; + lookup_confhost(aconf); + } + if (!aconf) { + MyFree(name); + MyFree(pass); + MyFree(host); + MyFree(origin); + MyFree(hub_limit); + } + name = pass = host = origin = hub_limit = NULL; + c_class = NULL; + port = 0; }';'; connectitems: connectitem connectitems | connectitem; connectitem: connectname | connectpass | connectclass | connecthost @@ -428,78 +439,73 @@ | connecthublimit | connectmaxhops | error; connectname: NAME '=' QSTRING ';' { - MyFree(name); - DupString(name, $3); + MyFree(name); + name = $3; }; connectpass: PASS '=' QSTRING ';' { - MyFree(pass); - DupString(pass, $3); + MyFree(pass); + pass = $3; }; connectclass: CLASS '=' QSTRING ';' { - c_class = find_class($3); + c_class = find_class($3); + MyFree($3); }; connecthost: HOST '=' QSTRING ';' { - MyFree(host); - DupString(host, $3); + MyFree(host); + host = $3; }; connectport: PORT '=' NUMBER ';' { - port = $3; + port = $3; }; connectvhost: VHOST '=' QSTRING ';' { - MyFree(origin); - DupString(origin, $3); + MyFree(origin); + origin = $3; }; connectleaf: LEAF ';' { - maxlinks = 0; + maxlinks = 0; }; connecthub: HUB ';' { - MyFree(hub_limit); - DupString(hub_limit, "*"); + MyFree(hub_limit); + DupString(hub_limit, "*"); }; connecthublimit: HUB '=' QSTRING ';' { - MyFree(hub_limit); - DupString(hub_limit, $3); + MyFree(hub_limit); + hub_limit = $3; }; connectmaxhops: MAXHOPS '=' expr ';' { - maxlinks = $3; + maxlinks = $3; }; -uworldblock: UWORLD '{' uworlditems '}' ';' -{ - if (name) - { - struct ConfItem *aconf = make_conf(CONF_UWORLD); - aconf->host = name; - } - else - { - MyFree(name); - parse_error("Bad UWorld block"); - } - name = NULL; -}; +uworldblock: UWORLD '{' uworlditems '}' ';'; uworlditems: uworlditem uworlditems | uworlditem; uworlditem: uworldname | error; uworldname: NAME '=' QSTRING ';' { - MyFree(name); - DupString(name, $3); + make_conf(CONF_UWORLD)->host = $3; }; operblock: OPER '{' operitems '}' ';' { - if (name && pass && host && c_class) - { - struct ConfItem *aconf = make_conf(CONF_OPERATOR); + struct ConfItem *aconf = NULL; + if (name == NULL) + parse_error("Missing name in operator block"); + else if (pass == NULL) + parse_error("Missing password in operator block"); + else if (host == NULL) + parse_error("Missing host in operator block"); + else if (c_class == NULL) + parse_error("Missing class in operator block"); + else { + aconf = make_conf(CONF_OPERATOR); aconf->name = name; aconf->passwd = pass; conf_parse_userhost(aconf, host); @@ -510,9 +516,7 @@ && !FlagHas(&c_class->privs_dirty, PRIV_PROPAGATE)) parse_error("Operator block for %s and class %s have no LOCAL setting", name, c_class->cc_name); } - else - { - parse_error("operator blocks need a name, password, class and host."); + if (!aconf) { MyFree(name); MyFree(pass); MyFree(host); @@ -527,29 +531,30 @@ opername: NAME '=' QSTRING ';' { MyFree(name); - DupString(name, $3); + name = $3; }; operpass: PASS '=' QSTRING ';' { MyFree(pass); - DupString(pass, $3); + pass = $3; }; operhost: HOST '=' QSTRING ';' { - MyFree(host); - if (!strchr($3, '@')) - { - int uh_len; - char *b = (char*) MyMalloc((uh_len = strlen($3)+3)); - ircd_snprintf(0, b, uh_len, "*@%s", $3); - host = b; - } - else - DupString(host, $3); + MyFree(host); + if (!strchr($3, '@')) + { + int uh_len; + host = (char*) MyMalloc((uh_len = strlen($3)+3)); + ircd_snprintf(0, host, uh_len, "*@%s", $3); + MyFree($3); + } + else + host = $3; }; operclass: CLASS '=' QSTRING ';' { - c_class = find_class($3); + c_class = find_class($3); + MyFree($3); }; priv: privtype '=' yesorno ';' @@ -600,13 +605,9 @@ portblock: PORT '{' portitems '}' ';' { if (port > 0 && port <= 0xFFFF) - { add_listener(port, host, pass, tconn, tping); - } else - { - parse_error("Bad port block"); - } + parse_error("Port %d is out of range", port); MyFree(host); MyFree(pass); host = pass = NULL; @@ -622,7 +623,7 @@ portvhost: VHOST '=' QSTRING ';' { MyFree(host); - DupString(host, $3); + host = $3; }; portmask: MASK '=' QSTRING ';' @@ -657,7 +658,7 @@ unsigned char addrbits = 0; if (ip && !ipmask_parse(ip, &addr, &addrbits)) { - parse_error("Invalid IP address in block"); + parse_error("Invalid IP address %s in block", ip); MyFree(username); MyFree(host); MyFree(ip); @@ -691,38 +692,40 @@ if (sep) { *sep++ = '\0'; MyFree(username); - DupString(username, $3); DupString(host, sep); + username = $3; } else { - DupString(host, $3); + host = $3; } }; clientip: IP '=' QSTRING ';' { - char *sep = strchr($3, '@'); + char *sep; + sep = strchr($3, '@'); MyFree(ip); if (sep) { *sep++ = '\0'; MyFree(username); - DupString(username, $3); DupString(ip, sep); + username = $3; } else { - DupString(ip, $3); + ip = $3; } }; clientusername: USERNAME '=' QSTRING ';' { MyFree(username); - DupString(username, $3); + username = $3; }; clientclass: CLASS '=' QSTRING ';' { c_class = find_class($3); + MyFree($3); }; clientpass: PASS '=' QSTRING ';' { MyFree(pass); - DupString(pass, $3); + pass = $3; }; clientmaxlinks: MAXLINKS '=' expr ';' { @@ -746,7 +749,7 @@ MyFree(dconf->realmask); MyFree(dconf->message); MyFree(dconf); - parse_error("Bad kill block"); + parse_error("Kill block must match on at least one of username, host or realname"); } dconf = NULL; } ';'; @@ -754,48 +757,47 @@ killitem: killuhost | killreal | killusername | killreasonfile | killreason | error; killuhost: HOST '=' QSTRING ';' { - char *u, *h; + char *h; MyFree(dconf->hostmask); MyFree(dconf->usermask); if ((h = strchr($3, '@')) == NULL) { - u = "*"; - h = $3; + DupString(dconf->usermask, "*"); + dconf->hostmask = $3; } else { - u = $3; *h++ = '\0'; + DupString(dconf->hostmask, h); + dconf->usermask = $3; } - DupString(dconf->hostmask, h); - DupString(dconf->usermask, u); ipmask_parse(dconf->hostmask, &dconf->address, &dconf->bits); }; killusername: USERNAME '=' QSTRING ';' { MyFree(dconf->usermask); - DupString(dconf->usermask, $3); + dconf->usermask = $3; }; killreal: REAL '=' QSTRING ';' { - MyFree(dconf->realmask); - DupString(dconf->realmask, $3); + MyFree(dconf->realmask); + dconf->realmask = $3; }; killreason: REASON '=' QSTRING ';' { - dconf->flags &= ~DENY_FLAGS_FILE; - MyFree(dconf->message); - DupString(dconf->message, $3); + dconf->flags &= ~DENY_FLAGS_FILE; + MyFree(dconf->message); + dconf->message = $3; }; killreasonfile: TFILE '=' QSTRING ';' { - dconf->flags |= DENY_FLAGS_FILE; - MyFree(dconf->message); - DupString(dconf->message, $3); + dconf->flags |= DENY_FLAGS_FILE; + MyFree(dconf->message); + dconf->message = $3; }; cruleblock: CRULE @@ -803,8 +805,14 @@ tconn = CRULE_AUTO; } '{' cruleitems '}' ';' { - struct CRuleNode *node; - if (host != NULL && pass != NULL && (node=crule_parse(pass)) != NULL) + struct CRuleNode *node = NULL; + if (host == NULL) + parse_error("Missing host in crule block"); + else if (pass == NULL) + parse_error("Missing rule in crule block"); + else if ((node = crule_parse(pass)) == NULL) + parse_error("Invalid rule '%s' in crule block", pass); + else { struct CRuleConf *p = (struct CRuleConf*) MyMalloc(sizeof(*p)); p->hostmask = host; @@ -814,11 +822,10 @@ p->next = cruleConfList; cruleConfList = p; } - else + if (!node) { MyFree(host); MyFree(pass); - parse_error("Bad CRule block"); } host = pass = NULL; tconn = 0; @@ -831,13 +838,13 @@ { MyFree(host); collapse($3); - DupString(host, $3); + host = $3; }; crulerule: RULE '=' QSTRING ';' { - MyFree(pass); - DupString(pass, $3); + MyFree(pass); + pass = $3; }; cruleall: ALL '=' YES ';' @@ -861,12 +868,12 @@ motditem: motdhost | motdfile | error; motdhost: HOST '=' QSTRING ';' { - DupString(host, $3); + host = $3; }; motdfile: TFILE '=' QSTRING ';' { - DupString(pass, $3); + pass = $3; }; featuresblock: FEATURES '{' featureitems '}' ';'; @@ -884,7 +891,10 @@ stringno = 2; } posextrastrings { + unsigned int ii; feature_set(NULL, (const char * const *)stringlist, stringno); + for (ii = 0; ii < stringno; ++ii) + MyFree(stringlist[ii]); }; posextrastrings: /* empty */ | extrastrings; extrastrings: extrastrings extrastring | extrastring; @@ -892,6 +902,8 @@ { if (stringno < MAX_STRINGS) stringlist[stringno++] = $1; + else + MyFree($1); }; quarantineblock: QUARANTINE '{' quarantineitems '}' ';'; @@ -899,8 +911,8 @@ quarantineitem: QSTRING '=' QSTRING ';' { struct qline *qconf = MyCalloc(1, sizeof(*qconf)); - DupString(qconf->chname, $1); - DupString(qconf->reason, $3); + qconf->chname = $1; + qconf->reason = $3; qconf->next = GlobalQuarantineList; GlobalQuarantineList = qconf; }; @@ -908,16 +920,19 @@ pseudoblock: PSEUDO QSTRING '{' { smap = MyCalloc(1, sizeof(struct s_map)); - DupString(smap->command, $2); + smap->command = $2; } pseudoitems '}' ';' { - if (!smap->name || !smap->services) - { - parse_error("pseudo commands need a service name and list of target nicks."); - return 0; - } - if (register_mapping(smap)) + int valid = 0; + + if (!smap->name) + parse_error("Missing name in pseudo %s block", smap->command); + else if (!smap->services) + parse_error("Missing nick in pseudo %s block", smap->command); + else + valid = 1; + if (valid && register_mapping(smap)) { smap->next = GlobalServiceMapList; GlobalServiceMapList = smap; @@ -942,11 +957,13 @@ pseudoitem: pseudoname | pseudoprepend | pseudonick | pseudoflags | error; pseudoname: NAME '=' QSTRING ';' { - DupString(smap->name, $3); + MyFree(smap->name); + smap->name = $3; }; pseudoprepend: PREPEND '=' QSTRING ';' { - DupString(smap->prepend, $3); + MyFree(smap->prepend); + smap->prepend = $3; }; pseudonick: NICK '=' QSTRING ';' { @@ -960,6 +977,7 @@ nh->next = smap->services; smap->services = nh; } + MyFree($3); }; pseudoflags: FAST ';' { @@ -972,11 +990,12 @@ tping = 60; } iauthitems '}' ';' { - if (!host || !port) { - parse_error("IAuth block needs a server name and port."); - return 0; - } - iauth_connect(host, port, pass, tconn, tping); + if (!host) + parse_error("Missing host in iauth block"); + else if (!port) + parse_error("Missing port in iauth block"); + else + iauth_connect(host, port, pass, tconn, tping); MyFree(pass); MyFree(host); pass = host = NULL; @@ -988,12 +1007,12 @@ iauthpass: PASS '=' QSTRING ';' { MyFree(pass); - DupString(pass, $3); + pass = $3; }; iauthhost: HOST '=' QSTRING ';' { MyFree(host); - DupString(host, $3); + host = $3; }; iauthport: PORT '=' NUMBER ';' { Index: ircd-ircdev/ircd/m_silence.c diff -u ircd-ircdev/ircd/m_silence.c:1.6 ircd-ircdev/ircd/m_silence.c:1.7 --- ircd-ircdev/ircd/m_silence.c:1.6 Mon Feb 21 02:20:04 2005 +++ ircd-ircdev/ircd/m_silence.c Sun Apr 24 15:18:06 2005 @@ -21,7 +21,7 @@ */ /** @file * @brief Handlers for SILENCE command. - * @version $Id: m_silence.c,v 1.6 2005/02/21 10:20:04 zolty Exp $ + * @version $Id: m_silence.c,v 1.7 2005/04/24 22:18:06 zolty Exp $ */ #include "config.h" @@ -58,7 +58,7 @@ * @return The new ban entry on success, NULL on failure. */ static struct Ban * -apply_silence(struct Client *sptr, const char *mask) +apply_silence(struct Client *sptr, char *mask) { struct Ban *sile; int flags; @@ -82,7 +82,7 @@ } /* Make the silence, set flags, and apply it. */ - sile = make_ban(mask); + sile = make_ban(pretty_mask(mask)); sile->flags |= flags; return apply_ban(&cli_user(sptr)->silence, sile, 1) ? NULL : sile; } Index: ircd-ircdev/ircd/m_userhost.c diff -u ircd-ircdev/ircd/m_userhost.c:1.5 ircd-ircdev/ircd/m_userhost.c:1.6 --- ircd-ircdev/ircd/m_userhost.c:1.5 Mon Jan 10 04:23:03 2005 +++ ircd-ircdev/ircd/m_userhost.c Sun Apr 24 15:18:06 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_userhost.c,v 1.5 2005/01/10 12:23:03 zolty Exp $ + * $Id: m_userhost.c,v 1.6 2005/04/24 22:18:06 zolty Exp $ * */ @@ -97,6 +97,13 @@ msgq_append(0, mb, "%s%s=%c%s@%s", cli_name(cptr), SeeOper(sptr,cptr) ? "*" : "", cli_user(cptr)->away ? '-' : '+', cli_user(cptr)->username, + /* Do not *EVER* change this to give opers the real host. + * Too many scripts rely on this data and can inadvertently + * publish the user's real host, thus breaking the security + * of +x. If an oper wants the real host, he should go to + * /whois to get it. + */ + /* HasHiddenHost(cptr) && (sptr != cptr) ? */ HasHiddenHost(cptr) && !IsAnOper(sptr) && (sptr != cptr) ? cli_user(cptr)->host : cli_user(cptr)->realhost); Index: ircd-ircdev/ircd/m_userip.c diff -u ircd-ircdev/ircd/m_userip.c:1.6 ircd-ircdev/ircd/m_userip.c:1.7 --- ircd-ircdev/ircd/m_userip.c:1.6 Mon Jan 10 04:23:03 2005 +++ ircd-ircdev/ircd/m_userip.c Sun Apr 24 15:18:06 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_userip.c,v 1.6 2005/01/10 12:23:03 zolty Exp $ + * $Id: m_userip.c,v 1.7 2005/04/24 22:18:06 zolty Exp $ * */ @@ -98,6 +98,13 @@ msgq_append(0, mb, "%s%s=%c%s@%s", cli_name(cptr), SeeOper(sptr,cptr) ? "*" : "", cli_user(cptr)->away ? '-' : '+', cli_user(cptr)->username, + /* Do not *EVER* change this to give opers the real host. + * Too many scripts rely on this data and can inadvertently + * publish the user's real host, thus breaking the security + * of +x. If an oper wants the real host, he should go to + * /whois to get it. + */ + /* HasHiddenHost(cptr) && (sptr != cptr) ? */ HasHiddenHost(cptr) && !IsAnOper(sptr) && (sptr != cptr) ? feature_str(FEAT_HIDDEN_IP) : ircd_ntoa(&cli_ip(cptr))); ----------------------- End of diff ----------------------- |