static struct mode_table connect_table[] = {
{ "autoconn", SERVER_AUTOCONN },
- { "compressed", SERVER_COMPRESSED },
+ { "compressed", 0 },
{ "encrypted", SERVER_ENCRYPTED },
{ "topicburst", SERVER_TB },
{ "sctp", SERVER_SCTP },
}
}
+static void
+parse_umodes(const char *pm, int *values, int *mask)
+{
+ int what = MODE_ADD, flag;
+
+ *values = 0;
+
+ if (NULL != mask)
+ *mask = 0;
+
+ for (; *pm; pm++)
+ {
+ switch (*pm)
+ {
+ case '+':
+ what = MODE_ADD;
+ break;
+ case '-':
+ what = MODE_DEL;
+ break;
+
+ /* don't allow +o */
+ case 'o':
+ case 'S':
+ case 'Z':
+ case ' ':
+ break;
+
+ default:
+ flag = user_modes[(unsigned char) *pm];
+ if (flag)
+ {
+ /* Proper value has probably not yet been set
+ * so don't check oper_only_umodes -- jilles */
+ if (what == MODE_ADD)
+ *values |= flag;
+ else
+ *values &= ~flag;
+
+ if (NULL != mask)
+ *mask |= flag;
+ }
+ break;
+ }
+ }
+}
+
static void
conf_set_privset_extends(void *data)
{
if(EmptyString(yy_class->class_name))
{
- conf_report_error("Ignoring connect block -- missing name.");
+ conf_report_error("Ignoring class block -- missing name.");
return 0;
}
yy_aconf->className = rb_strdup(data);
}
+static void
+conf_set_auth_umodes(void *data)
+{
+ char *umodes = data;
+
+ parse_umodes(umodes, &yy_aconf->umodes, &yy_aconf->umodes_mask);
+}
+
static int
conf_begin_connect(struct TopConf *tc)
{
static int
conf_end_connect(struct TopConf *tc)
{
- if(EmptyString(yy_server->name))
+ if (EmptyString(yy_server->name))
{
conf_report_error("Ignoring connect block -- missing name.");
return 0;
}
- if(ServerInfo.name != NULL && !irccmp(ServerInfo.name, yy_server->name))
+ if (ServerInfo.name != NULL && !irccmp(ServerInfo.name, yy_server->name))
{
- conf_report_error("Ignoring connect block for %s -- name is equal to my own name.",
- yy_server->name);
+ conf_report_error("Ignoring connect block for %s -- name is "
+ "equal to my own name.", yy_server->name);
return 0;
}
- if((EmptyString(yy_server->passwd) || EmptyString(yy_server->spasswd)) && EmptyString(yy_server->certfp))
+ if ((EmptyString(yy_server->passwd) || EmptyString(yy_server->spasswd))
+ && EmptyString(yy_server->certfp))
{
- conf_report_error("Ignoring connect block for %s -- no fingerprint or password credentials provided.",
- yy_server->name);
+ conf_report_error("Ignoring connect block for %s -- no "
+ "fingerprint or password credentials "
+ "provided.", yy_server->name);
return 0;
}
- if((yy_server->flags & SERVER_SSL) && EmptyString(yy_server->certfp))
+ if ((yy_server->flags & SERVER_SSL) && EmptyString(yy_server->certfp))
{
- conf_report_error("Ignoring connect block for %s -- no fingerprint provided for SSL connection.",
- yy_server->name);
+ conf_report_error("Ignoring connect block for %s -- no "
+ "fingerprint provided for SSL "
+ "connection.", yy_server->name);
return 0;
}
- if(EmptyString(yy_server->connect_host)
- && GET_SS_FAMILY(&yy_server->connect4) != AF_INET
- && GET_SS_FAMILY(&yy_server->connect6) != AF_INET6
- )
+ if (! (yy_server->flags & SERVER_SSL) && ! EmptyString(yy_server->certfp))
{
- conf_report_error("Ignoring connect block for %s -- missing host.",
- yy_server->name);
+ conf_report_error("Ignoring connect block for %s -- "
+ "fingerprint authentication has "
+ "been requested; but the ssl flag "
+ "is not set.", yy_server->name);
return 0;
}
-#ifndef HAVE_LIBZ
- if(ServerConfCompressed(yy_server))
+ if (EmptyString(yy_server->connect_host)
+ && GET_SS_FAMILY(&yy_server->connect4) != AF_INET
+ && GET_SS_FAMILY(&yy_server->connect6) != AF_INET6)
{
- conf_report_error("Ignoring connect::flags::compressed -- zlib not available.");
- yy_server->flags &= ~SERVER_COMPRESSED;
+ conf_report_error("Ignoring connect block for %s -- missing "
+ "host.", yy_server->name);
+ return 0;
}
-#endif
add_server_conf(yy_server);
rb_dlinkAdd(yy_server, &yy_server->node, &server_conf_list);
rb_free(yy_server->spasswd);
}
- yy_server->spasswd = rb_strdup(data);
+ if (EmptyString((const char *) data))
+ {
+ yy_server->spasswd = NULL;
+ conf_report_warning("Invalid send_password for connect "
+ "block; must not be empty if provided");
+ }
+ else if (strpbrk(data, " :"))
+ {
+ yy_server->spasswd = NULL;
+ conf_report_error("Invalid send_password for connect "
+ "block; cannot contain spaces or colons");
+ }
+ else
+ yy_server->spasswd = rb_strdup(data);
}
static void
memset(yy_server->passwd, 0, strlen(yy_server->passwd));
rb_free(yy_server->passwd);
}
- yy_server->passwd = rb_strdup(data);
+
+ if (EmptyString((const char *) data))
+ {
+ yy_server->passwd = NULL;
+ conf_report_warning("Invalid accept_password for connect "
+ "block; must not be empty if provided");
+ }
+ else if (strpbrk(data, " :"))
+ {
+ yy_server->passwd = NULL;
+ conf_report_error("Invalid accept_password for connect "
+ "block; cannot contain spaces or colons");
+ }
+ else
+ yy_server->passwd = rb_strdup(data);
}
static void
{
conf_parm_t *args = data;
- /* note, we allow them to set compressed, then remove it later if
- * they do and LIBZ isnt available
- */
set_modes_from_table(&yy_server->flags, "flag", connect_table, args);
}
-static void
-conf_set_connect_hub_mask(void *data)
-{
- struct remote_conf *yy_hub;
-
- if(EmptyString(yy_server->name))
- return;
-
- yy_hub = make_remote_conf();
- yy_hub->flags = CONF_HUB;
-
- yy_hub->host = rb_strdup(data);
- yy_hub->server = rb_strdup(yy_server->name);
- rb_dlinkAdd(yy_hub, &yy_hub->node, &hubleaf_conf_list);
-}
-
-static void
-conf_set_connect_leaf_mask(void *data)
-{
- struct remote_conf *yy_leaf;
-
- if(EmptyString(yy_server->name))
- return;
-
- yy_leaf = make_remote_conf();
- yy_leaf->flags = CONF_LEAF;
-
- yy_leaf->host = rb_strdup(data);
- yy_leaf->server = rb_strdup(yy_server->name);
- rb_dlinkAdd(yy_leaf, &yy_leaf->node, &hubleaf_conf_list);
-}
-
static void
conf_set_connect_class(void *data)
{
}
static void
-conf_set_general_compression_level(void *data)
+conf_set_general_stats_l_oper_only(void *data)
{
-#ifdef HAVE_LIBZ
- ConfigFileEntry.compression_level = *(unsigned int *) data;
+ char *val = data;
- if((ConfigFileEntry.compression_level < 1) || (ConfigFileEntry.compression_level > 9))
- {
- conf_report_error
- ("Invalid general::compression_level %d -- using default.",
- ConfigFileEntry.compression_level);
- ConfigFileEntry.compression_level = 0;
- }
-#else
- conf_report_error("Ignoring general::compression_level -- zlib not available.");
-#endif
+ if(rb_strcasecmp(val, "yes") == 0)
+ ConfigFileEntry.stats_l_oper_only = STATS_L_OPER_ONLY_YES;
+ else if(rb_strcasecmp(val, "self") == 0)
+ ConfigFileEntry.stats_l_oper_only = STATS_L_OPER_ONLY_SELF;
+ else if(rb_strcasecmp(val, "no") == 0)
+ ConfigFileEntry.stats_l_oper_only = STATS_L_OPER_ONLY_NO;
+ else
+ conf_report_error("Invalid setting '%s' for general::stats_l_oper_only.", val);
}
static void
conf_set_general_default_umodes(void *data)
{
- char *pm;
- int what = MODE_ADD, flag;
-
- ConfigFileEntry.default_umodes = 0;
- for (pm = (char *) data; *pm; pm++)
- {
- switch (*pm)
- {
- case '+':
- what = MODE_ADD;
- break;
- case '-':
- what = MODE_DEL;
- break;
-
- /* don't allow +o */
- case 'o':
- case 'S':
- case 'Z':
- case ' ':
- break;
+ char *umodes = data;
- default:
- if ((flag = user_modes[(unsigned char) *pm]))
- {
- /* Proper value has probably not yet been set
- * so don't check oper_only_umodes -- jilles */
- if (what == MODE_ADD)
- ConfigFileEntry.default_umodes |= flag;
- else
- ConfigFileEntry.default_umodes &= ~flag;
- }
- break;
- }
- }
+ parse_umodes(umodes, &ConfigFileEntry.default_umodes, NULL);
}
static void
}
ierror("\"%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);
+ sendto_realops_snomask(SNO_GENERAL, L_NETWIDE, "error: \"%s\", line %d: %s", current_file, lineno + 1, msg);
}
void
}
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);
+ sendto_realops_snomask(SNO_GENERAL, L_NETWIDE, "warning: \"%s\", line %d: %s", current_file, lineno + 1, msg);
}
int
{ "redirserv", CF_QSTRING, conf_set_auth_redir_serv, 0, NULL },
{ "redirport", CF_INT, conf_set_auth_redir_port, 0, NULL },
{ "flags", CF_STRING | CF_FLIST, conf_set_auth_flags, 0, NULL },
+ { "umodes", CF_QSTRING, conf_set_auth_umodes, 0, NULL},
{ "\0", 0, NULL, 0, NULL }
};
{ "vhost", CF_QSTRING, conf_set_connect_vhost, 0, NULL },
{ "port", CF_INT, conf_set_connect_port, 0, NULL },
{ "aftype", CF_STRING, conf_set_connect_aftype, 0, NULL },
- { "hub_mask", CF_QSTRING, conf_set_connect_hub_mask, 0, NULL },
- { "leaf_mask", CF_QSTRING, conf_set_connect_leaf_mask, 0, NULL },
{ "class", CF_QSTRING, conf_set_connect_class, 0, NULL },
{ "\0", 0, NULL, 0, NULL }
};
{ "oper_only_umodes", CF_STRING | CF_FLIST, conf_set_general_oper_only_umodes, 0, NULL },
{ "oper_umodes", CF_STRING | CF_FLIST, conf_set_general_oper_umodes, 0, NULL },
{ "oper_snomask", CF_QSTRING, conf_set_general_oper_snomask, 0, NULL },
- { "compression_level", CF_INT, conf_set_general_compression_level, 0, NULL },
{ "havent_read_conf", CF_YESNO, conf_set_general_havent_read_conf, 0, NULL },
{ "hide_error_messages",CF_STRING, conf_set_general_hide_error_messages,0, NULL },
- { "stats_k_oper_only", CF_STRING, conf_set_general_stats_k_oper_only, 0, NULL },
{ "stats_i_oper_only", CF_STRING, conf_set_general_stats_i_oper_only, 0, NULL },
+ { "stats_k_oper_only", CF_STRING, conf_set_general_stats_k_oper_only, 0, NULL },
+ { "stats_l_oper_only", CF_STRING, conf_set_general_stats_l_oper_only, 0, NULL },
{ "default_umodes", CF_QSTRING, conf_set_general_default_umodes, 0, NULL },
{ "default_operstring", CF_QSTRING, NULL, REALLEN, &ConfigFileEntry.default_operstring },
{ "short_motd", CF_YESNO, NULL, 0, &ConfigFileEntry.short_motd },
{ "stats_c_oper_only", CF_YESNO, NULL, 0, &ConfigFileEntry.stats_c_oper_only },
{ "stats_e_disabled", CF_YESNO, NULL, 0, &ConfigFileEntry.stats_e_disabled },
- { "stats_h_oper_only", CF_YESNO, NULL, 0, &ConfigFileEntry.stats_h_oper_only },
{ "stats_o_oper_only", CF_YESNO, NULL, 0, &ConfigFileEntry.stats_o_oper_only },
{ "stats_P_oper_only", CF_YESNO, NULL, 0, &ConfigFileEntry.stats_P_oper_only },
{ "stats_y_oper_only", CF_YESNO, NULL, 0, &ConfigFileEntry.stats_y_oper_only },
{ "hide_opers", CF_YESNO, NULL, 0, &ConfigFileEntry.hide_opers },
{ "certfp_method", CF_STRING, conf_set_general_certfp_method, 0, NULL },
{ "drain_reason", CF_QSTRING, NULL, BUFSIZE, &ConfigFileEntry.drain_reason },
+ { "sasl_only_client_message", CF_QSTRING, NULL, BUFSIZE, &ConfigFileEntry.sasl_only_client_message },
+ { "identd_only_client_message", CF_QSTRING, NULL, BUFSIZE, &ConfigFileEntry.identd_only_client_message },
+ { "sctp_forbidden_client_message", CF_QSTRING, NULL, BUFSIZE, &ConfigFileEntry.sctp_forbidden_client_message },
+ { "ssltls_only_client_message", CF_QSTRING, NULL, BUFSIZE, &ConfigFileEntry.ssltls_only_client_message },
+ { "not_authorised_client_message", CF_QSTRING, NULL, BUFSIZE, &ConfigFileEntry.not_authorised_client_message },
+ { "illegal_hostname_client_message", CF_QSTRING, NULL, BUFSIZE, &ConfigFileEntry.not_authorised_client_message },
+ { "server_full_client_message", CF_QSTRING, NULL, BUFSIZE, &ConfigFileEntry.server_full_client_message },
+ { "illegal_name_long_client_message", CF_QSTRING, NULL, BUFSIZE, &ConfigFileEntry.illegal_name_long_client_message },
+ { "illegal_name_short_client_message", CF_QSTRING, NULL, BUFSIZE, &ConfigFileEntry.illegal_name_short_client_message },
{ "tls_ciphers_oper_only", CF_YESNO, NULL, 0, &ConfigFileEntry.tls_ciphers_oper_only },
+ { "oper_secure_only", CF_YESNO, NULL, 0, &ConfigFileEntry.oper_secure_only },
{ "\0", 0, NULL, 0, NULL }
};
{ "displayed_usercount", CF_INT, NULL, 0, &ConfigChannel.displayed_usercount },
{ "strip_topic_colors", CF_YESNO, NULL, 0, &ConfigChannel.strip_topic_colors },
{ "opmod_send_statusmsg", CF_YESNO, NULL, 0, &ConfigChannel.opmod_send_statusmsg },
+ { "ip_bans_through_vhost", CF_YESNO, NULL, 0, &ConfigChannel.ip_bans_through_vhost },
{ "\0", 0, NULL, 0, NULL }
};