From 83f7ffe7e5cb8110964209e86ce8e44b11f4088d Mon Sep 17 00:00:00 2001 From: michael Date: Wed, 16 Jan 2013 18:30:52 +0000 Subject: - Forward-port -r1750 [IMPORTANT: nick and topic lengths are now configurable via ircd.conf. A max_nick_length, as well as a max_topic_length configuration option can now be found in the serverinfo{} block] - OpenSSL 0.9.8s and higher is now required in order to enable ssl support git-svn-id: svn://svn.ircd-hybrid.org/svnroot/ircd-hybrid/trunk@1751 82007160-df01-0410-b94d-b575c5fd34c7 --- src/conf.c | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) (limited to 'src/conf.c') diff --git a/src/conf.c b/src/conf.c index 1f91a8b..3d30a86 100644 --- a/src/conf.c +++ b/src/conf.c @@ -1324,6 +1324,8 @@ set_default_conf(void) ServerInfo.specific_ipv6_vhost = 0; ServerInfo.max_clients = MAXCLIENTS_MAX; + ServerInfo.max_nick_length = 9; + ServerInfo.max_topic_length = 80; ServerInfo.hub = 0; ServerInfo.dns_host.sin_addr.s_addr = 0; @@ -1775,21 +1777,20 @@ read_conf_files(int cold) read_conf(conf_parser_ctx.conf_file); fclose(conf_parser_ctx.conf_file); + add_isupport("NICKLEN", NULL, ServerInfo.max_nick_length); add_isupport("NETWORK", ServerInfo.network_name, -1); - snprintf(chanmodes, sizeof(chanmodes), "beI:%d", - ConfigChannel.max_bans); + + snprintf(chanmodes, sizeof(chanmodes), "beI:%d", ConfigChannel.max_bans); add_isupport("MAXLIST", chanmodes, -1); add_isupport("MAXTARGETS", NULL, ConfigFileEntry.max_targets); - add_isupport("CHANTYPES", "#", -1); snprintf(chanlimit, sizeof(chanlimit), "#:%d", - ConfigChannel.max_chans_per_user); + ConfigChannel.max_chans_per_user); add_isupport("CHANLIMIT", chanlimit, -1); - snprintf(chanmodes, sizeof(chanmodes), "%s", - "beI,k,l,imnprstORS"); + snprintf(chanmodes, sizeof(chanmodes), "%s", "beI,k,l,imnprstORS"); add_isupport("CHANNELLEN", NULL, LOCAL_CHANNELLEN); - + add_isupport("TOPICLEN", NULL, ServerInfo.max_topic_length); add_isupport("EXCEPTS", "e", -1); add_isupport("INVEX", "I", -1); add_isupport("CHANMODES", chanmodes, -1); @@ -1966,7 +1967,20 @@ yyerror(const char *msg) return; strip_tabs(newlinebuf, linebuf, sizeof(newlinebuf)); - sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, + sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, + "\"%s\", line %u: %s: %s", + conffilebuf, lineno + 1, msg, newlinebuf); + ilog(LOG_TYPE_IRCD, "\"%s\", line %u: %s: %s", + conffilebuf, lineno + 1, msg, newlinebuf); +} + +void +conf_error_report(const char *msg) +{ + char newlinebuf[IRCD_BUFSIZE]; + + strip_tabs(newlinebuf, linebuf, sizeof(newlinebuf)); + sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, "\"%s\", line %u: %s: %s", conffilebuf, lineno + 1, msg, newlinebuf); ilog(LOG_TYPE_IRCD, "\"%s\", line %u: %s: %s", -- cgit