]> jfr.im git - solanum.git/blobdiff - ircd/newconf.c
newconf: move SSL/TLS deprecation message from ERROR severity to WARNING severity
[solanum.git] / ircd / newconf.c
index 717cfcf44d9e83f421538af5c921230bbcedc228..d73f0432ea2ce85ab2fa413a6b86eb30d3e62f6e 100644 (file)
@@ -286,7 +286,6 @@ conf_set_serverinfo_nicklen(void *data)
 static void
 conf_set_modules_module(void *data)
 {
-#ifndef STATIC_MODULES
        char *m_bn;
 
        m_bn = rb_basename((char *) data);
@@ -295,19 +294,12 @@ conf_set_modules_module(void *data)
                load_one_module((char *) data, 0);
 
        rb_free(m_bn);
-#else
-       conf_report_error("Ignoring modules::module -- loadable module support not present.");
-#endif
 }
 
 static void
 conf_set_modules_path(void *data)
 {
-#ifndef STATIC_MODULES
        mod_add_path((char *) data);
-#else
-       conf_report_error("Ignoring modules::path -- loadable module support not present.");
-#endif
 }
 
 struct mode_table
@@ -352,6 +344,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}
 };
 
@@ -396,6 +389,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}
@@ -866,6 +862,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);
@@ -881,8 +882,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);
                 }
 
        }
@@ -2028,7 +2034,7 @@ conf_report_error(const char *fmt, ...)
        char msg[IRCD_BUFSIZE + 1] = { 0 };
 
        va_start(ap, fmt);
-       rb_vsnprintf(msg, IRCD_BUFSIZE, fmt, ap);
+       vsnprintf(msg, IRCD_BUFSIZE, fmt, ap);
        va_end(ap);
 
        if (testing_conf)
@@ -2038,7 +2044,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[IRCD_BUFSIZE + 1] = { 0 };
+
+       va_start(ap, fmt);
+       vsnprintf(msg, IRCD_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
@@ -2432,6 +2458,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 }
 };
@@ -2447,6 +2474,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 },
@@ -2459,6 +2487,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 }
 };