Avoid wrong detection of redundant/duplicate auth blocks with auth_user.

If there was more than one user= per auth block, the check for redundant
or duplicate auth blocks did not take auth_user into account.
This commit is contained in:
Jilles Tjoelker 2014-01-17 00:22:47 +01:00
parent 362ef2d9ee
commit 0c2ea0c3ce
1 changed files with 4 additions and 2 deletions

View File

@ -984,9 +984,11 @@ conf_end_auth(struct TopConf *tc)
conf_add_class_to_conf(yy_tmp);
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_tmp->host, CONF_CLIENT, yy_tmp->user))
else if ((found_conf = find_exact_conf_by_address(yy_tmp->host, CONF_CLIENT, yy_tmp->user)) &&
(!found_conf->spasswd || (yy_tmp->spasswd &&
0 == irccmp(found_conf->spasswd, yy_tmp->spasswd))))
conf_report_error("Ignoring duplicate auth block for %s@%s",
yy_tmp->user, yy_tmp->host);
else