X-Git-Url: https://jfr.im/git/irc/rqf/shadowircd.git/blobdiff_plain/a64c5173a79fe18b4d2ae28d824b785a888ddada..36fb4e9a7743326d1a2ca7601bc9bf1c5b9a0bcb:/modules/m_etrace.c diff --git a/modules/m_etrace.c b/modules/m_etrace.c index 9e2998d..9441a0e 100644 --- a/modules/m_etrace.c +++ b/modules/m_etrace.c @@ -39,7 +39,7 @@ #include "hash.h" #include "common.h" #include "hash.h" -#include "irc_string.h" +#include "match.h" #include "ircd.h" #include "numeric.h" #include "s_serv.h" @@ -52,7 +52,7 @@ static int mo_etrace(struct Client *, struct Client *, int, const char **); static int me_etrace(struct Client *, struct Client *, int, const char **); -static int mo_chantrace(struct Client *, struct Client *, int, const char **); +static int m_chantrace(struct Client *, struct Client *, int, const char **); static int mo_masktrace(struct Client *, struct Client *, int, const char **); struct Message etrace_msgtab = { @@ -61,7 +61,7 @@ struct Message etrace_msgtab = { }; struct Message chantrace_msgtab = { "CHANTRACE", 0, 0, 0, MFLG_SLOW, - {mg_ignore, mg_not_oper, mg_ignore, mg_ignore, mg_ignore, {mo_chantrace, 2}} + {mg_ignore, {m_chantrace, 2}, mg_ignore, mg_ignore, mg_ignore, {m_chantrace, 2}} }; struct Message masktrace_msgtab = { "MASKTRACE", 0, 0, 0, MFLG_SLOW, @@ -80,7 +80,6 @@ static const char *spoofed_sockhost = "0"; /* * m_etrace - * parv[0] = sender prefix * parv[1] = options [or target] * parv[2] = [target] */ @@ -213,7 +212,7 @@ do_single_etrace(struct Client *source_p, struct Client *target_p) } static int -mo_chantrace(struct Client *client_p, struct Client *source_p, int parc, const char *parv[]) +m_chantrace(struct Client *client_p, struct Client *source_p, int parc, const char *parv[]) { struct Client *target_p; struct Channel *chptr; @@ -289,45 +288,7 @@ match_masktrace(struct Client *source_p, rb_dlink_list *list, struct Client *target_p; rb_dlink_node *ptr; const char *sockhost; - char *mangle_gecos = NULL; - if(gecos != NULL) - { - if(strstr(gecos, "\\s")) - { - char *tmp = LOCAL_COPY(gecos); - char *orig = tmp; - char *new = tmp; - while(*orig) - { - if(*orig == '\\' && *(orig + 1) != '\0') - { - if(*(orig + 1) == 's') - { - *new++ = ' '; - orig += 2; - } - /* otherwise skip that and the escaped - * character after it, so we dont mistake - * \\s as \s --fl - */ - else - { - *new++ = *orig++; - *new++ = *orig++; - } - } - else - *new++ = *orig++; - } - - *new = '\0'; - mangle_gecos = LOCAL_COPY(tmp); - } - else - mangle_gecos = LOCAL_COPY(gecos); - } - RB_DLINK_FOREACH(ptr, list->head) { target_p = ptr->data; @@ -349,7 +310,7 @@ match_masktrace(struct Client *source_p, rb_dlink_list *list, if(name != NULL && !match(name, target_p->name)) continue; - if(mangle_gecos != NULL && !match_esc(mangle_gecos, target_p->info)) + if(gecos != NULL && !match_esc(gecos, target_p->info)) continue; sendto_one(source_p, form_str(RPL_ETRACE),