]> jfr.im git - irc/quakenet/newserv.git/commitdiff
REGEXGLINE: set a nick gline when a reserved nick regexgline is hit.
authorChris Porter <redacted>
Tue, 22 Jun 2010 23:31:33 +0000 (00:31 +0100)
committerChris Porter <redacted>
Tue, 22 Jun 2010 23:31:33 +0000 (00:31 +0100)
regexgline/regexgline.c

index 5398612a586ebaf1976a9ffaaee7ded6ad010fb7..6f66479dc2865df651151879cc079b73e54eba55 100644 (file)
@@ -24,7 +24,9 @@
 #define DELAYED_HOST_GLINE   5
 #define DELAYED_KILL         6
 
-MODULE_VERSION("1.43");
+#define RESERVED_NICK_GLINE_DURATION 3600 /* 1h */
+
+MODULE_VERSION("1.44");
 
 typedef struct rg_glinenode {
   nick *np;
@@ -65,8 +67,9 @@ static int attached = 0, started = 0;
 
 static unsigned int getrgmarker(void);
 
+#define RESERVED_NICK_CLASS "reservednick"
 /* shadowserver only reports classes[0] */
-static const char *classes[] = { "drone", "proxy", "spam", "fakeauth", "other", (char *)0 };
+static const char *classes[] = { "drone", "proxy", "spam", "other", RESERVED_NICK_CLASS, (char *)0 };
 
 void _init(void) {
   sstring *max_casualties, *max_spew, *expiry_time, *max_per_gline;
@@ -367,7 +370,8 @@ static void dbloadfini(DBConn *dbconn, void *arg) {
                          "3 - Instant KILL (ik)\n"
                          "4 - Delayed USER@IP GLINE (dgu)\n"
                          "5 - Delayed *@IP GLINE (dgh)\n"
-                         "6 - Delayed KILL (dk)",
+                         "6 - Delayed KILL (dk)\n"
+                         "Note that some classes may have additional side effects (e.g. 'reservednick' also sets nick style glines).",
                          allclasses);
 
   registercontrolhelpcmd("regexgline", NO_OPER, 5, &rg_gline, helpbuf);
@@ -1059,6 +1063,9 @@ int __rg_dogline(struct rg_glinelist *gll, nick *np, struct rg_struct *rp, char
     snprintf(hostname, sizeof(hostname), "%s@%s", np->ident, IPtostr(np->p_ipaddr));
   }
 
+  if(!strcmp(rp->class, RESERVED_NICK_CLASS))
+    irc_send("%s GL * +%s!*@* %d %jd :AUTO: %s (ID: %08lx)\r\n", mynumeric->content, np->nick, RESERVED_NICK_GLINE_DURATION, (intmax_t)time(NULL), rp->reason->content, rp->glineid);
+
   validdelay = (rp->type == INSTANT_KILL) || (rp->type == DELAYED_IDENT_GLINE) || (rp->type == DELAYED_HOST_GLINE) || (rp->type == DELAYED_KILL);
   if (validdelay || (usercount > rg_max_per_gline)) {
     struct rg_glinenode *nn = (struct rg_glinenode *)malloc(sizeof(struct rg_glinenode));