X-Git-Url: https://jfr.im/git/irc/rqf/shadowircd.git/blobdiff_plain/850b23f3a94759a861c6aea35440e09d6e7cc916..46b3bb76550cf811d049a534fffddc0da8699f20:/src/newconf.c diff --git a/src/newconf.c b/src/newconf.c index 6fe62dd..36d0517 100644 --- a/src/newconf.c +++ b/src/newconf.c @@ -263,7 +263,7 @@ conf_set_modules_module(void *data) #ifndef STATIC_MODULES char *m_bn; - m_bn = irc_basename((char *) data); + m_bn = rb_basename((char *) data); if(findmodule_byname(m_bn) != -1) return; @@ -723,21 +723,33 @@ conf_set_class_ping_time(void *data) } static void -conf_set_class_cidr_bitlen(void *data) +conf_set_class_cidr_ipv4_bitlen(void *data) { + unsigned int maxsize = 32; + if(*(unsigned int *) data > maxsize) + conf_report_error + ("class::cidr_ipv4_bitlen argument exceeds maxsize (%d > %d) - ignoring.", + *(unsigned int *) data, maxsize); + else + yy_class->cidr_ipv4_bitlen = *(unsigned int *) data; + +} + #ifdef RB_IPV6 +static void +conf_set_class_cidr_ipv6_bitlen(void *data) +{ unsigned int maxsize = 128; -#else - unsigned int maxsize = 32; -#endif if(*(unsigned int *) data > maxsize) conf_report_error - ("class::cidr_bitlen argument exceeds maxsize (%d > %d) - ignoring.", + ("class::cidr_ipv6_bitlen argument exceeds maxsize (%d > %d) - ignoring.", *(unsigned int *) data, maxsize); else - yy_class->cidr_bitlen = *(unsigned int *) data; + yy_class->cidr_ipv6_bitlen = *(unsigned int *) data; } +#endif + static void conf_set_class_number_per_cidr(void *data) { @@ -898,7 +910,13 @@ conf_end_auth(struct TopConf *tc) collapse(yy_aconf->user); collapse(yy_aconf->host); conf_add_class_to_conf(yy_aconf); - add_conf_by_address(yy_aconf->host, CONF_CLIENT, yy_aconf->user, yy_aconf->spasswd, yy_aconf); + if (find_exact_conf_by_address("*", CONF_CLIENT, "*")) + conf_report_error("Ignoring redundant auth block (after *@*)"); + else if (find_exact_conf_by_address(yy_aconf->host, CONF_CLIENT, yy_aconf->user)) + conf_report_error("Ignoring duplicate auth block for %s@%s", + yy_aconf->user, yy_aconf->host); + else + add_conf_by_address(yy_aconf->host, CONF_CLIENT, yy_aconf->user, yy_aconf->spasswd, yy_aconf); RB_DLINK_FOREACH_SAFE(ptr, next_ptr, yy_aconf_list.head) { @@ -924,7 +942,13 @@ conf_end_auth(struct TopConf *tc) conf_add_class_to_conf(yy_tmp); - add_conf_by_address(yy_tmp->host, CONF_CLIENT, yy_tmp->user, yy_tmp->spasswd, yy_tmp); + if (find_exact_conf_by_address("*", CONF_CLIENT, "*")) + conf_report_error("Ignoring redundant auth block (after *@*)"); + else if (find_exact_conf_by_address(yy_tmp->host, CONF_CLIENT, yy_tmp->user)) + conf_report_error("Ignoring duplicate auth block for %s@%s", + yy_tmp->user, yy_tmp->host); + else + add_conf_by_address(yy_tmp->host, CONF_CLIENT, yy_tmp->user, yy_tmp->spasswd, yy_tmp); rb_dlinkDestroy(ptr, &yy_aconf_list); } @@ -1231,13 +1255,6 @@ conf_end_connect(struct TopConf *tc) yy_server->flags &= ~SERVER_COMPRESSED; } #endif - if(ServerConfCompressed(yy_server) && ServerConfSSL(yy_server)) - { - conf_report_error("Ignoring compressed for connect block %s -- " - "ssl and compressed are mutually exclusive (OpenSSL does its own compression)", - yy_server->name); - yy_server->flags &= ~SERVER_COMPRESSED; - } add_server_conf(yy_server); rb_dlinkAdd(yy_server, &yy_server->node, &server_conf_list); @@ -2036,7 +2053,10 @@ static struct ConfEntry conf_privset_table[] = static struct ConfEntry conf_class_table[] = { { "ping_time", CF_TIME, conf_set_class_ping_time, 0, NULL }, - { "cidr_bitlen", CF_INT, conf_set_class_cidr_bitlen, 0, NULL }, + { "cidr_ipv4_bitlen", CF_INT, conf_set_class_cidr_ipv4_bitlen, 0, NULL }, +#ifdef RB_IPV6 + { "cidr_ipv6_bitlen", CF_INT, conf_set_class_cidr_ipv6_bitlen, 0, NULL }, +#endif { "number_per_cidr", CF_INT, conf_set_class_number_per_cidr, 0, NULL }, { "number_per_ip", CF_INT, conf_set_class_number_per_ip, 0, NULL }, { "number_per_ip_global", CF_INT,conf_set_class_number_per_ip_global, 0, NULL }, @@ -2165,6 +2185,7 @@ static struct ConfEntry conf_channel_table[] = { "max_chans_per_user", CF_INT, NULL, 0, &ConfigChannel.max_chans_per_user }, { "no_create_on_split", CF_YESNO, NULL, 0, &ConfigChannel.no_create_on_split }, { "no_join_on_split", CF_YESNO, NULL, 0, &ConfigChannel.no_join_on_split }, + { "only_ascii_channels", CF_YESNO, NULL, 0, &ConfigChannel.only_ascii_channels }, { "use_except", CF_YESNO, NULL, 0, &ConfigChannel.use_except }, { "use_invex", CF_YESNO, NULL, 0, &ConfigChannel.use_invex }, { "use_knock", CF_YESNO, NULL, 0, &ConfigChannel.use_knock },