]> jfr.im git - irc/rqf/shadowircd.git/commitdiff
Load in new bans from bandb on startup.
authorWilliam Pitcock <redacted>
Fri, 8 Jan 2010 00:06:15 +0000 (18:06 -0600)
committerWilliam Pitcock <redacted>
Fri, 8 Jan 2010 00:06:15 +0000 (18:06 -0600)
src/ircd.c
src/s_conf.c

index 5f4cfc6ca31ba24cdb92060358d65f3c74e7f12e..962c7edc23ec9b908b2a58a0da532b62d463af1e 100644 (file)
@@ -671,7 +671,6 @@ main(int argc, char *argv[])
        if (testing_conf)
                fprintf(stderr, "\nBeginning config test\n");
        read_conf_files(YES);   /* cold start init conf files */
-       rehash_bans(0);
 #ifndef STATIC_MODULES
 
        mod_add_path(MODULE_DIR); 
@@ -681,6 +680,8 @@ main(int argc, char *argv[])
        init_bandb();
        init_ssld();
 
+       rehash_bans(0);
+
        initialize_server_capabs();     /* Set up default_server_capabs */
        initialize_global_set_options();
 
index 47d8034651d9f3a38c4a3bffcd63ae6362cf4f4e..9190518bc85695a8d5541bd500ae63145ff41bcc 100644 (file)
@@ -49,6 +49,7 @@
 #include "blacklist.h"
 #include "privilege.h"
 #include "sslproc.h"
+#include "bandbi.h"
 
 struct config_server_hide ConfigServerHide;
 
@@ -654,43 +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);
-               }
-               else
-               {
-                       (banconfs[i].func)(file);
-                       fclose(file);
-               }
-       }
-
-       check_banned_lines();
+       bandb_rehash_bans();
 }
 
 /*