From 3d1f32c07a4eb21713f2ee2b54481d381e4cd362 Mon Sep 17 00:00:00 2001 From: Jilles Tjoelker Date: Sun, 31 Jan 2010 01:36:37 +0100 Subject: [PATCH] Take auth_user into account when detecting redundant/duplicate auth{}. from ircd-seven (spb) --- src/newconf.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/newconf.c b/src/newconf.c index 12893dd0..6afb2aca 100644 --- a/src/newconf.c +++ b/src/newconf.c @@ -892,7 +892,7 @@ conf_begin_auth(struct TopConf *tc) static int conf_end_auth(struct TopConf *tc) { - struct ConfItem *yy_tmp; + struct ConfItem *yy_tmp, *found_conf; rb_dlink_node *ptr; rb_dlink_node *next_ptr; @@ -910,9 +910,12 @@ conf_end_auth(struct TopConf *tc) collapse(yy_aconf->user); collapse(yy_aconf->host); conf_add_class_to_conf(yy_aconf); - if (find_exact_conf_by_address("*", CONF_CLIENT, "*")) + if ((found_conf = find_exact_conf_by_address("*", CONF_CLIENT, "*")) && found_conf->spasswd == NULL) conf_report_error("Ignoring redundant auth block (after *@*)"); - else if (find_exact_conf_by_address(yy_aconf->host, CONF_CLIENT, yy_aconf->user)) + else if ((found_conf = find_exact_conf_by_address(yy_aconf->host, CONF_CLIENT, yy_aconf->user)) && + ( (!found_conf->spasswd && !yy_aconf->spasswd) || + (found_conf->spasswd && yy_aconf->spasswd && + 0 == irccmp(found_conf->spasswd, yy_aconf->spasswd)))) conf_report_error("Ignoring duplicate auth block for %s@%s", yy_aconf->user, yy_aconf->host); else