]> jfr.im git - solanum.git/blobdiff - ircd/newconf.c
authd/providers/blacklist: add configuration interface for deletion
[solanum.git] / ircd / newconf.c
index 23701c82ae9532767b5f1475acce83b86a0ee9bf..7a726db3acdd708ee8be5b653662500cff678ecb 100644 (file)
@@ -1,5 +1,4 @@
 /* This code is in the public domain.
- * $Id: newconf.c 3550 2007-08-09 06:47:26Z nenolod $
  */
 
 #include "stdinc.h"
@@ -11,7 +10,6 @@
 
 #include "newconf.h"
 #include "ircd_defs.h"
-#include "common.h"
 #include "logger.h"
 #include "s_conf.h"
 #include "s_user.h"
@@ -240,7 +238,7 @@ conf_set_serverinfo_vhost(void *data)
 {
        if(rb_inet_pton(AF_INET, (char *) data, &ServerInfo.ip.sin_addr) <= 0)
        {
-               conf_report_error("Invalid netmask for server IPv4 vhost (%s)", (char *) data);
+               conf_report_error("Invalid IPv4 address for server vhost (%s)", (char *) data);
                return;
        }
        ServerInfo.ip.sin_family = AF_INET;
@@ -253,7 +251,7 @@ conf_set_serverinfo_vhost6(void *data)
 #ifdef RB_IPV6
        if(rb_inet_pton(AF_INET6, (char *) data, &ServerInfo.ip6.sin6_addr) <= 0)
        {
-               conf_report_error("Invalid netmask for server IPv6 vhost (%s)", (char *) data);
+               conf_report_error("Invalid IPv6 address for server vhost (%s)", (char *) data);
                return;
        }
 
@@ -291,7 +289,7 @@ conf_set_modules_module(void *data)
        m_bn = rb_basename((char *) data);
 
        if(findmodule_byname(m_bn) == -1)
-               load_one_module((char *) data, 0);
+               load_one_module((char *) data, MAPI_ORIGIN_EXTENSION, 0);
 
        rb_free(m_bn);
 }
@@ -344,6 +342,7 @@ static struct mode_table auth_table[] = {
        {"have_ident",          CONF_FLAGS_NEED_IDENTD  },
        {"need_ssl",            CONF_FLAGS_NEED_SSL     },
        {"need_sasl",           CONF_FLAGS_NEED_SASL    },
+       {"extend_chans",        CONF_FLAGS_EXTEND_CHANS },
        {NULL, 0}
 };
 
@@ -388,6 +387,9 @@ static struct mode_table shared_table[] =
        { "unresv",     SHARED_UNRESV   },
        { "locops",     SHARED_LOCOPS   },
        { "rehash",     SHARED_REHASH   },
+       { "grant",      SHARED_GRANT    },
+       { "die",        SHARED_DIE      },
+       { "module",     SHARED_MODULE   },
        { "all",        SHARED_ALL      },
        { "none",       0               },
        {NULL, 0}
@@ -858,6 +860,11 @@ conf_set_listen_port_both(void *data, int ssl)
                }
                 if(listener_address == NULL)
                 {
+                       if (!ssl)
+                       {
+                               conf_report_warning("listener 'ANY/%d': support for plaintext listeners may be removed in a future release per RFC 7194.  "
+                                                    "It is suggested that users be migrated to SSL/TLS connections.", args->v.number);
+                       }
                        add_listener(args->v.number, listener_address, AF_INET, ssl, ssl || yy_defer_accept);
 #ifdef RB_IPV6
                        add_listener(args->v.number, listener_address, AF_INET6, ssl, ssl || yy_defer_accept);
@@ -873,8 +880,13 @@ conf_set_listen_port_both(void *data, int ssl)
 #endif
                                family = AF_INET;
 
-                       add_listener(args->v.number, listener_address, family, ssl, ssl || yy_defer_accept);
+                       if (!ssl)
+                       {
+                               conf_report_warning("listener '%s/%d': support for plaintext listeners may be removed in a future release per RFC 7194.  "
+                                                    "It is suggested that users be migrated to SSL/TLS connections.", listener_address, args->v.number);
+                       }
 
+                       add_listener(args->v.number, listener_address, family, ssl, ssl || yy_defer_accept);
                 }
 
        }
@@ -1312,7 +1324,7 @@ conf_set_connect_vhost(void *data)
 {
        if(rb_inet_pton_sock(data, (struct sockaddr *)&yy_server->my_ipnum) <= 0)
        {
-               conf_report_error("Invalid netmask for server vhost (%s)",
+               conf_report_error("Invalid IP address for server connect vhost (%s)",
                                  (char *) data);
                return;
        }
@@ -1540,7 +1552,7 @@ conf_set_general_kline_delay(void *data)
        ConfigFileEntry.kline_delay = *(unsigned int *) data;
 
        /* THIS MUST BE HERE to stop us being unable to check klines */
-       kline_queued = 0;
+       kline_queued = false;
 }
 
 static void
@@ -1767,7 +1779,7 @@ conf_end_alias(struct TopConf *tc)
                return -1;
        }
 
