ircd_snprintf(0, namebuf, sizeof(namebuf), "%s@%s",
cli_user(acptr)->username, cli_user(acptr)->host);
ircd_snprintf(0, ipbuf, sizeof(ipbuf), "%s@%s", cli_user(acptr)->username,
ircd_ntoa(&cli_ip(acptr)));
ircd_snprintf(0, namebuf, sizeof(namebuf), "%s@%s",
cli_user(acptr)->username, cli_user(acptr)->host);
ircd_snprintf(0, ipbuf, sizeof(ipbuf), "%s@%s", cli_user(acptr)->username,
ircd_ntoa(&cli_ip(acptr)));
- if (!match(mask, namebuf) || !match(mask, ipbuf))
+ if (!match(mask, namebuf)
+ || !match(mask, ipbuf)
+ || (ipmask_valid && ipmask_check(&cli_ip(acptr), &ipmask, ipmask_len)))
Debug((DEBUG_DEBUG, "gline_add(\"%s\", \"%s\", \"%s\", \"%s\", %Tu, %Tu "
"%Tu, 0x%04x)", cli_name(cptr), cli_name(sptr), userhost, reason,
Debug((DEBUG_DEBUG, "gline_add(\"%s\", \"%s\", \"%s\", \"%s\", %Tu, %Tu "
"%Tu, 0x%04x)", cli_name(cptr), cli_name(sptr), userhost, reason,
- 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) <
} else {
canon_userhost(userhost, &user, &host, "*");
if (sizeof(uhmask) <
feature_int(FEAT_GLINEMAXUSERCOUNT) && !(flags & GLINE_OPERFORCE))
return send_reply(sptr, ERR_TOOMANYUSERS, tmp);
}
feature_int(FEAT_GLINEMAXUSERCOUNT) && !(flags & GLINE_OPERFORCE))
return send_reply(sptr, ERR_TOOMANYUSERS, tmp);
}
if (!IsServer(sptr) && MyConnect(sptr))
send_reply(sptr, ERR_BADEXPIRE, expire);
return 0;
if (!IsServer(sptr) && MyConnect(sptr))
send_reply(sptr, ERR_BADEXPIRE, expire);
return 0;
/* Inform ops... */
sendto_opmask_butone(0, ircd_strncmp(reason, "AUTO", 4) ? SNO_GLINE :
/* Inform ops... */
sendto_opmask_butone(0, ircd_strncmp(reason, "AUTO", 4) ? SNO_GLINE :
"%Tu: %s",
(feature_bool(FEAT_HIS_SNOTICES) || IsServer(sptr)) ?
cli_name(sptr) :
cli_name((cli_user(sptr))->server),
"%Tu: %s",
(feature_bool(FEAT_HIS_SNOTICES) || IsServer(sptr)) ?
cli_name(sptr) :
cli_name((cli_user(sptr))->server),
(flags & GLINE_LOCAL) ? "local" : "global",
(flags & GLINE_BADCHAN) ? "BADCHAN" : "GLINE", user,
(flags & (GLINE_BADCHAN|GLINE_REALNAME)) ? "" : "@",
(flags & GLINE_LOCAL) ? "local" : "global",
(flags & GLINE_BADCHAN) ? "BADCHAN" : "GLINE", user,
(flags & (GLINE_BADCHAN|GLINE_REALNAME)) ? "" : "@",
if (flags & (GLINE_BADCHAN | GLINE_ANY)) {
gliter(BadChanGlineList, gline, sgline) {
if (flags & (GLINE_BADCHAN | GLINE_ANY)) {
gliter(BadChanGlineList, gline, sgline) {
(flags & GLINE_LASTMOD && !gline->gl_lastmod))
continue;
else if ((flags & GLINE_EXACT ? ircd_strcmp(gline->gl_user, userhost) :
(flags & GLINE_LASTMOD && !gline->gl_lastmod))
continue;
else if ((flags & GLINE_EXACT ? ircd_strcmp(gline->gl_user, userhost) :
canon_userhost(t_uh, &user, &host, "*");
gliter(GlobalGlineList, gline, sgline) {
canon_userhost(t_uh, &user, &host, "*");
gliter(GlobalGlineList, gline, sgline) {