Author: Kev <klmitch@mit.edu>
[ircu2.10.12-pk.git] / ircd / gline.c
index 5ee69e1209187d90b7580d82e46c8c04b9980919..f294d99f456f07694a4c5fd5e22324339c299ebd 100644 (file)
@@ -142,6 +142,8 @@ make_gline(char *user, char *host, char *reason, time_t expire, time_t lastmod,
 {
   struct Gline *gline;
 
+  assert(0 != expire);
+
   gline = (struct Gline *)MyMalloc(sizeof(struct Gline)); /* alloc memory */
   assert(0 != gline);
 
@@ -453,10 +455,12 @@ gline_add(struct Client *cptr, struct Client *sptr, char *userhost,
     }
     user = userhost;
     host = NULL;
-    tmp = count_realnames(userhost + 2);
-    if ((tmp >= feature_int(FEAT_GLINEMAXUSERCOUNT))
-        && !(flags & GLINE_OPERFORCE))
-      return send_reply(sptr, ERR_TOOMANYUSERS, tmp);
+    if (MyUser(sptr) || (IsUser(sptr) && flags & GLINE_LOCAL)) {
+      tmp = count_realnames(userhost + 2);
+      if ((tmp >= feature_int(FEAT_GLINEMAXUSERCOUNT))
+         && !(flags & GLINE_OPERFORCE))
+       return send_reply(sptr, ERR_TOOMANYUSERS, tmp);
+    }
   } else {
     canon_userhost(userhost, &user, &host, "*");
     if (sizeof(uhmask) <