Ctrlproxy 3.0.7 UNRELEASED
+ FEATURES
+
+ * Add 'create-implicit' option.
+
BUG FIXES
* Handle client-specific admin commands being run without a client
# Override motd-file location
#motd-file = /tmp/my-motd
+# Whether or not to automatically connect to a network if a client requests
+# a connection. If disabled, it is only possible to connect to networks
+# listed in the configuration
+# create-implicit = true
+
# Save state to configuration file on exit
autosave = true
}
client->network = network_ref(find_network_by_hostname(my_global,
- l->args[1], l->args[2]?atoi(l->args[2]):6667, TRUE));
+ l->args[1], l->args[2]?atoi(l->args[2]):6667, my_global->config->create_implicit));
if (client->network == NULL) {
client_log(LOG_ERROR, client,
case G_IO_STATUS_ERROR:
transport->callbacks->log(transport, l, error);
break;
+ case G_IO_STATUS_EOF:
+ g_assert_not_reached();
}
free_line(l);
}
case G_IO_STATUS_ERROR:
transport->callbacks->log(transport, l, error);
return FALSE;
+ case G_IO_STATUS_EOF:
+ g_assert_not_reached();
}
return TRUE;
static gboolean marshall_time(struct irc_network_state *nst, const char *name, int level, enum marshall_mode m, GIOChannel *t, time_t *n)
{
if (m == MARSHALL_PUSH) {
- char tmp[20];
+ char tmp[30];
GError *error = NULL;
GIOStatus status;
g_snprintf(tmp, sizeof(tmp), "%lu", *n);
listener_log(LOG_INFO, cl->listener, "Request to connect to %s:%d", hostname, port);
- result = find_network_by_hostname(cl->listener->global, hostname, port, TRUE);
+ result = find_network_by_hostname(cl->listener->global, hostname, port,
+ cl->listener->global->config->create_implicit);
if (result == NULL) {
listener_log(LOG_WARNING, cl->listener, "Unable to return network matching %s:%d", hostname, port);
if (networkname != NULL) {
n = find_network_by_hostname(pc->listener->global,
- networkname, 6667, TRUE);
+ networkname, 6667, pc->listener->global->config->create_implicit);
if (n == NULL) {
irc_sendf(pc->connection, pc->listener->iconv, NULL, ":%s %d %s :Password error: unable to find network",
get_my_hostname(), ERR_PASSWDMISMATCH, "*");
"auto-away-nick",
"auto-away-client-limit",
"auto-away-time",
+ "create-implicit",
"max_who_age",
"replication",
"linestack",
!cfg->learn_network_name)
g_key_file_set_boolean(cfg->keyfile, "global", "learn-network-name", cfg->learn_network_name);
+ if (g_key_file_has_key(cfg->keyfile, "global", "create-implicit", NULL) || !cfg->create_implicit)
+ g_key_file_set_boolean(cfg->keyfile, "global", "create-implicit", cfg->create_implicit);
+
if (cfg->client_charset != NULL)
g_key_file_set_string(cfg->keyfile, "global", "default-client-charset", cfg->client_charset);
else
cfg->learn_network_name = TRUE;
+ if (g_key_file_has_key(kf, "global", "create-implicit", NULL))
+ cfg->create_implicit = g_key_file_get_boolean(kf, "global", "create-implicit", NULL);
+ else
+ cfg->create_implicit = TRUE;
+
if (!g_file_test(cfg->motd_file, G_FILE_TEST_EXISTS))
log_global(LOG_ERROR, "Can't open MOTD file '%s' for reading", cfg->motd_file);
char *network_socket;
char *admin_socket;
+ /** Whether to create networks that don't exist yet. */
+ gboolean create_implicit;
+
/** Name of replication backend, or NULL for default. */
char *replication;