]> jfr.im git - irc/quakenet/newserv.git/commitdiff
Disable glinesetmask/glineunsetmask.
authorGunnar Beutner <redacted>
Sat, 22 Jun 2013 07:00:04 +0000 (09:00 +0200)
committerGunnar Beutner <redacted>
Sat, 22 Jun 2013 07:00:04 +0000 (09:00 +0200)
--HG--
branch : shroudtrusts

glines/glines.c
regexgline/regexgline.c
trusts/trusts.h
trusts/trusts_policy.c

index 48690b9b480221a5cbc6a9321af5195e0f043e65..ecd8b78c59f61ab672f0b91d0c4e6a6211c331a7 100644 (file)
@@ -19,18 +19,29 @@ static int countmatchingusers(const char *identmask, struct irc_in_addr *ip, uns
 }
 
 void glinesetmask(const char *mask, int duration, const char *reason) {
+  controlwall(NO_OPER, NL_GLINES, "Would set gline on '%s' lasting %s with reason '%s'. CURRENTLY DISABLED FOR TESTING PURPOSES.", mask, longtoduration(duration, 0), reason);
+
+#if 0
   irc_send("%s GL * +%s %d %jd :%s", mynumeric->content, mask, duration, (intmax_t)getnettime(), reason);
+#endif
 }
 
 void glineremovemask(const char *mask, int duration, const char *reason) {
+  controlwall(NO_OPER, NL_GLINES, "Would remove gline on '%s'. CURRENTLY DISABLED FOR TESTING PURPOSES.", mask);
+
+#if 0
   irc_send("%s GL * -%s %d %jd :%s", mynumeric->content, mask, duration, (intmax_t)getnettime(), reason);
+#endif
 }
 
 static void glinesetmask_cb(const char *mask, int hits, void *arg) {
-  controlwall(NO_OPER, NL_GLINES, "Would set gline on '%s' (hits: %d). CURRENTLY DISABLED FOR TESTING PURPOSES.", mask, hits);
+  gline_params *gp = arg;
+
+  controlwall(NO_OPER, NL_GLINES, "Would set gline on '%s' lasting %s with reason '%s' (hits: %d). CURRENTLY DISABLED FOR TESTING PURPOSES.", mask, longtoduration(gp->duration, 0), gp->reason, hits);
 
-/*  gline_params *gp = arg;
-  glinesetmask(mask, gp->duration, gp->reason);*/
+#if 0
+  glinesetmask(mask, gp->duration, gp->reason);
+#endif
 }
 
 int glinesuggestbyip(const char *user, struct irc_in_addr *ip, unsigned char bits, int flags, gline_callback callback, void *uarg) {
index 1ab1763e147e73c924db6e1375e17a36b3ae3c1e..26086fe1ee18e910222a2ae412ade9f353232ec6 100644 (file)
@@ -1131,8 +1131,12 @@ int __rg_dogline(struct rg_glinelist *gll, nick *np, struct rg_struct *rp, char
     glineflags = GLINE_ALWAYS_USER;
   }
 
-  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);
+  if(!strcmp(rp->class, RESERVED_NICK_CLASS)) {
+    char mask[512], reason[512];
+    snprintf(mask, sizeof(mask), "%s!*@*", np->nick);
+    snprintf(reason, sizeof(reason), "AUTO %s (ID: %08lx)", rp->reason->content, rp->glineid);
+    glinesetmask(mask, RESERVED_NICK_GLINE_DURATION, reason);
+  }
 
   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)) {
index 3f3f14cc5914d97b6dfb755d996ceb3618b959cc..fbfad72c98db984f12790d0ad69613960daa0f2a 100644 (file)
@@ -29,7 +29,7 @@
 
 #define CLEANUP_TH_INACTIVE 60
 
-#define POLICY_GLINE_DURATION 18
+#define POLICY_GLINE_DURATION 1800
 
 #define TRUST_ENFORCE_IDENT 1 /* This must be 1 for compatibility with O. */
 #define TRUST_NO_CLEANUP 2
index 1d6dca3d627182dac0d43427bdcb12bf6a3e117b..bee025d62d44fb00ce6d779b65f3112675cbe39f 100644 (file)
@@ -62,7 +62,7 @@ static void policycheck(int hooknum, void *arg) {
     }
 */
     if((tg->flags & TRUST_ENFORCE_IDENT) && (np->ident[0] == '~')) {
-      controlwall(NO_OPER, NL_TRUSTS, "Ident required: '%s' %s!%s@%s - %senforced.", tg->name->content, np->nick, np->ident, np->host->name->content, enforcepolicy?"":"not ");
+      controlwall(NO_OPER, NL_TRUSTS, "Ident required: '%s' %s!%s@%s - %senforced.", tg->name->content, np->nick, np->ident, np->host->name->content, enforcepolicy?"":"not ");
 
       if (enforcepolicy)
         glinebynick(np, POLICY_GLINE_DURATION, "IDENTD required from your host.", GLINE_ALWAYS_USER|GLINE_IGNORE_TRUST);