]> jfr.im git - solanum.git/blobdiff - ircd/bandbi.c
Replace most checks for +o with oper:general
[solanum.git] / ircd / bandbi.c
index aa9410d29f481813846fe28c4375786abf372cea..dfb4f73d50ebd99288cbb0f4283fe91f8c1f2e7e 100644 (file)
@@ -46,6 +46,9 @@
 #include "msg.h"       /* XXX: MAXPARA */
 #include "operhash.h"
 
+static void
+bandb_handle_failure(rb_helper *helper, char **parv, int parc) __attribute__((noreturn));
+
 static char bandb_add_letter[LAST_BANDB_TYPE] = {
        'K', 'D', 'X', 'R'
 };
@@ -80,21 +83,21 @@ start_bandb(void)
        const char *suffix = "";
 #endif
 
-       rb_setenv("BANDB_DBPATH", PKGLOCALSTATEDIR "/ban.db", 1);
+       rb_setenv("BANDB_DBPATH", ircd_paths[IRCD_PATH_BANDB], 1);
        if(bandb_path == NULL)
        {
-               snprintf(fullpath, sizeof(fullpath), "%s/bandb%s", PKGLIBEXECDIR, suffix);
+               snprintf(fullpath, sizeof(fullpath), "%s%cbandb%s", ircd_paths[IRCD_PATH_LIBEXEC], RB_PATH_SEPARATOR, suffix);
 
                if(access(fullpath, X_OK) == -1)
                {
-                       snprintf(fullpath, sizeof(fullpath), "%s/bin/bandb%s",
-                                   ConfigFileEntry.dpath, suffix);
+                       snprintf(fullpath, sizeof(fullpath), "%s%cbin%cbandb%s",
+                                   ConfigFileEntry.dpath, RB_PATH_SEPARATOR, RB_PATH_SEPARATOR, suffix);
 
                        if(access(fullpath, X_OK) == -1)
                        {
                                ilog(L_MAIN,
                                     "Unable to execute bandb%s in %s or %s/bin",
-                                    suffix, PKGLIBEXECDIR, ConfigFileEntry.dpath);
+                                    suffix, ircd_paths[IRCD_PATH_LIBEXEC], ConfigFileEntry.dpath);
                                return 0;
                        }
                }
@@ -223,11 +226,9 @@ bandb_check_kline(struct ConfItem *aconf)
 
        if(aftype != HM_HOST)
        {
-#ifdef RB_IPV6
                if(aftype == HM_IPV6)
                        aftype = AF_INET6;
                else
-#endif
                        aftype = AF_INET;
 
                kconf = find_conf_by_address(aconf->host, NULL, NULL, (struct sockaddr *)&daddr,
@@ -397,12 +398,12 @@ static void
 bandb_parse(rb_helper *helper)
 {
        static char buf[READBUF_SIZE];
-       char *parv[MAXPARA + 1];
+       char *parv[MAXPARA];
        int len, parc;
 
        while((len = rb_helper_read(helper, buf, sizeof(buf))))
        {
-               parc = rb_string_to_array(buf, parv, MAXPARA);
+               parc = rb_string_to_array(buf, parv, sizeof(parv));
 
                if(parc < 1)
                        continue;