-       irc_dictionary_add(alias_dict, yy_alias->name, yy_alias);
+       rb_dictionary_add(alias_dict, yy_alias->name, yy_alias);
 
        return 0;
 }
@@ -2017,10 +2029,10 @@ void
 conf_report_error(const char *fmt, ...)
 {
        va_list ap;
-       char msg[IRCD_BUFSIZE + 1] = { 0 };
+       char msg[BUFSIZE + 1] = { 0 };
 
        va_start(ap, fmt);
-       rb_vsnprintf(msg, IRCD_BUFSIZE, fmt, ap);
+       vsnprintf(msg, BUFSIZE, fmt, ap);
        va_end(ap);
 
        if (testing_conf)
@@ -2030,7 +2042,27 @@ conf_report_error(const char *fmt, ...)
        }
 
        ierror("\"%s\", line %d: %s", current_file, lineno + 1, msg);
-       sendto_realops_snomask(SNO_GENERAL, L_ALL, "\"%s\", line %d: %s", current_file, lineno + 1, msg);
+       sendto_realops_snomask(SNO_GENERAL, L_ALL, "error: \"%s\", line %d: %s", current_file, lineno + 1, msg);
+}
+
+void
+conf_report_warning(const char *fmt, ...)
+{
+       va_list ap;
+       char msg[BUFSIZE + 1] = { 0 };
+
+       va_start(ap, fmt);
+       vsnprintf(msg, BUFSIZE, fmt, ap);
+       va_end(ap);
+
+       if (testing_conf)
+       {
+               fprintf(stderr, "\"%s\", line %d: %s\n", current_file, lineno + 1, msg);
+               return;
+       }
+
+       iwarn("\"%s\", line %d: %s", current_file, lineno + 1, msg);
+       sendto_realops_snomask(SNO_GENERAL, L_ALL, "warning: \"%s\", line %d: %s", current_file, lineno + 1, msg);
 }
 
 int
@@ -2232,7 +2264,6 @@ remove_conf_item(const char *topconf, const char *name)
 static struct ConfEntry conf_serverinfo_table[] =
 {
        { "description",        CF_QSTRING, NULL, 0, &ServerInfo.description    },
-       { "hub",                CF_YESNO,   NULL, 0, &ServerInfo.hub            },
 
        { "network_name",       CF_QSTRING, conf_set_serverinfo_network_name,   0, NULL },
        { "name",               CF_QSTRING, conf_set_serverinfo_name,   0, NULL },
@@ -2424,6 +2455,7 @@ static struct ConfEntry conf_general_table[] =
        { "client_flood_message_time",  CF_INT,   NULL, 0, &ConfigFileEntry.client_flood_message_time   },
        { "max_ratelimit_tokens",       CF_INT,   NULL, 0, &ConfigFileEntry.max_ratelimit_tokens        },
        { "away_interval",              CF_INT,   NULL, 0, &ConfigFileEntry.away_interval               },
+       { "hide_opers_in_whois",        CF_YESNO, NULL, 0, &ConfigFileEntry.hide_opers_in_whois         },
        { "certfp_method",      CF_STRING, conf_set_general_certfp_method, 0, NULL },
        { "\0",                 0,        NULL, 0, NULL }
 };
@@ -2439,6 +2471,7 @@ static struct ConfEntry conf_channel_table[] =
        { "max_bans",           CF_INT,   NULL, 0, &ConfigChannel.max_bans              },
        { "max_bans_large",     CF_INT,   NULL, 0, &ConfigChannel.max_bans_large        },
        { "max_chans_per_user", CF_INT,   NULL, 0, &ConfigChannel.max_chans_per_user    },
+       { "max_chans_per_user_large", CF_INT,   NULL, 0, &ConfigChannel.max_chans_per_user_large        },
        { "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 },
@@ -2451,6 +2484,7 @@ static struct ConfEntry conf_channel_table[] =
        { "disable_local_channels", CF_YESNO, NULL, 0, &ConfigChannel.disable_local_channels },
        { "autochanmodes",      CF_QSTRING, conf_set_channel_autochanmodes, 0, NULL     },
        { "displayed_usercount",        CF_INT, NULL, 0, &ConfigChannel.displayed_usercount     },
+       { "strip_topic_colors", CF_YESNO, NULL, 0, &ConfigChannel.strip_topic_colors    },
        { "\0",                 0,        NULL, 0, NULL }
 };