ServerInfo.description = NULL;
ServerInfo.network_name = rb_strdup(NETWORK_NAME_DEFAULT);
ServerInfo.network_desc = rb_strdup(NETWORK_DESC_DEFAULT);
+ ServerInfo.helpchan = rb_strdup("");
+ ServerInfo.helpurl = rb_strdup("");
memset(&ServerInfo.ip, 0, sizeof(ServerInfo.ip));
ServerInfo.specific_ipv4_vhost = 0;
ConfigFileEntry.min_nonwildcard = 4;
ConfigFileEntry.min_nonwildcard_simple = 3;
ConfigFileEntry.default_floodcount = 8;
+ ConfigFileEntry.default_ident_timeout = 5;
ConfigFileEntry.client_flood = CLIENT_FLOOD_DEFAULT;
ConfigFileEntry.tkline_expire_notices = 0;
splitchecking = 0;
}
- if(!valid_hostname(ConfigFileEntry.default_operhost))
+ if(!valid_hostname(ConfigFileEntry.default_operhost) && !EmptyString(ConfigFileEntry.default_operhost))
{
conf_report_error("Warning -- invalid default_operhost specified, ignoring.");
ConfigFileEntry.default_operhost = rb_strdup("");
}
}
+/* Given a new ban ConfItem, look for any matching ban, update the lifetime
+ * from it and delete it.
+ */
+void
+replace_old_ban(struct ConfItem *aconf)
+{
+ rb_dlink_node *ptr;
+ struct ConfItem *oldconf;
+
+ ptr = find_prop_ban(aconf->status, aconf->user, aconf->host);
+ if(ptr != NULL)
+ {
+ oldconf = ptr->data;
+ /* Remember at least as long as the old one. */
+ if(oldconf->lifetime > aconf->lifetime)
+ aconf->lifetime = oldconf->lifetime;
+ /* Force creation time to increase. */
+ if(oldconf->created >= aconf->created)
+ aconf->created = oldconf->created + 1;
+ /* Leave at least one second of validity. */
+ if(aconf->hold <= aconf->created)
+ aconf->hold = aconf->created + 1;
+ if(aconf->lifetime < aconf->hold)
+ aconf->lifetime = aconf->hold;
+ /* Tell deactivate_conf() to destroy it. */
+ oldconf->lifetime = rb_current_time();
+ deactivate_conf(oldconf, ptr);
+ }
+}
+
static void
expire_prop_bans(void *list)
{
rb_snprintf(reasonbuf, sizeof reasonbuf,
"Temporary %c-line %d min. - ",
aconf->status == CONF_DLINE ? 'D' : 'K',
- (aconf->hold - aconf->created) / 60);
+ (int)((aconf->hold - aconf->created) / 60));
else
reasonbuf[0] = '\0';
if (aconf->passwd)
ServerInfo.network_name = NULL;
rb_free(ServerInfo.network_desc);
ServerInfo.network_desc = NULL;
+ rb_free(ServerInfo.helpchan);
+ ServerInfo.helpchan = NULL;
+ rb_free(ServerInfo.helpurl);
+ ServerInfo.helpurl = NULL;
ServerInfo.ssld_count = 1;