Committer : entrope
CVSROOT : /cvsroot/undernet-ircu
Module : ircu2.10
Commit time: 2005-10-06 00:48:25 UTC
Modified files:
ChangeLog ircd/class.c ircd/ircd_parser.y ircd/s_conf.c
Log message:
Fix setting of FLAG_DOID and buglet from last commit.
---------------------- diff included ----------------------
Index: ircu2.10/ChangeLog
diff -u ircu2.10/ChangeLog:1.719 ircu2.10/ChangeLog:1.720
--- ircu2.10/ChangeLog:1.719 Tue Oct 4 19:15:20 2005
+++ ircu2.10/ChangeLog Wed Oct 5 17:48:15 2005
@@ -1,3 +1,13 @@
+2005-10-05 Michael Poole <[EMAIL PROTECTED]>
+
+ * ircd/class.c (do_find_class): Fix bug from previous commit.
+
+ * ircd/ircd_parser.y (clientblock): Allow setting Client port.
+
+ * ircd/s_conf.c (check_limit_and_attach): Merge into attach_iline.
+ (attach_iline): Only set FLAG_DOID when we are sure we will attach
+ this Client block to the client. [Credit: Jukka Ollila and others]
+
2004-03-20 Fredrik Soderblom <[EMAIL PROTECTED]>
* doc/readme.features: Document this new feature.
Index: ircu2.10/ircd/class.c
diff -u ircu2.10/ircd/class.c:1.36 ircu2.10/ircd/class.c:1.37
--- ircu2.10/ircd/class.c:1.36 Tue Oct 4 18:53:30 2005
+++ ircu2.10/ircd/class.c Wed Oct 5 17:48:15 2005
@@ -18,7 +18,7 @@
*/
/** @file
* @brief Implementation of connection class handling functions.
- * @version $Id: class.c,v 1.36 2005/10/05 01:53:30 entrope Exp $
+ * @version $Id: class.c,v 1.37 2005/10/06 00:48:15 entrope Exp $
*/
#include "config.h"
@@ -238,7 +238,7 @@
struct ConnectionClass *cltmp;
for (cltmp = connClassList; cltmp; cltmp = cltmp->next) {
- if (!cltmp->valid || !extras)
+ if (!cltmp->valid && !extras)
continue;
if (!ircd_strcmp(ConClass(cltmp), name))
return cltmp;
Index: ircu2.10/ircd/ircd_parser.y
diff -u ircu2.10/ircd/ircd_parser.y:1.56 ircu2.10/ircd/ircd_parser.y:1.57
--- ircu2.10/ircd/ircd_parser.y:1.56 Sun Aug 21 06:46:07 2005
+++ ircu2.10/ircd/ircd_parser.y Wed Oct 5 17:48:15 2005
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
* USA.
- * $Id: ircd_parser.y,v 1.56 2005/08/21 13:46:07 entrope Exp $
+ * $Id: ircd_parser.y,v 1.57 2005/10/06 00:48:15 entrope Exp $
*/
%{
@@ -665,6 +665,7 @@
clientblock: CLIENT
{
maxlinks = 65535;
+ port = 0;
}
'{' clientitems '}' ';'
{
@@ -684,6 +685,7 @@
memcpy(&aconf->address.addr, &addr, sizeof(aconf->address.addr));
else
memset(&aconf->address.addr, 0, sizeof(aconf->address.addr));
+ aconf->address.port = port;
aconf->addrbits = addrbits;
aconf->name = ip;
aconf->conn_class = c_class;
@@ -701,9 +703,10 @@
c_class = NULL;
ip = NULL;
pass = NULL;
+ port = 0;
};
clientitems: clientitem clientitems | clientitem;
-clientitem: clienthost | clientip | clientusername | clientclass | clientpass
| clientmaxlinks;
+clientitem: clienthost | clientip | clientusername | clientclass | clientpass
| clientmaxlinks | clientport;
clienthost: HOST '=' QSTRING ';'
{
char *sep = strchr($3, '@');
@@ -752,6 +755,10 @@
{
maxlinks = $3;
};
+clientport: PORT '=' expr ';'
+{
+ port = $3;
+};
killblock: KILL
{
Index: ircu2.10/ircd/s_conf.c
diff -u ircu2.10/ircd/s_conf.c:1.81 ircu2.10/ircd/s_conf.c:1.82
--- ircu2.10/ircd/s_conf.c:1.81 Mon Sep 12 14:22:44 2005
+++ ircu2.10/ircd/s_conf.c Wed Oct 5 17:48:15 2005
@@ -19,7 +19,7 @@
*/
/** @file
* @brief ircd configuration file driver
- * @version $Id: s_conf.c,v 1.81 2005/09/12 21:22:44 decampos Exp $
+ * @version $Id: s_conf.c,v 1.82 2005/10/06 00:48:15 entrope Exp $
*/
#include "config.h"
@@ -345,22 +345,6 @@
}
}
-/** Check client limits and attach Client block.
- * If there are more connections from the IP than \a aconf->maximum
- * allows, return ACR_TOO_MANY_FROM_IP. Otherwise, attach \a aconf to
- * \a cptr.
- * @param cptr Client getting \a aconf.
- * @param aconf Configuration item to attach.
- * @return Authorization check result.
- */
-static enum AuthorizationCheckResult
-check_limit_and_attach(struct Client* cptr, struct ConfItem* aconf)
-{
- if (IPcheck_nr(cptr) > aconf->maximum)
- return ACR_TOO_MANY_FROM_IP;
- return attach_conf(cptr, aconf);
-}
-
/** Find the first (best) Client block to attach.
* @param cptr Client for whom to check rules.
* @return Authorization check result.
@@ -379,17 +363,18 @@
*/
if (aconf->address.port && aconf->address.port !=
cli_listener(cptr)->addr.port)
continue;
- if (aconf->username) {
- SetFlag(cptr, FLAG_DOID);
- if (match(aconf->username, cli_username(cptr)))
- continue;
- }
+ if (aconf->username && match(aconf->username, cli_username(cptr)))
+ continue;
if (aconf->host && match(aconf->host, cli_sockhost(cptr)))
continue;
if ((aconf->addrbits >= 0)
&& !ipmask_check(&cli_ip(cptr), &aconf->address.addr, aconf->addrbits))
continue;
- return check_limit_and_attach(cptr, aconf);
+ if (IPcheck_nr(cptr) > aconf->maximum)
+ return ACR_TOO_MANY_FROM_IP;
+ if (aconf->username)
+ SetFlag(cptr, FLAG_DOID);
+ return attach_conf(cptr, aconf);
}
return ACR_NO_AUTHORIZATION;
}
----------------------- End of diff -----------------------
_______________________________________________
Patches mailing list
[email protected]
http://undernet.sbg.org/mailman/listinfo/patches