summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authormichael <michael@82007160-df01-0410-b94d-b575c5fd34c7>2012-11-04 17:09:47 +0000
committermichael <michael@82007160-df01-0410-b94d-b575c5fd34c7>2012-11-04 17:09:47 +0000
commit7d878fff67e99f144aa1df6c43c5ac8fe957bee6 (patch)
tree9864755e4a8346eafa07ad4e393c69b432ae181c /modules
parentb718094b79a1f3619a2269e67f9a492105c2cf70 (diff)
- Cleanup configuration subsystem
- Fixed broken CIDR support for /challenge git-svn-id: svn://svn.ircd-hybrid.org/svnroot/ircd-hybrid/trunk@1636 82007160-df01-0410-b94d-b575c5fd34c7
Diffstat (limited to 'modules')
-rw-r--r--modules/m_challenge.c7
-rw-r--r--modules/m_connect.c39
-rw-r--r--modules/m_testline.c6
3 files changed, 21 insertions, 31 deletions
diff --git a/modules/m_challenge.c b/modules/m_challenge.c
index 2327ee7..7293e7b 100644
--- a/modules/m_challenge.c
+++ b/modules/m_challenge.c
@@ -123,12 +123,7 @@ m_challenge(struct Client *client_p, struct Client *source_p,
source_p->localClient->response = NULL;
source_p->localClient->auth_oper = NULL;
- if ((conf = find_conf_exact(CONF_OPER,
- parv[1], source_p->username, source_p->host)))
- ;
- else if ((conf = find_conf_exact(CONF_OPER, parv[1], source_p->username,
- source_p->sockhost)))
- ;
+ conf = find_exact_name_conf(CONF_OPER, source_p, parv[1], NULL, NULL);
if (!conf)
{
diff --git a/modules/m_connect.c b/modules/m_connect.c
index b769d8b..1d27f53 100644
--- a/modules/m_connect.c
+++ b/modules/m_connect.c
@@ -90,17 +90,15 @@ mo_connect(struct Client *client_p, struct Client *source_p,
/*
* try to find the name, then host, if both fail notify ops and bail
*/
- if ((conf = find_matching_name_conf(CONF_SERVER, parv[1], NULL, NULL, 0)))
- ;
- else if ((conf = find_matching_name_conf(CONF_SERVER, NULL, NULL, parv[1], 0)))
- ;
-
- if (!conf)
+ if (!(conf = find_matching_name_conf(CONF_SERVER, parv[1], NULL, NULL, 0)))
{
- sendto_one(source_p,
- ":%s NOTICE %s :Connect: Host %s not listed in ircd.conf",
- me.name, source_p->name, parv[1]);
- return;
+ if (!(conf = find_matching_name_conf(CONF_SERVER, NULL, NULL, parv[1], 0)))
+ {
+ sendto_one(source_p,
+ ":%s NOTICE %s :Connect: Host %s not listed in ircd.conf",
+ me.name, source_p->name, parv[1]);
+ return;
+ }
}
/* Get port number from user, if given. If not specified,
@@ -207,18 +205,15 @@ ms_connect(struct Client *client_p, struct Client *source_p,
/*
* try to find the name, then host, if both fail notify ops and bail
*/
-
- if ((conf = find_matching_name_conf(CONF_SERVER, parv[1], NULL, NULL, 0)))
- ;
- else if ((conf = find_matching_name_conf(CONF_SERVER, NULL, NULL, parv[1], 0)))
- ;
-
- if (!conf)
- {
- sendto_one(source_p,
- ":%s NOTICE %s :Connect: Host %s not listed in ircd.conf",
- me.name, source_p->name, parv[1]);
- return;
+ if (!(conf = find_matching_name_conf(CONF_SERVER, parv[1], NULL, NULL, 0)))
+ {
+ if (!(conf = find_matching_name_conf(CONF_SERVER, NULL, NULL, parv[1], 0)))
+ {
+ sendto_one(source_p,
+ ":%s NOTICE %s :Connect: Host %s not listed in ircd.conf",
+ me.name, source_p->name, parv[1]);
+ return;
+ }
}
/* Get port number from user, if given. If not specified,
diff --git a/modules/m_testline.c b/modules/m_testline.c
index 4164b2d..086b141 100644
--- a/modules/m_testline.c
+++ b/modules/m_testline.c
@@ -114,7 +114,7 @@ mo_testline(struct Client *client_p, struct Client *source_p,
if (conf != NULL)
{
++matches;
- if (conf->status & CONF_EXEMPT)
+ if (conf->type == CONF_EXEMPT)
sendto_one(source_p,
":%s NOTICE %s :Exempt D-line host [%s] reason [%s]",
me.name, source_p->name, conf->host, conf->reason);
@@ -143,14 +143,14 @@ mo_testline(struct Client *client_p, struct Client *source_p,
{
snprintf(userhost, sizeof(userhost), "%s@%s", conf->user, conf->host);
- if (conf->status & CONF_CLIENT)
+ if (conf->type == CONF_CLIENT)
{
sendto_one(source_p, form_str(RPL_TESTLINE),
me.name, source_p->name, 'I', 0L, userhost,
conf->class ? conf->class->name : "<default>", "");
++matches;
}
- else if (conf->status & CONF_KLINE)
+ else if (conf->type == CONF_KLINE)
{
sendto_one(source_p, form_str(RPL_TESTLINE),
me.name, source_p->name,