diff --git a/include/s_newconf.h b/include/s_newconf.h index 61795351..ee25ac99 100644 --- a/include/s_newconf.h +++ b/include/s_newconf.h @@ -237,7 +237,9 @@ extern void set_server_conf_autoconn(struct Client *source_p, char *name, extern struct ConfItem *find_xline(const char *, int); +extern struct ConfItem *find_xline_mask(const char *); extern struct ConfItem *find_nick_resv(const char *name); +extern struct ConfItem *find_nick_resv_mask(const char *name); extern int valid_wild_card_simple(const char *); extern int clean_resv_nick(const char *); diff --git a/modules/m_resv.c b/modules/m_resv.c index 515d3166..aad02c5b 100644 --- a/modules/m_resv.c +++ b/modules/m_resv.c @@ -264,7 +264,7 @@ parse_resv(struct Client *source_p, const char *name, return; } - if(find_nick_resv(name)) + if(find_nick_resv_mask(name)) { sendto_one_notice(source_p, ":A RESV has already been placed on nick: %s", diff --git a/modules/m_xline.c b/modules/m_xline.c index 7056137b..1c7913df 100644 --- a/modules/m_xline.c +++ b/modules/m_xline.c @@ -156,7 +156,7 @@ mo_xline(struct Client *client_p, struct Client *source_p, int parc, const char else if(dlink_list_length(&cluster_conf_list) > 0) cluster_xline(source_p, temp_time, name, reason); - if((aconf = find_xline(name, 0)) != NULL) + if((aconf = find_xline_mask(name)) != NULL) { sendto_one(source_p, ":%s NOTICE %s :[%s] already X-Lined by [%s] - %s", me.name, source_p->name, parv[1], aconf->name, aconf->passwd); @@ -220,7 +220,7 @@ handle_remote_xline(struct Client *source_p, int temp_time, return; /* already xlined */ - if((aconf = find_xline(name, 0)) != NULL) + if((aconf = find_xline_mask(name)) != NULL) { sendto_one_notice(source_p, ":[%s] already X-Lined by [%s] - %s", name, aconf->name, aconf->passwd); return; diff --git a/src/kdparse.c b/src/kdparse.c index 258b666f..ee95d39c 100644 --- a/src/kdparse.c +++ b/src/kdparse.c @@ -177,7 +177,7 @@ parse_x_file(FILE * file) continue; /* sanity checking */ - if((find_xline(gecos_field, 0) != NULL) || + if((find_xline_mask(gecos_field) != NULL) || (strchr(reason_field, ':') != NULL)) continue; @@ -231,7 +231,7 @@ parse_resv_file(FILE * file) } else if(clean_resv_nick(host_field)) { - if(find_nick_resv(host_field)) + if(find_nick_resv_mask(host_field)) continue; aconf = make_conf(); diff --git a/src/s_newconf.c b/src/s_newconf.c index 4b5e1e08..dc0474d5 100644 --- a/src/s_newconf.c +++ b/src/s_newconf.c @@ -528,6 +528,23 @@ find_xline(const char *gecos, int counter) return NULL; } +struct ConfItem * +find_xline_mask(const char *gecos) +{ + struct ConfItem *aconf; + dlink_node *ptr; + + DLINK_FOREACH(ptr, xline_conf_list.head) + { + aconf = ptr->data; + + if(!irccmp(aconf->name, gecos)) + return aconf; + } + + return NULL; +} + struct ConfItem * find_nick_resv(const char *name) { @@ -548,6 +565,23 @@ find_nick_resv(const char *name) return NULL; } +struct ConfItem * +find_nick_resv_mask(const char *name) +{ + struct ConfItem *aconf; + dlink_node *ptr; + + DLINK_FOREACH(ptr, resv_conf_list.head) + { + aconf = ptr->data; + + if(!irccmp(aconf->name, name)) + return aconf; + } + + return NULL; +} + /* clean_resv_nick() * * inputs - nick