Revision: 1901
http://undernet-ircu.svn.sourceforge.net/undernet-ircu/?rev=1901&view=rev
Author: entrope
Date: 2009-01-13 02:43:56 +0000 (Tue, 13 Jan 2009)
Log Message:
-----------
Author: Michael Poole <[email protected]>
Description:
Fix SourceForge bug 2039740 (even local /gline additions count users
on remote servers towards the limit needed to force the G-line).
Modified Paths:
--------------
ircu2/branches/u2_10_12_branch/ChangeLog
ircu2/branches/u2_10_12_branch/ircd/gline.c
Modified: ircu2/branches/u2_10_12_branch/ChangeLog
===================================================================
--- ircu2/branches/u2_10_12_branch/ChangeLog 2009-01-13 02:30:25 UTC (rev
1900)
+++ ircu2/branches/u2_10_12_branch/ChangeLog 2009-01-13 02:43:56 UTC (rev
1901)
@@ -1,5 +1,11 @@
2009-01-12 Michael Poole <[email protected]>
+ * ircd/gline.c (count_users): Accept "flags" mask to limit count
+ to local users.
+ (gline_add): Pass the flags to count_users().
+
+2009-01-12 Michael Poole <[email protected]>
+
* include/gline.h (gline_forward_deactivation): Declare.
* ircd/gline.c (count_users): Use ipmask-based checks too.
Modified: ircu2/branches/u2_10_12_branch/ircd/gline.c
===================================================================
--- ircu2/branches/u2_10_12_branch/ircd/gline.c 2009-01-13 02:30:25 UTC (rev
1900)
+++ ircu2/branches/u2_10_12_branch/ircd/gline.c 2009-01-13 02:43:56 UTC (rev
1901)
@@ -349,10 +349,11 @@
/** Count number of users who match \a mask.
* @param[in] mask us...@host or us...@ip mask to check.
+ * @param[in] flags Bitmask possibly containing the value GLINE_LOCAL, to
limit searches to this server.
* @return Count of matching users.
*/
static int
-count_users(char *mask)
+count_users(char *mask, int flags)
{
struct irc_in_addr ipmask;
struct Client *acptr;
@@ -366,6 +367,8 @@
for (acptr = GlobalClientList; acptr; acptr = cli_next(acptr)) {
if (!IsUser(acptr))
continue;
+ if ((flags & GLINE_LOCAL) && !MyConnect(acptr))
+ continue;
ircd_snprintf(0, namebuf, sizeof(namebuf), "%...@%s",
cli_user(acptr)->username, cli_user(acptr)->host);
@@ -485,7 +488,7 @@
break;
}
- if ((tmp = count_users(uhmask)) >=
+ if ((tmp = count_users(uhmask, flags)) >=
feature_int(FEAT_GLINEMAXUSERCOUNT) && !(flags & GLINE_OPERFORCE))
return send_reply(sptr, ERR_TOOMANYUSERS, tmp);
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
_______________________________________________
Patches mailing list
[email protected]
http://undernet.sbg.org/mailman/listinfo/patches