]> jfr.im git - irc/quakenet/newserv.git/blobdiff - trusts/trusts_management.c
CHANSERV: tell user when they can't attempts to auth any more, and drop max attempts...
[irc/quakenet/newserv.git] / trusts / trusts_management.c
index 387f6f80b4d52ea5ed2ca9f65c49e852a6345a6a..8d8311b3719fdb220c3657934e37cee60296c11c 100644 (file)
@@ -69,14 +69,14 @@ static int trusts_cmdtrustadd(void *source, int cargc, char **cargv) {
   /* OKAY! Lots of checking here!
    *
    * Need to check:
-   *   - host isn't already covered by given group (reject if it is)
+   *   - exact same host isn't already covered by given group (reject if it is)
    *   - host doesn't already exist exactly already (reject if it does)
    *   - host is more specific than an existing one (warn if it is, fix up later)
    *   - host is less specific than an existing one (warn if it is, don't need to do anything special)
    */
 
   for(th=tg->hosts;th;th=th->next) {
-    if(ipmask_check(&ip, &th->ip, th->bits)) {
+    if(ipmask_check(&ip, &th->ip, th->bits) && th->bits == bits) {
       controlreply(sender, "This host (or part of it) is already covered in the given group.");
       return CMD_ERROR;
     }
@@ -401,6 +401,20 @@ static int modifyreliableusername(void *arg, char *num, nick *source, int overri
   return 1;
 }
 
+static int modifyunthrottle(void *arg, char *num, nick *source, int override) {
+  trustgroup *tg = arg;
+
+  if(num[0] == '1') {
+    tg->flags |= TRUST_UNTHROTTLE;
+  } else if(num[0] == '0') {
+    tg->flags &= ~TRUST_UNTHROTTLE;
+  } else {
+    return 0;
+  }
+
+  return 1;
+}
+
 static int modifyexpires(void *arg, char *expires, nick *source, int override) {
   trustgroup *tg = arg;
   int howlong = durationtolong(expires);
@@ -803,6 +817,7 @@ static void setupmods(void) {
   MSGROUP(trustedfor);
   MSGROUP(cleanup);
   MSGROUP(protected);
+  MSGROUP(unthrottle);
 
   MSHOST(maxpernode);
   MSHOST(nodebits);