]> jfr.im git - solanum.git/blobdiff - src/s_conf.c
Do not try to free the alias dict if it does not exist.
[solanum.git] / src / s_conf.c
index 718993fccf38516777843f6b3c79e0078b6716c7..b5004bcba1dc56052ffe78e49d59fb22dedc2003 100644 (file)
@@ -49,6 +49,7 @@
 #include "blacklist.h"
 #include "privilege.h"
 #include "sslproc.h"
+#include "bandbi.h"
 
 struct config_server_hide ConfigServerHide;
 
@@ -76,7 +77,6 @@ static void reorganise_temp_kd(void *list);
 
 FILE *conf_fbfile_in;
 extern char yytext[];
-struct Client *remote_rehash_oper_p;
 
 static int verify_access(struct Client *client_p, const char *username);
 static int attach_iline(struct Client *, struct ConfItem *);
@@ -655,47 +655,7 @@ static struct banconf_entry
 void
 rehash_bans(int sig)
 {
-       FILE *file;
-       char buf[MAXPATHLEN];
-       int i;
-
-       if(sig != 0)
-               sendto_realops_snomask(SNO_GENERAL, L_ALL,
-                               "Got signal SIGUSR2, reloading ban confs");
-
-       clear_out_address_conf_bans();
-       clear_s_newconf_bans();
-
-       for(i = 0; banconfs[i].filename; i++)
-       {
-               if(banconfs[i].perm)
-                       snprintf(buf, sizeof(buf), "%s.perm", *banconfs[i].filename);
-               else
-                       snprintf(buf, sizeof(buf), "%s", *banconfs[i].filename);
-
-               if((file = fopen(buf, "r")) == NULL)
-               {
-                       if(banconfs[i].perm)
-                               continue;
-
-                       ilog(L_MAIN, "Failed reading ban file %s",
-                               *banconfs[i].filename);
-                       sendto_realops_snomask(SNO_GENERAL, L_ALL,
-                                       "Can't open %s file bans could be missing!",
-                                       *banconfs[i].filename);
-                       if (remote_rehash_oper_p)
-                               sendto_one_notice(remote_rehash_oper_p,
-                                       ":*** Notice -- Can't open %s file bans could be missing!",
-                                       *banconfs[i].filename);
-               }
-               else
-               {
-                       (banconfs[i].func)(file);
-                       fclose(file);
-               }
-       }
-
-       check_banned_lines();
+       bandb_rehash_bans();
 }
 
 /*
@@ -819,6 +779,7 @@ set_default_conf(void)
        ConfigChannel.default_split_server_count = 10;
        ConfigChannel.no_join_on_split = NO;
        ConfigChannel.no_create_on_split = YES;
+       ConfigChannel.resv_forcepart = YES;
 
        ConfigServerHide.flatten_links = 0;
        ConfigServerHide.links_delay = 300;
@@ -838,6 +799,9 @@ set_default_conf(void)
        ConfigFileEntry.throttle_duration = 60;
 
        ServerInfo.default_max_clients = MAXCONNECTIONS;
+
+       if (!alias_dict)
+               alias_dict = irc_dictionary_create(strcasecmp);
 }
 
 #undef YES
@@ -1160,9 +1124,6 @@ read_conf_files(int cold)
                {
                        sendto_realops_snomask(SNO_GENERAL, L_ALL,
                                             "Can't open file '%s' - aborting rehash!", filename);
-                       if (remote_rehash_oper_p)
-                               sendto_one_notice(remote_rehash_oper_p,
-                                            ":*** Notice -- Can't open file '%s' - aborting rehash!", filename);
                        return;
                }
        }
@@ -1260,8 +1221,11 @@ clear_out_old_conf(void)
        }
 
        /* remove any aliases... -- nenolod */
-       irc_dictionary_destroy(alias_dict, free_alias_cb, NULL);
-       alias_dict = NULL;
+       if (alias_dict != NULL)
+       {
+               irc_dictionary_destroy(alias_dict, free_alias_cb, NULL);
+               alias_dict = NULL;
+       }
 
        destroy_blacklists();
 
@@ -1531,13 +1495,10 @@ yyerror(const char *msg)
 
        strip_tabs(newlinebuf, linebuf, strlen(linebuf));
 
+       ierror("\"%s\", line %d: %s at '%s'", conffilebuf, lineno + 1, msg, newlinebuf);
        sendto_realops_snomask(SNO_GENERAL, L_ALL, "\"%s\", line %d: %s at '%s'",
                             conffilebuf, lineno + 1, msg, newlinebuf);
-       if (remote_rehash_oper_p)
-               sendto_one_notice(remote_rehash_oper_p, ":*** Notice -- \"%s\", line %d: %s at '%s'",
-                                    conffilebuf, lineno + 1, msg, newlinebuf);
 
-       ilog(L_MAIN, "\"%s\", line %d: %s at '%s'", conffilebuf, lineno + 1, msg, newlinebuf);
 }
 
 int