]> jfr.im git - irc/unrealircd/unrealircd.git/commitdiff
blacklist module: also check the ip of WEBIRC users.
authorBram Matthys <redacted>
Mon, 11 Jun 2018 06:53:34 +0000 (08:53 +0200)
committerBram Matthys <redacted>
Mon, 11 Jun 2018 06:53:34 +0000 (08:53 +0200)
Suggested by jesopo (#0005098).

include/modules.h
src/modules/blacklist.c
src/modules/webirc.c

index 5499a56e1946c49eae848e24d36256650d604771..18503c81eb96a345f07653a25f27410bb1c8907f 100644 (file)
@@ -1011,6 +1011,7 @@ _UNREAL_ERROR(_hook_error_incompatible, "Incompatible hook function. Check argum
 #define CALLBACKTYPE_CLOAK 1
 #define CALLBACKTYPE_CLOAKKEYCSUM 2
 #define CALLBACKTYPE_CLOAK_EX 3
+#define CALLBACKTYPE_BLACKLIST_CHECK 4
 
 /* Efunction types */
 #define EFUNC_DO_JOIN                                  1
index d411574db739bca4f852b22e5c359a059ca5a155..eccba3d8614bdfe9d5587403b330cacdd86a1c49 100644 (file)
@@ -107,6 +107,8 @@ long SNO_BLACKLIST = 0L;
 MOD_TEST(blacklist)
 {
        HookAdd(modinfo->handle, HOOKTYPE_CONFIGTEST, 0, blacklist_config_test);
+
+       CallbackAddEx(modinfo->handle, CALLBACKTYPE_BLACKLIST_CHECK, blacklist_start_check);
        return MOD_SUCCESS;
 }
 
index 95a40f63ac88aded78400475775f7c6d083eded3..d1637bc0df70d0035c22d71c004f86a68211ae4a 100644 (file)
@@ -386,6 +386,10 @@ int dowebirc(aClient *cptr, char *ip, char *host, char *options)
                }
        }
 
+       /* blacklist_start_check() */
+       if (RCallbacks[CALLBACKTYPE_BLACKLIST_CHECK] != NULL)
+               RCallbacks[CALLBACKTYPE_BLACKLIST_CHECK]->func.intfunc(cptr);
+
        /* Check (g)zlines right now; these are normally checked upon accept(),
         * but since we know the IP only now after PASS/WEBIRC, we have to check
         * here again...